"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/knot/test_changeset.c" between
knot-2.9.1.tar.xz and knot-2.9.2.tar.xz

About: Knot DNS is a high-performance authoritative-only DNS server (supports zone transfers, dynamic updates and DNSSEC).

test_changeset.c  (knot-2.9.1.tar.xz):test_changeset.c  (knot-2.9.2.tar.xz)
skipping to change at line 149 skipping to change at line 149
apex_txt_rr->owner = apex_txt_rr->owner =
knot_dname_from_str_alloc("and.now.for.something.completely.diffe rent.test."); knot_dname_from_str_alloc("and.now.for.something.completely.diffe rent.test.");
assert(apex_txt_rr->owner); assert(apex_txt_rr->owner);
ret = changeset_add_removal(ch2, apex_txt_rr, CHANGESET_CHECK); ret = changeset_add_removal(ch2, apex_txt_rr, CHANGESET_CHECK);
assert(ret == KNOT_EOK); assert(ret == KNOT_EOK);
// Test merge. // Test merge.
ret = changeset_merge(ch, ch2, 0); ret = changeset_merge(ch, ch2, 0);
ok(ret == KNOT_EOK && changeset_size(ch) == 5, "changeset: merge"); ok(ret == KNOT_EOK && changeset_size(ch) == 5, "changeset: merge");
// Test preapply fix.
zone_contents_t *z = zone_contents_new((const knot_dname_t *)"\x04""test"
, false);
knot_dname_free(apex_txt_rr->owner, NULL);
apex_txt_rr->owner = knot_dname_from_str_alloc("something.test.");
assert(apex_txt_rr->owner);
zone_node_t *znode = NULL;
ret = zone_contents_add_rr(z, apex_txt_rr, &znode);
assert(ret == KNOT_EOK);
ret = changeset_preapply_fix(z, ch2);
ok(ret == KNOT_EOK, "changeset: preapply fix ok (%s)", knot_strerror(ret)
);
ok(changeset_empty(ch2), "changeset: preapply fix works");
zone_contents_deep_free(z);
// Test cancelout.
ret = changeset_add_removal(ch2, apex_txt_rr, 0);
assert(ret == KNOT_EOK);
ret = changeset_add_addition(ch2, apex_txt_rr, 0);
assert(ret == KNOT_EOK);
ret = changeset_cancelout(ch2);
ok(ret == KNOT_EOK, "changeset: cancelout ok (%s)", knot_strerror(ret));
ok(changeset_empty(ch2), "changeset: cancelout works");
// Test cleanup. // Test cleanup.
changeset_clear(ch); changeset_clear(ch);
ok(changeset_empty(ch), "changeset: clear"); ok(changeset_empty(ch), "changeset: clear");
free(ch); free(ch);
list_t chgs; list_t chgs;
init_list(&chgs); init_list(&chgs);
add_head(&chgs, &ch2->n); add_head(&chgs, &ch2->n);
changesets_clear(&chgs); changesets_clear(&chgs);
ok(changeset_empty(ch2), "changeset: clear list"); ok(changeset_empty(ch2), "changeset: clear list");
 End of changes. 1 change blocks. 
24 lines changed or deleted 0 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)