diff UnitTests/ServerIndex.cpp @ 193:a1b9d1e1497b

failed attempt to compile with linux standard base
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 13 Nov 2012 14:02:28 +0100
parents b6cef9d45cc3
children 530a25320461
line wrap: on
line diff
--- a/UnitTests/ServerIndex.cpp	Tue Nov 13 11:29:43 2012 +0100
+++ b/UnitTests/ServerIndex.cpp	Tue Nov 13 14:02:28 2012 +0100
@@ -198,6 +198,30 @@
   index.AttachChild(a[0], a[5]);
   index.AttachChild(a[5], a[7]);
 
+  {
+    Json::Value j;
+    index.GetChildren(j, a[0]);
+    ASSERT_EQ(2, j.size());
+    ASSERT_TRUE((j[0u] == "b" && j[1u] == "f") ||
+                (j[1u] == "b" && j[0u] == "f"));
+
+    index.GetChildren(j, a[1]);
+    ASSERT_EQ(2, j.size());
+    ASSERT_TRUE((j[0u] == "c" && j[1u] == "g") ||
+                (j[1u] == "c" && j[0u] == "g"));
+
+    index.GetChildren(j, a[2]);
+    ASSERT_EQ(2, j.size());
+    ASSERT_TRUE((j[0u] == "d" && j[1u] == "e") ||
+                (j[1u] == "d" && j[0u] == "e"));
+
+    index.GetChildren(j, a[3]); ASSERT_EQ(0, j.size());
+    index.GetChildren(j, a[4]); ASSERT_EQ(0, j.size());
+    index.GetChildren(j, a[5]); ASSERT_EQ(1, j.size()); ASSERT_EQ("h", j[0u].asString());
+    index.GetChildren(j, a[6]); ASSERT_EQ(0, j.size());
+    index.GetChildren(j, a[7]); ASSERT_EQ(0, j.size());
+  }
+
   listener.Reset();
   index.DeleteResource(a[3]);
   ASSERT_EQ("c", listener.ancestorId_);