Lines Matching refs:node
60 const struct json_tree_node *root, *node, *node1, *node2;
76 node = json_tree_find_key(root, test_input[i].value);
77 test_assert(node != NULL &&
78 node->value_type == test_input[i+1].type &&
79 null_strcmp(json_tree_get_value_str(node), test_input[i+1].value) == 0);
82 node = json_tree_find_key(root, "key-obj");
83 test_assert(node != NULL);
85 node = json_tree_find_key(root, "key-arr-empty");
86 test_assert(node != NULL && node->value_type == JSON_TYPE_ARRAY &&
87 json_tree_get_child(node) == NULL);
89 node = json_tree_find_key(root, "key-arr");
90 test_assert(node != NULL && node->value_type == JSON_TYPE_ARRAY);
91 node = json_tree_get_child(node);
92 test_assert(node != NULL && node->value_type == JSON_TYPE_STRING &&
93 strcmp(json_tree_get_value_str(node), "foo") == 0);
94 node = node->next;
95 test_assert(node != NULL && node->value_type == JSON_TYPE_ARRAY &&
96 json_tree_get_child(node) != NULL &&
97 json_tree_get_child(node)->next == NULL &&
98 json_tree_get_child(node)->value_type == JSON_TYPE_TRUE);
99 node = node->next;
100 test_assert(node != NULL && node->value_type == JSON_TYPE_OBJECT &&
101 json_tree_get_child(node) != NULL &&
102 json_tree_get_child(node)->next == NULL &&
103 json_tree_get_child(node)->value_type == JSON_TYPE_ARRAY &&
104 json_tree_get_child(json_tree_get_child(node)) == NULL);
106 node1 = json_tree_find_child_with(node->parent, "aobj-key", "value1");
107 node2 = json_tree_find_child_with(node->parent, "aobj-key", "value2");
109 test_assert(json_tree_find_child_with(node->parent, "aobj-key", "value3") == NULL);