mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-08 10:14:04 +02:00
Improve GNode test coverage
This commit is contained in:
@@ -66,10 +66,13 @@ traversal_test (void)
|
|||||||
{
|
{
|
||||||
GNode *root;
|
GNode *root;
|
||||||
GNode *node_B;
|
GNode *node_B;
|
||||||
|
GNode *node_C;
|
||||||
GNode *node_D;
|
GNode *node_D;
|
||||||
|
GNode *node_E;
|
||||||
GNode *node_F;
|
GNode *node_F;
|
||||||
GNode *node_G;
|
GNode *node_G;
|
||||||
GNode *node_J;
|
GNode *node_J;
|
||||||
|
GNode *n;
|
||||||
gchar *tstring;
|
gchar *tstring;
|
||||||
|
|
||||||
root = g_node_new (C2P ('A'));
|
root = g_node_new (C2P ('A'));
|
||||||
@@ -101,6 +104,16 @@ traversal_test (void)
|
|||||||
* child of 'F', which will cause 'F' to be the last node visited.
|
* child of 'F', which will cause 'F' to be the last node visited.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
node_C = node_B->children;
|
||||||
|
node_E = node_D->next;
|
||||||
|
|
||||||
|
n = g_node_last_sibling (node_C);
|
||||||
|
g_assert (n == node_E);
|
||||||
|
n = g_node_last_sibling (node_D);
|
||||||
|
g_assert (n == node_E);
|
||||||
|
n = g_node_last_sibling (node_E);
|
||||||
|
g_assert (n == node_E);
|
||||||
|
|
||||||
tstring = NULL;
|
tstring = NULL;
|
||||||
g_node_traverse (root, G_PRE_ORDER, G_TRAVERSE_ALL, -1, node_build_string, &tstring);
|
g_node_traverse (root, G_PRE_ORDER, G_TRAVERSE_ALL, -1, node_build_string, &tstring);
|
||||||
g_assert_cmpstr (tstring, ==, "ABCDEFGHIJK");
|
g_assert_cmpstr (tstring, ==, "ABCDEFGHIJK");
|
||||||
|
Reference in New Issue
Block a user