[gxml] * add serialization test files
- From: Richard Hans Schwarting <rschwart src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gxml] * add serialization test files
- Date: Mon, 18 Jun 2012 18:21:24 +0000 (UTC)
commit 6dbc66693d1d7cdb5ab886926b0d98fa65ef6de6
Author: Richard Schwarting <aquarichy gmail com>
Date: Mon Jun 18 14:20:49 2012 -0400
* add serialization test files
test/serialization/array.xml | 20 ++++++++++++++++++++
test/serialization/hashmap.xml | 6 ++++++
test/serialization/integer.xml | 3 +++
test/serialization/list.xml | 20 ++++++++++++++++++++
test/serialization/object.xml | 4 ++++
test/serialization/string.xml | 4 ++++
test/serialization/struct.xml | 8 ++++++++
test/serialization/type.xml | 14 ++++++++++++++
8 files changed, 79 insertions(+), 0 deletions(-)
---
diff --git a/test/serialization/array.xml b/test/serialization/array.xml
new file mode 100644
index 0000000..961162c
--- /dev/null
+++ b/test/serialization/array.xml
@@ -0,0 +1,20 @@
+<Object>
+ <Property ptype="gint32" pname="age">28</Property>
+ <!--
+ TODO: For lists,
+ * should we have the explicit length? (Not necessary)
+ * should the type be in the parent?
+ * should the list parent be a Property or something more complex?
+ * probably something special, leave Property for simple flat properties, let collections and richer objects be denoted separately?
+ * should we include a * for pointer?
+ * should the name of the children be index values? (Not necessary, can be inferred, but then what should the name be?)
+ * how much special treatment should collection types get? should serialisation code go into GList's own source or be handled by gxml?
+ -->
+
+ <Property ptype="GList" pname="primes">
+ <Property ptype="gint32" pname="0">2</Property>
+ <Property ptype="gint32" pname="1">3</Property>
+ <Property ptype="gint32" pname="2">5</Property>
+ <Property ptype="gint32" pname="3">7</Property>
+ </Property>
+</Object>
diff --git a/test/serialization/hashmap.xml b/test/serialization/hashmap.xml
new file mode 100644
index 0000000..3d9d80d
--- /dev/null
+++ b/test/serialization/hashmap.xml
@@ -0,0 +1,6 @@
+<Object>
+ <Property ptype="gint32" pname="age">28</Property>
+ <Property ptype="GHashTable" pname="monthnames">
+ <!-- TODO: answer questions in list.xml -->
+ <Property>
+</Object>
diff --git a/test/serialization/integer.xml b/test/serialization/integer.xml
new file mode 100644
index 0000000..8ec4951
--- /dev/null
+++ b/test/serialization/integer.xml
@@ -0,0 +1,3 @@
+<Object>
+ <Property ptype="gint32" pname="age">28</Property>
+</Object>
diff --git a/test/serialization/list.xml b/test/serialization/list.xml
new file mode 100644
index 0000000..5a2de5a
--- /dev/null
+++ b/test/serialization/list.xml
@@ -0,0 +1,20 @@
+<Object>
+ <Property ptype="gint32" pname="age">28</Property>
+ <!--
+ TODO: For lists,
+ * should we have the explicit length? (Not necessary)
+ * should the type be in the parent?
+ * should the list parent be a Property or something more complex?
+ * probably something special, leave Property for simple flat properties, let collections and richer objects be denoted separately?
+ * should we include a * for pointer?
+ * should the name of the children be index values? (Not necessary, can be inferred, but then what should the name be?)
+ * how much special treatment should collection types get? should serialisation code go into GList's own source or be handled by gxml?
+ -->
+
+ <Property ptype="GList" pname="primes">
+ <Property ptype="gint32" pname="0">2</Property>
+ <Property ptype="gint32" pname="1">3</Property>
+ <Property ptype="gint32" pname="2">5</Property>
+ <Property ptype="gint32" pname="3">7</Property>
+ <Property>
+</Object>
diff --git a/test/serialization/object.xml b/test/serialization/object.xml
new file mode 100644
index 0000000..3b2b409
--- /dev/null
+++ b/test/serialization/object.xml
@@ -0,0 +1,4 @@
+<Object>
+ <Property ptype="gint32" pname="age">28</Property>
+ <Property ptype="GtkWidget" pname="widget"><!-- work on this when we have working export into XML --></Property>
+</Object>
diff --git a/test/serialization/string.xml b/test/serialization/string.xml
new file mode 100644
index 0000000..ea55d89
--- /dev/null
+++ b/test/serialization/string.xml
@@ -0,0 +1,4 @@
+<Object>
+ <Property ptype="gint32" pname="age">28</Property>
+ <Property ptype="gchar*" pname="name">Richard</Property>
+</Object>
diff --git a/test/serialization/struct.xml b/test/serialization/struct.xml
new file mode 100644
index 0000000..83686c1
--- /dev/null
+++ b/test/serialization/struct.xml
@@ -0,0 +1,8 @@
+<Object>
+ <Property ptype="gint32" pname="age">28</Property>
+ <Property ptype="GString" pname="name">
+ <Property ptype="gchar*" pname="str">Richard</Property>
+ <Property ptype="gsize" pname="len">7</Property>
+ <Property ptype="gsize" pname="allocated_len">8</Property> <!-- TODO: reasonable number? -->
+ </Property>
+</Object>
diff --git a/test/serialization/type.xml b/test/serialization/type.xml
new file mode 100644
index 0000000..bfba7ab
--- /dev/null
+++ b/test/serialization/type.xml
@@ -0,0 +1,14 @@
+<Object>
+ <Property ptype="gint" pname="gint_value">1</Property>
+ <Property ptype="gint64" pname="gint64-value">2</Property> <!-- TODO: test - in prop names --> <!-- TODO: try big sizes for gint64 -->
+ <Property ptype="glong" pname="Glong">4</Property>
+ <Property ptype="gbool" pname="Gbool">true</Property> <!-- TODO: try different forms of bool? --.
+ <Property ptype="gdouble" pname="Gdouble">16.01</Property>
+ <Property ptype="string" pname="String">Supercalifragilisticexpialidocious</Property>
+ <Property ptype="gfloat" pname="Float">30.02</Property> <!-- TODO: try 6e7? -->
+ <Property ptype="guint" pname="Guint">3</Property> <!-- TODO: make larger than an int -->
+ <Property ptype="ulong" pname="Gulong">33</Property> <!-- TODO: make larger than an uint -->
+ <Property ptype="char" pname="Char">z</Property> <!-- TODO: exercise unicode -->
+ <Property ptype="uchar" pname="Uchar">!</Property> <!-- TODO go high -->
+ <!-- TODO: boxed, enum, flags, perhaps have those in their own category -->
+</Object>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]