Lines Matching +full:set +full:- +full:content
7 * See the COPYING file in the top-level directory.
45 printf("->%p(%d, '%s'): '%.*s'%s%s\n", n, n->ref, n->name, in dump_ref()
46 (int)(n->content ? n->content->len : strlen("<empty>")), in dump_ref()
47 n->content ? (char *)n->content->data : "<empty>", in dump_ref()
48 n->modified_in_tx ? " MODIFIED" : "", in dump_ref()
49 n->deleted_in_tx ? " DELETED" : ""); in dump_ref()
51 if (n->children) { in dump_ref()
52 g_hash_table_foreach(n->children, (void *)dump_ref, in dump_ref()
63 g_assert(!s->nr_domu_watches); in xs_impl_delete()
67 g_assert(s->nr_nodes == 1); in xs_impl_delete()
69 g_hash_table_unref(s->watches); in xs_impl_delete()
70 g_hash_table_unref(s->transactions); in xs_impl_delete()
71 xs_node_unref(s->root); in xs_impl_delete()
80 for (l = xs_node_list; l; l = l->next) { in xs_impl_delete()
81 XsNode *n = l->data; in xs_impl_delete()
82 printf("Remaining node at %p name %s ref %u\n", n, n->name, in xs_impl_delete()
83 n->ref); in xs_impl_delete()
99 if (!p2 || g_strcmp0(p1->data, p2->data)) { in compare_perms()
102 p1 = p1->next; in compare_perms()
103 p2 = p2->next; in compare_perms()
113 len1 = c1->len; in compare_content()
116 len2 = c2->len; in compare_content()
126 return !memcmp(c1->data, c2->data, len1); in compare_content()
135 if (n1->children) { in compare_nodes()
136 nr_children1 = g_hash_table_size(n1->children); in compare_nodes()
138 if (n2->children) { in compare_nodes()
139 nr_children2 = g_hash_table_size(n2->children); in compare_nodes()
142 if (n1->ref != n2->ref || in compare_nodes()
143 n1->deleted_in_tx != n2->deleted_in_tx || in compare_nodes()
144 n1->modified_in_tx != n2->modified_in_tx || in compare_nodes()
145 !compare_perms(n1->perms, n2->perms) || in compare_nodes()
146 !compare_content(n1->content, n2->content) || in compare_nodes()
148 cw->compare_ok = false; in compare_nodes()
149 printf("Compare failure on '%s'\n", cw->path); in compare_nodes()
153 XsNode *oldparent = cw->parent_2; in compare_nodes()
154 cw->parent_2 = n2; in compare_nodes()
155 g_hash_table_foreach(n1->children, compare_child, cw); in compare_nodes()
157 cw->parent_2 = oldparent; in compare_nodes()
166 XsNode *child2 = g_hash_table_lookup(cw->parent_2->children, childname); in compare_child()
167 int pathlen = strlen(cw->path); in compare_child()
170 cw->compare_ok = false; in compare_child()
171 printf("Child '%s' does not exist under '%s'\n", childname, cw->path); in compare_child()
175 strncat(cw->path, "/", sizeof(cw->path) - 1); in compare_child()
176 strncat(cw->path, childname, sizeof(cw->path) - 1); in compare_child()
179 cw->path[pathlen] = '\0'; in compare_child()
204 t2 = g_hash_table_lookup(s2->transactions, key); in compare_tx()
207 g_assert(t1->tx_id == tx_id); in compare_tx()
208 g_assert(t2->tx_id == tx_id); in compare_tx()
209 g_assert(t1->base_tx == t2->base_tx); in compare_tx()
210 g_assert(t1->dom_id == t2->dom_id); in compare_tx()
211 if (!compare_trees(t1->root, t2->root)) { in compare_tx()
213 dump_ref("Original", t1->root, 0); in compare_tx()
214 dump_ref("Deserialised", t2->root, 0); in compare_tx()
217 g_assert(t1->nr_nodes == t2->nr_nodes); in compare_tx()
222 const char *content) in write_str() argument
227 g_byte_array_append(d, (void *)content, strlen(content)); in write_str()
253 g_assert(s->last_tx == s2->last_tx); in check_serdes()
254 g_assert(s->root_tx == s2->root_tx); in check_serdes()
256 if (!compare_trees(s->root, s2->root)) { in check_serdes()
258 dump_ref("Original", s->root, 0); in check_serdes()
259 dump_ref("Deserialised", s2->root, 0); in check_serdes()
263 nr_transactions1 = g_hash_table_size(s->transactions); in check_serdes()
264 nr_transactions2 = g_hash_table_size(s2->transactions); in check_serdes()
267 g_hash_table_foreach(s->transactions, compare_tx, s2); in check_serdes()
269 g_assert(s->nr_domu_watches == s2->nr_domu_watches); in check_serdes()
270 g_assert(s->nr_domu_transactions == s2->nr_domu_transactions); in check_serdes()
271 g_assert(s->nr_nodes == s2->nr_nodes); in check_serdes()
286 g_assert(s->nr_nodes == 4); in setup()
301 g_assert(s->nr_nodes == 5); in setup()
330 g_assert(guest_watches->len == strlen("someguestwatch")); in test_xs_node_simple()
331 g_assert(!strcmp(guest_watches->str, "someguestwatch")); in test_xs_node_simple()
337 g_assert(qemu_watches->len == strlen("/local/domain/1/someqemuwatch")); in test_xs_node_simple()
338 g_assert(!strcmp(qemu_watches->str, "/local/domain/1/someqemuwatch")); in test_xs_node_simple()
348 g_assert(s->nr_nodes == 7); in test_xs_node_simple()
350 g_assert(!strcmp(guest_watches->str, in test_xs_node_simple()
352 g_assert(!strcmp(qemu_watches->str, in test_xs_node_simple()
362 g_assert(data->len == strlen("something")); in test_xs_node_simple()
363 g_assert(!memcmp(data->data, "something", data->len)); in test_xs_node_simple()
370 g_assert(data->len == strlen("something")); in test_xs_node_simple()
372 g_assert(!qemu_watches->len); in test_xs_node_simple()
373 g_assert(!guest_watches->len); in test_xs_node_simple()
375 old_root = xs_node_ref(s->root); in test_xs_node_simple()
381 g_assert(s->nr_nodes == 7); in test_xs_node_simple()
388 g_assert(s->nr_nodes == 8); in test_xs_node_simple()
389 g_assert(!qemu_watches->len); in test_xs_node_simple()
390 g_assert(!strcmp(guest_watches->str, "some/relative/path2guestwatch")); in test_xs_node_simple()
397 g_assert(s->nr_nodes == 8); in test_xs_node_simple()
398 g_assert(!qemu_watches->len); in test_xs_node_simple()
399 g_assert(!strcmp(guest_watches->str, "some/relative/pathguestwatch")); in test_xs_node_simple()
408 g_assert(!strcmp(items->data, "path")); in test_xs_node_simple()
409 g_assert(items->next); in test_xs_node_simple()
410 g_assert(!strcmp(items->next->data, "path2")); in test_xs_node_simple()
411 g_assert(!items->next->next); in test_xs_node_simple()
425 g_assert(guest_watches->len == strlen("some/relative/path2watchp2")); in test_xs_node_simple()
426 g_assert(!strcmp(guest_watches->str, "some/relative/path2watchp2")); in test_xs_node_simple()
432 g_assert(guest_watches->len == in test_xs_node_simple()
434 g_assert(!strcmp(guest_watches->str, in test_xs_node_simple()
441 g_assert(s->nr_nodes == 8); in test_xs_node_simple()
448 g_assert(!strcmp(guest_watches->str, in test_xs_node_simple()
455 g_assert(data->len == strlen("moredata")); in test_xs_node_simple()
456 g_assert(!memcmp(data->data, "moredata", data->len)); in test_xs_node_simple()
466 g_assert(data->len == strlen("otherdata")); in test_xs_node_simple()
467 g_assert(!memcmp(data->data, "otherdata", data->len)); in test_xs_node_simple()
472 g_assert(s->nr_nodes == 5); in test_xs_node_simple()
475 g_assert(strstr(guest_watches->str, in test_xs_node_simple()
477 g_assert(strstr(guest_watches->str, in test_xs_node_simple()
504 /* Set a watch */ in do_test_xs_node_tx()
508 g_assert(watches->len == strlen("somewatch")); in do_test_xs_node_tx()
509 g_assert(!strcmp(watches->str, "somewatch")); in do_test_xs_node_tx()
515 g_assert(s->nr_nodes == 7); in do_test_xs_node_tx()
517 g_assert(!strcmp(watches->str, in do_test_xs_node_tx()
530 g_assert(s->nr_nodes == 7); in do_test_xs_node_tx()
531 g_assert(!strcmp(watches->str, in do_test_xs_node_tx()
536 g_assert(!watches->len); in do_test_xs_node_tx()
542 g_assert(s->nr_nodes == 7); in do_test_xs_node_tx()
543 g_assert(!watches->len); in do_test_xs_node_tx()
548 g_assert(data->len == strlen("another thing")); in do_test_xs_node_tx()
549 g_assert(!memcmp(data->data, "another thing", data->len)); in do_test_xs_node_tx()
551 g_assert(data->len == strlen("something")); in do_test_xs_node_tx()
552 g_assert(!memcmp(data->data, "something", data->len)); in do_test_xs_node_tx()
558 g_assert(data->len == strlen("something else")); in do_test_xs_node_tx()
559 g_assert(!memcmp(data->data, "something else", data->len)); in do_test_xs_node_tx()
572 g_assert(!strcmp(watches->str, in do_test_xs_node_tx()
576 g_assert(!watches->len); in do_test_xs_node_tx()
578 g_assert(s->nr_nodes == 7); in do_test_xs_node_tx()
589 g_assert(data->len == strlen("another thing")); in do_test_xs_node_tx()
590 g_assert(!memcmp(data->data, "another thing", data->len)); in do_test_xs_node_tx()
592 g_assert(data->len == strlen("something else")); in do_test_xs_node_tx()
593 g_assert(!memcmp(data->data, "something else", data->len)); in do_test_xs_node_tx()
595 g_assert(data->len == strlen("something")); in do_test_xs_node_tx()
596 g_assert(!memcmp(data->data, "something", data->len)); in do_test_xs_node_tx()
628 /* Set a watch */ in test_xs_node_tx_rm()
632 g_assert(watches->len == strlen("somewatch")); in test_xs_node_tx_rm()
633 g_assert(!strcmp(watches->str, "somewatch")); in test_xs_node_tx_rm()
640 g_assert(s->nr_nodes == 9); in test_xs_node_tx_rm()
641 g_assert(!strcmp(watches->str, in test_xs_node_tx_rm()
652 g_assert(s->nr_nodes == 9); in test_xs_node_tx_rm()
653 g_assert(!watches->len); in test_xs_node_tx_rm()
658 g_assert(data->len == strlen("something")); in test_xs_node_tx_rm()
659 g_assert(!memcmp(data->data, "something", data->len)); in test_xs_node_tx_rm()
667 g_assert(s->nr_nodes == 6); in test_xs_node_tx_rm()
669 g_assert(!strcmp(watches->str, "some/deep/darkwatch")); in test_xs_node_tx_rm()
700 g_assert(s->nr_nodes == 9); in test_xs_node_tx_resurrect()
705 g_assert(s->nr_nodes == 11); in test_xs_node_tx_resurrect()
711 g_assert(s->nr_nodes == 11); in test_xs_node_tx_resurrect()
713 /* Set a watch */ in test_xs_node_tx_resurrect()
717 g_assert(watches->len == strlen("somewatch")); in test_xs_node_tx_resurrect()
718 g_assert(!strcmp(watches->str, "somewatch")); in test_xs_node_tx_resurrect()
728 g_assert(s->nr_nodes == 11); in test_xs_node_tx_resurrect()
729 g_assert(!watches->len); in test_xs_node_tx_resurrect()
735 g_assert(s->nr_nodes == 11); in test_xs_node_tx_resurrect()
742 g_assert(s->nr_nodes == 11); in test_xs_node_tx_resurrect()
747 g_assert(strstr(watches->str, "some/deep/dark/different/pathwatch")); in test_xs_node_tx_resurrect()
749 g_assert(strstr(watches->str, "some/deep/dark/relativewatch")); in test_xs_node_tx_resurrect()
751 g_assert(strstr(watches->str, "some/deep/darkwatch")); in test_xs_node_tx_resurrect()
785 g_assert(s->nr_nodes == 9); in test_xs_node_tx_resurrect2()
790 g_assert(s->nr_nodes == 11); in test_xs_node_tx_resurrect2()
796 g_assert(s->nr_nodes == 11); in test_xs_node_tx_resurrect2()
798 /* Set a watch */ in test_xs_node_tx_resurrect2()
802 g_assert(watches->len == strlen("somewatch")); in test_xs_node_tx_resurrect2()
803 g_assert(!strcmp(watches->str, "somewatch")); in test_xs_node_tx_resurrect2()
813 g_assert(s->nr_nodes == 11); in test_xs_node_tx_resurrect2()
814 g_assert(!watches->len); in test_xs_node_tx_resurrect2()
820 g_assert(s->nr_nodes == 11); in test_xs_node_tx_resurrect2()
827 g_assert(s->nr_nodes == 11); in test_xs_node_tx_resurrect2()
832 g_assert(strstr(watches->str, "some/deep/dark/relative/pathwatch")); in test_xs_node_tx_resurrect2()
834 g_assert(strstr(watches->str, "some/deep/darkwatch")); in test_xs_node_tx_resurrect2()
842 g_assert(data->len == strlen("something")); in test_xs_node_tx_resurrect2()
843 g_assert(!memcmp(data->data, "something", data->len)); in test_xs_node_tx_resurrect2()