[gxml/serialization] Fixing merging 'master' and 'serializable' branches.
- From: Daniel Espinosa Ortiz <despinosa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gxml/serialization] Fixing merging 'master' and 'serializable' branches.
- Date: Thu, 24 Oct 2013 13:14:50 +0000 (UTC)
commit c9afb40146228ee761361b4b7da2cd1496b42606
Author: Daniel Espinosa <esodan gmail com>
Date: Thu Oct 24 08:10:12 2013 -0500
Fixing merging 'master' and 'serializable' branches.
* All Unit tests pass
* Resolved conflicts between GLib.Error and GXml.Error
* Added to CLEANFILES all generated .c files
gxml/Makefile.am | 8 +++++++-
gxml/Serializable.vala | 8 ++++----
gxml/SerializableJson.vala | 8 ++++----
gxml/SerializableObjectModel.vala | 8 ++++----
gxml/Serialization.vala | 10 +++++-----
test/Makefile.am | 2 +-
test/SerializableObjectModelTest.vala | 22 +++++++++++-----------
test/SerializableTest.vala | 4 ++--
test/SerializationTest.vala | 19 +++++++++++--------
9 files changed, 49 insertions(+), 40 deletions(-)
---
diff --git a/gxml/Makefile.am b/gxml/Makefile.am
index 37c7a6c..b148f08 100644
--- a/gxml/Makefile.am
+++ b/gxml/Makefile.am
@@ -176,7 +176,13 @@ BUILT_SOURCES = \
# gxml.vala.stamp
## File used to indicate whether code needs rebuilding (?)
-CLEANFILES = $(INTROSPECTION_GIRS) $(typelibs_DATA) $(BUILT_SOURCES) $(nodist_typelib_DATA)
+CLEANFILES = \
+ $(INTROSPECTION_GIRS) \
+ $(typelibs_DATA) \
+ $(BUILT_SOURCES) \
+ $(nodist_typelib_DATA) \
+ $(libgxml_la_SOURCES:.vala=.c)
+
MAINTAINERCLEANFILES = $(BUILT_SOURCES) $(dist_gir_DATA)
diff --git a/gxml/Serializable.vala b/gxml/Serializable.vala
index a663a0f..3196087 100644
--- a/gxml/Serializable.vala
+++ b/gxml/Serializable.vala
@@ -109,7 +109,7 @@ namespace GXml {
*
* @doc an { link GXml.Document} object to serialise to
*/
- public abstract Node? serialize (Node node) throws Error;
+ public abstract Node? serialize (Node node) throws GLib.Error;
/**
* Handles serializing individual properties.
@@ -139,7 +139,7 @@ namespace GXml {
*/
public abstract GXml.Node? serialize_property (Element element,
GLib.ParamSpec prop)
- throws Error;
+ throws GLib.Error;
/**
* Deserialize this object.
@@ -147,7 +147,7 @@ namespace GXml {
* @node { link GXml.Node} used to deserialize from.
*/
public abstract Node? deserialize (Node node)
- throws Error;
+ throws GLib.Error;
/**
* Handles deserializing individual properties.
*
@@ -171,7 +171,7 @@ namespace GXml {
* @return `true` if the property was handled, `false` if { link GXml.Serialization} should
handle it.
*/
public abstract bool deserialize_property (GXml.Node property_node)
- throws Error;
+ throws GLib.Error;
/**
* Signal to serialize unknown properties. Any new node must be added to
diff --git a/gxml/SerializableJson.vala b/gxml/SerializableJson.vala
index 3bd6023..276bb74 100644
--- a/gxml/SerializableJson.vala
+++ b/gxml/SerializableJson.vala
@@ -76,7 +76,7 @@ public class GXml.SerializableJson : GLib.Object, Serializable
* Is up to you to add convenient Element node to a Document, in order to be
* used by serialize and add new <Object> tags per object to serialize.
*/
- public Node? serialize (Node node) throws Error
+ public Node? serialize (Node node) throws GLib.Error
{
Document doc;
Element root;
@@ -101,7 +101,7 @@ public class GXml.SerializableJson : GLib.Object, Serializable
public virtual GXml.Node? serialize_property (Element element,
GLib.ParamSpec prop)
- throws Error
+ throws GLib.Error
{
Type type;
Value val;
@@ -165,7 +165,7 @@ public class GXml.SerializableJson : GLib.Object, Serializable
return prop_node;
}
- public Node? deserialize (Node node) throws Error
+ public Node? deserialize (Node node) throws GLib.Error
{
Element obj_elem;
ParamSpec[] specs;
@@ -185,7 +185,7 @@ public class GXml.SerializableJson : GLib.Object, Serializable
return obj_elem;
}
- public virtual bool deserialize_property (GXml.Node property_node) throws Error
+ public virtual bool deserialize_property (GXml.Node property_node) throws GLib.Error
{
//GLib.message ("At SerializableJson.deserialize_property");
if (property_node.node_name == "Property")
diff --git a/gxml/SerializableObjectModel.vala b/gxml/SerializableObjectModel.vala
index 58aeb48..2b7f284 100644
--- a/gxml/SerializableObjectModel.vala
+++ b/gxml/SerializableObjectModel.vala
@@ -62,7 +62,7 @@ public abstract class GXml.SerializableObjectModel : Object, Serializable
default_set_property_value (spec, val);
}
- public Node? serialize (Node node) throws Error
+ public Node? serialize (Node node) throws GLib.Error
{
Document doc;
if (node is Document)
@@ -85,7 +85,7 @@ public abstract class GXml.SerializableObjectModel : Object, Serializable
public GXml.Node? serialize_property (Element element,
GLib.ParamSpec prop)
- throws Error
+ throws GLib.Error
{
if (prop.value_type.is_a (typeof (Serializable)))
{
@@ -119,7 +119,7 @@ public abstract class GXml.SerializableObjectModel : Object, Serializable
}
public virtual Node? deserialize (Node node)
- throws Error
+ throws GLib.Error
{
Document doc;
if (node is Document) {
@@ -154,7 +154,7 @@ public abstract class GXml.SerializableObjectModel : Object, Serializable
}
public virtual bool deserialize_property (GXml.Node property_node)
- throws Error
+ throws GLib.Error
{
bool ret = false;
var prop = find_property_spec (property_node.node_name);
diff --git a/gxml/Serialization.vala b/gxml/Serialization.vala
index a0cdda5..f90ff54 100644
--- a/gxml/Serialization.vala
+++ b/gxml/Serialization.vala
@@ -102,7 +102,7 @@ namespace GXml {
private static GXml.Node serialize_property (GLib.Object object,
ParamSpec prop_spec,
GXml.Document doc)
- throws Error
+ throws GLib.Error
{
Type type;
Value value;
@@ -210,7 +210,7 @@ namespace GXml {
* @param object A { link GLib.Object} to serialize
* @return a { link GXml.Document} representing the serialized `object`
*/
- public static GXml.Document serialize_object (GLib.Object object) throws Error
+ public static GXml.Document serialize_object (GLib.Object object) throws GLib.Error
{
Document doc;
Element root;
@@ -291,7 +291,7 @@ namespace GXml {
*/
private static void deserialize_property (ParamSpec spec, Element prop_elem,
out Value val)
- throws Error
+ throws GLib.Error
{
Type type;
type = spec.value_type;
@@ -356,7 +356,7 @@ namespace GXml {
* @doc a { link GXml.Document} to deseralize from
* @return the deserialized { link GLib.Object}
*/
- public static GLib.Object deserialize_object (Type type, GXml.Document doc) throws Error
+ public static GLib.Object deserialize_object (Type type, GXml.Document doc) throws GLib.Error
{
if (type.is_a (typeof (Serializable))) {
Object object = Object.new (type);
@@ -371,7 +371,7 @@ namespace GXml {
* because Serializable have its own method serialize/deserialize
*/
internal static GLib.Object? deserialize_object_from_node (GXml.Node obj_node)
- throws Error
+ throws GLib.Error
{
Element obj_elem;
string otype;
diff --git a/test/Makefile.am b/test/Makefile.am
index 82dc5bc..93d939f 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -79,7 +79,7 @@ gxml_test_LDFLAGS = $(AM_LDFLAGS)
BUILT_SOURCES = gxml_test.vala.stamp
-CLEANFILES = $(BUILT_SOURCES) gxml_test
+CLEANFILES = $(gxml_test_SOURCES:.vala=.c) $(BUILT_SOURCES) gxml_test
DISTCLEANFILES = _serialization_test_*.xml
diff --git a/test/SerializableObjectModelTest.vala b/test/SerializableObjectModelTest.vala
index ed45fd4..35532bb 100644
--- a/test/SerializableObjectModelTest.vala
+++ b/test/SerializableObjectModelTest.vala
@@ -115,7 +115,7 @@ public class Package : ObjectModel
((Element) node).content = str;
element.append_child (node);
}
- } catch (Error e) {
+ } catch (GLib.Error e) {
GLib.message (e.message);
assert_not_reached ();
}
@@ -129,7 +129,7 @@ public class Package : ObjectModel
if (element.node_name == "tag") {
tags.append_val (((Element) element).content);
}
- } catch (Error e) {
+ } catch (GLib.Error e) {
GLib.message (e.message);
assert_not_reached ();
}
@@ -192,7 +192,7 @@ class SerializableObjectModelTest : GXmlTest
assert_not_reached ();
}
}
- catch (Error e)
+ catch (GLib.Error e)
{
GLib.message (e.message);
assert_not_reached ();
@@ -221,7 +221,7 @@ class SerializableObjectModelTest : GXmlTest
stdout.printf (@"ERROR XML_COMPUTER: ghz val: $(computer.ghz)\n");
assert_not_reached ();
}
- } catch (Error e)
+ } catch (GLib.Error e)
{
GLib.message (@"GHz : $(computer.to_string ()) ERROR: $(e.message)");
assert_not_reached ();
@@ -247,7 +247,7 @@ class SerializableObjectModelTest : GXmlTest
assert_not_reached ();
}
}
- catch (Error e) {
+ catch (GLib.Error e) {
GLib.message (@"Error: $(e.message)");
assert_not_reached ();
}
@@ -265,7 +265,7 @@ class SerializableObjectModelTest : GXmlTest
}
Element element = doc.document_element;
serialize_manual_check (element, manual);
- } catch (Error e) {
+ } catch (GLib.Error e) {
stdout.printf (@"$(e.message)");
assert_not_reached ();
}
@@ -318,7 +318,7 @@ class SerializableObjectModelTest : GXmlTest
assert_not_reached ();
}
}
- catch (Error e) {
+ catch (GLib.Error e) {
GLib.message (@"Error: $(e.message)");
assert_not_reached ();
}
@@ -348,7 +348,7 @@ class SerializableObjectModelTest : GXmlTest
assert_not_reached ();
}
}
- catch (Error e) {
+ catch (GLib.Error e) {
GLib.message (@"Error: $(e.message)");
assert_not_reached ();
}
@@ -377,7 +377,7 @@ class SerializableObjectModelTest : GXmlTest
assert_not_reached ();
}
}
- catch (Error e) {
+ catch (GLib.Error e) {
GLib.message (@"Error: $(e.message)");
assert_not_reached ();
}
@@ -424,7 +424,7 @@ class SerializableObjectModelTest : GXmlTest
assert_not_reached ();
}
}
- catch (Error e) {
+ catch (GLib.Error e) {
GLib.message (@"Error: $(e.message)");
assert_not_reached ();
}
@@ -451,7 +451,7 @@ class SerializableObjectModelTest : GXmlTest
assert_not_reached ();
}
}
- catch (Error e) {
+ catch (GLib.Error e) {
GLib.message (@"Error: $(e.message)");
assert_not_reached ();
}
diff --git a/test/SerializableTest.vala b/test/SerializableTest.vala
index 5751939..db34d40 100644
--- a/test/SerializableTest.vala
+++ b/test/SerializableTest.vala
@@ -227,7 +227,7 @@ class SerializableTest : GXmlTest {
try {
doc = new Document ();
capsicum.serialize (doc);
- } catch (Error e) {
+ } catch (GLib.Error e) {
GLib.message ("%s", e.message);
assert_not_reached ();
}
@@ -243,7 +243,7 @@ class SerializableTest : GXmlTest {
try {
capsicum_new =
(SerializableCapsicum)Serialization.deserialize_object (typeof (SerializableCapsicum), doc);
- } catch (Error e) {
+ } catch (GLib.Error e) {
Test.message ("%s", e.message);
assert_not_reached ();
}
diff --git a/test/SerializationTest.vala b/test/SerializationTest.vala
index 5420103..929db95 100644
--- a/test/SerializationTest.vala
+++ b/test/SerializationTest.vala
@@ -325,7 +325,7 @@ class SerializationTest : GXmlTest {
} catch (GXml.SerializationError e) {
Test.message ("%s", e.message);
assert_not_reached ();
- } catch (Error e) {
+ } catch (GLib.Error e) {
Test.message ("%s", e.message);
assert_not_reached ();
}
@@ -370,11 +370,14 @@ class SerializationTest : GXmlTest {
Serialization.deserialize_object (typeof (Fruit), doc);
Test.message ("Expected SerializationError.UNKNOWN_PROPERTY to be
thrown for property 'badname' in object 'Fruit' :( Did not happen.");
assert_not_reached ();
- } catch (GXml.SerializationError.UNKNOWN_PROPERTY e) {
- // Pass
} catch (GLib.Error e) {
- Test.message ("%s", e.message);
- assert_not_reached ();
+ stdout.printf (@"Cought Error: $(e.message)");
+ if (e is GXml.SerializationError.UNKNOWN_PROPERTY) {
+ // pass
+ } else {
+ GLib.message (@"Error is not UNKNOWN_PROPERTY: $(e.message)");
+ assert_not_reached ();
+ }
}
});
Test.add_func ("/gxml/serialization/xml_deserialize_bad_object_type", () => {
@@ -448,7 +451,7 @@ class SerializationTest : GXmlTest {
xml = Serialization.serialize_object (obj);
restored =
(ComplexDuplicateProperties)Serialization.deserialize_object (typeof (ComplexDuplicateProperties), xml);
- } catch (Error e) {
+ } catch (GLib.Error e) {
Test.message ("%s", e.message);
assert_not_reached ();
}
@@ -589,7 +592,7 @@ class SerializationTest : GXmlTest {
Test.message ("Regular expression [%s] for test failed: %s",
expectation, e.message);
assert_not_reached ();
- } catch (Error e) {
+ } catch (GLib.Error e) {
Test.message ("%s", e.message);
assert_not_reached ();
}
@@ -612,7 +615,7 @@ class SerializationTest : GXmlTest {
Test.message ("Expected [\"%s\", %d, \"%s\", %d] but
found [%s]", "blue", 11, "fish", 3, fruit.to_string ());
assert_not_reached (); // Note that age sets weight
normally
}
- } catch (Error e) {
+ } catch (GLib.Error e) {
Test.message ("%s", e.message);
assert_not_reached ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]