[gxml: 4/18] * add a test for serialising/deserialising TreeSets
- From: Richard Hans Schwarting <rschwart src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gxml: 4/18] * add a test for serialising/deserialising TreeSets
- Date: Tue, 18 Jun 2013 18:14:17 +0000 (UTC)
commit 3f1568e0c331b5b89464ca53fba934993285a01f
Author: Richard Schwarting <aquarichy gmail com>
Date: Tue Jun 4 10:37:31 2013 -0400
* add a test for serialising/deserialising TreeSets
test/SerializationTest.vala | 26 +++++++++++++++++++++++++-
1 files changed, 25 insertions(+), 1 deletions(-)
---
diff --git a/test/SerializationTest.vala b/test/SerializationTest.vala
index 4fc5326..f96950a 100644
--- a/test/SerializationTest.vala
+++ b/test/SerializationTest.vala
@@ -466,7 +466,31 @@ class SerializationTest : GXmlTest {
test_serialization_deserialization (obj, "recursion",
(GLib.EqualFunc)RecursiveProperty.equals, (StringifyFunc)RecursiveProperty.to_string);
});
-
+ Test.add_func ("/gxml/serialization/gee_collection_tree_set", () => {
+ Gee.TreeSet<string> s = new Gee.TreeSet<string> ();
+
+ s.add ("stars");
+ s.add ("Sterne");
+ s.add ("etoile");
+
+ test_serialization_deserialization (s, "gee_collection_tree_set",
+ (ao, bo) => { // equals
+ Gee.TreeSet<string> a =
(Gee.TreeSet<string>)ao;
+ Gee.TreeSet<string> b =
(Gee.TreeSet<string>)bo;
+
+ return
(((Gee.Collection)a).contains_all (b) && ((Gee.Collection)b).contains_all (a));
+ },
+ (obj) => { // to_string
+ Gee.TreeSet<string> tree_set =
(Gee.TreeSet<string>)obj;
+
+ string str = "{ ";
+ foreach (string item in tree_set)
{
+ str += "[" + item + "] ";
+ }
+ str += "}";
+ return str;
+ });
+ });
// TODO: more to do, for structs and stuff and things that interfaces
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]