Ejemplo n.º 1
0
Ni_node root = Ni_GetRoot (node);
TEST_COND (root == node);

Ni_node parent = Ni_GetParent (node);
TEST_COND (parent == NULL);

int children = Ni_GetNumChildren (node);
TEST_COND (children == 0);

int modified = Ni_GetModified (node);
TEST_COND (modified == 0);

const char * value = Ni_GetValue (node, NULL);
TEST_COND (value == NULL);

int error = Ni_SetValue (node, "", 0);
TEST_COND (error < 0);

Ni_Free (node);
END_TEST ()

BEGIN_TEST (tree)
Ni_node node = Ni_New ();
assert (node != NULL);

Ni_node child = Ni_GetChild (node, "a", -1, 1, NULL);
assert (child != NULL);

int children = Ni_GetNumChildren (node);
TEST_COND (children == 1);
Ejemplo n.º 2
0
   Ni_node root = Ni_GetRoot(node);
   TEST_COND(root == node);

   Ni_node parent = Ni_GetParent(node);
   TEST_COND(parent == NULL);

   int children = Ni_GetNumChildren(node);
   TEST_COND(children == 0);

   int modified = Ni_GetModified(node);
   TEST_COND(modified == 0);

   const char * value = Ni_GetValue(node, NULL);
   TEST_COND(value == NULL);

   int error = Ni_SetValue(node, "", 0);
   TEST_COND(error < 0);

   Ni_Free(node);
END_TEST()

BEGIN_TEST(tree)
   Ni_node node = Ni_New();
   assert(node != NULL);

   Ni_node child = Ni_GetChild(node, "a", -1, 1, NULL);
   assert(child != NULL);

   int children = Ni_GetNumChildren(node);
   TEST_COND(children == 1);