[gobject-introspection: 2/4] Add regression tests for default ByteArray element type.
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection: 2/4] Add regression tests for default ByteArray element type.
- Date: Mon, 18 Jun 2018 07:03:53 +0000 (UTC)
commit a48dfc5a8af0743620e2130768755b4dcd604034
Author: Tomasz Miąsko <tomasz miasko gmail com>
Date: Sun Apr 15 00:00:00 2018 +0000
Add regression tests for default ByteArray element type.
.../Regress.TestObj-byte-array.page | 15 +++++++++++++++
.../Regress.TestObj-byte-array.page | 18 ++++++++++++++++++
.../Regress-1.0-Gjs-expected/Regress.TestObj.page | 1 +
.../Regress.TestObj-byte-array.page | 18 ++++++++++++++++++
.../Regress-1.0-Python-expected/Regress.TestObj.page | 2 +-
tests/scanner/Regress-1.0-expected.gir | 8 ++++++++
tests/scanner/regress.c | 15 ++++++++++++++-
7 files changed, 75 insertions(+), 2 deletions(-)
---
diff --git a/tests/scanner/Regress-1.0-C-expected/Regress.TestObj-byte-array.page
b/tests/scanner/Regress-1.0-C-expected/Regress.TestObj-byte-array.page
new file mode 100644
index 00000000..368ed465
--- /dev/null
+++ b/tests/scanner/Regress-1.0-C-expected/Regress.TestObj-byte-array.page
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<page id="Regress.TestObj-byte-array"
+ type="topic"
+ style="property"
+ xmlns="http://projectmallard.org/1.0/"
+ xmlns:api="http://projectmallard.org/experimental/api/"
+ xmlns:ui="http://projectmallard.org/1.0/ui/">
+ <info>
+ <link xref="Regress.TestObj" group="property" type="guide"/>
+ <title type="link" role="topic">byte-array</title>
+ </info>
+ <title>Regress.TestObj:byte-array</title>
+
+
+</page>
diff --git a/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestObj-byte-array.page
b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestObj-byte-array.page
new file mode 100644
index 00000000..73d0b5d2
--- /dev/null
+++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestObj-byte-array.page
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<page id="Regress.TestObj-byte-array"
+ type="topic"
+ style="property"
+ xmlns="http://projectmallard.org/1.0/"
+ xmlns:api="http://projectmallard.org/experimental/api/"
+ xmlns:ui="http://projectmallard.org/1.0/ui/">
+ <info>
+ <link xref="Regress.TestObj" group="property" type="guide"/>
+ <title type="link" role="topic">byte-array</title>
+ </info>
+ <title>Regress.TestObj.byte_array</title>
+ <synopsis><code mime="text/x-gjs">
+TestObj.byte_array: ByteArray (Read / Write / Construct)
+ </code></synopsis>
+
+
+</page>
diff --git a/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestObj.page
b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestObj.page
index d0cdfafc..bacdcff1 100644
--- a/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestObj.page
+++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestObj.page
@@ -13,6 +13,7 @@
const Regress = imports.gi.Regress;
let testObj = new Regress.TestObj({
+ <link xref='Regress.TestObj-byte-array'>byte_array</link>: value,
<link xref='Regress.TestObj-name-conflict'>name_conflict</link>: value,
});
</code></synopsis>
diff --git a/tests/scanner/Regress-1.0-Python-expected/Regress.TestObj-byte-array.page
b/tests/scanner/Regress-1.0-Python-expected/Regress.TestObj-byte-array.page
new file mode 100644
index 00000000..62b5289d
--- /dev/null
+++ b/tests/scanner/Regress-1.0-Python-expected/Regress.TestObj-byte-array.page
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<page id="Regress.TestObj-byte-array"
+ type="topic"
+ style="property"
+ xmlns="http://projectmallard.org/1.0/"
+ xmlns:api="http://projectmallard.org/experimental/api/"
+ xmlns:ui="http://projectmallard.org/1.0/ui/">
+ <info>
+ <link xref="Regress.TestObj" group="property" type="guide"/>
+ <title type="link" role="topic">byte-array</title>
+ </info>
+ <title>Regress.TestObj:byte-array</title>
+ <synopsis><code mime="text/x-python">
+"byte-array" [guint8] : Read / Write / Construct
+ </code></synopsis>
+
+
+</page>
diff --git a/tests/scanner/Regress-1.0-Python-expected/Regress.TestObj.page
b/tests/scanner/Regress-1.0-Python-expected/Regress.TestObj.page
index e28fae67..6f457043 100644
--- a/tests/scanner/Regress-1.0-Python-expected/Regress.TestObj.page
+++ b/tests/scanner/Regress-1.0-Python-expected/Regress.TestObj.page
@@ -12,7 +12,7 @@
<synopsis><code>
from gi.repository import Regress
-test_obj = Regress.TestObj(<link xref='Regress.TestObj-bare'>bare</link>=value, <link
xref='Regress.TestObj-boxed'>boxed</link>=value, <link xref='Regress.TestObj-double'>double</link>=value,
<link xref='Regress.TestObj-float'>float</link>=value, <link xref='Regress.TestObj-gtype'>gtype</link>=value,
<link xref='Regress.TestObj-hash-table'>hash_table</link>=value, <link
xref='Regress.TestObj-hash-table-old'>hash_table_old</link>=value, <link
xref='Regress.TestObj-int'>int</link>=value, <link xref='Regress.TestObj-list'>list</link>=value, <link
xref='Regress.TestObj-list-old'>list_old</link>=value, <link
xref='Regress.TestObj-name-conflict'>name_conflict</link>=value, <link
xref='Regress.TestObj-pptrarray'>pptrarray</link>=value, <link
xref='Regress.TestObj-string'>string</link>=value)
+test_obj = Regress.TestObj(<link xref='Regress.TestObj-bare'>bare</link>=value, <link
xref='Regress.TestObj-boxed'>boxed</link>=value, <link
xref='Regress.TestObj-byte-array'>byte_array</link>=value, <link
xref='Regress.TestObj-double'>double</link>=value, <link xref='Regress.TestObj-float'>float</link>=value,
<link xref='Regress.TestObj-gtype'>gtype</link>=value, <link
xref='Regress.TestObj-hash-table'>hash_table</link>=value, <link
xref='Regress.TestObj-hash-table-old'>hash_table_old</link>=value, <link
xref='Regress.TestObj-int'>int</link>=value, <link xref='Regress.TestObj-list'>list</link>=value, <link
xref='Regress.TestObj-list-old'>list_old</link>=value, <link
xref='Regress.TestObj-name-conflict'>name_conflict</link>=value, <link
xref='Regress.TestObj-pptrarray'>pptrarray</link>=value, <link
xref='Regress.TestObj-string'>string</link>=value)
</code></synopsis>
diff --git a/tests/scanner/Regress-1.0-expected.gir b/tests/scanner/Regress-1.0-expected.gir
index cd47fcb5..28a78ba3 100644
--- a/tests/scanner/Regress-1.0-expected.gir
+++ b/tests/scanner/Regress-1.0-expected.gir
@@ -3576,6 +3576,14 @@ raise an error.</doc>
<property name="boxed" writable="1" transfer-ownership="none">
<type name="TestBoxed"/>
</property>
+ <property name="byte-array"
+ writable="1"
+ construct="1"
+ transfer-ownership="none">
+ <array name="GLib.ByteArray">
+ <type name="guint8" c:type="guint8"/>
+ </array>
+ </property>
<property name="double" writable="1" transfer-ownership="none">
<type name="gdouble" c:type="gdouble"/>
</property>
diff --git a/tests/scanner/regress.c b/tests/scanner/regress.c
index a940a199..3c186238 100644
--- a/tests/scanner/regress.c
+++ b/tests/scanner/regress.c
@@ -2101,7 +2101,8 @@ enum
PROP_TEST_OBJ_DOUBLE,
PROP_TEST_OBJ_STRING,
PROP_TEST_OBJ_GTYPE,
- PROP_TEST_OBJ_NAME_CONFLICT
+ PROP_TEST_OBJ_NAME_CONFLICT,
+ PROP_TEST_OBJ_BYTE_ARRAY,
};
static void
@@ -2690,6 +2691,18 @@ regress_test_obj_class_init (RegressTestObjClass *klass)
PROP_TEST_OBJ_NAME_CONFLICT,
pspec);
+ /**
+ * TestObj:byte-array:
+ */
+ pspec = g_param_spec_boxed ("byte-array",
+ "GByteArray property",
+ "A contained byte array without any element-type annotations",
+ G_TYPE_BYTE_ARRAY,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
+ g_object_class_install_property (gobject_class,
+ PROP_TEST_OBJ_BYTE_ARRAY,
+ pspec);
+
klass->matrix = regress_test_obj_default_matrix;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]