summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4a307af)
raw | patch | inline | side by side (parent: 4a307af)
author | Sebastian Harl <sh@tokkee.org> | |
Tue, 8 Jul 2014 18:40:33 +0000 (20:40 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Tue, 8 Jul 2014 18:40:33 +0000 (20:40 +0200) |
t/unit/utils/avltree_test.c | patch | blob | history |
index d978eff9da688fc4306728f060db34a9a9e04609..3ca8054b07b18b791af27657807684761d220749 100644 (file)
"sdb_avltree_size(<tree>) = %d; expected: %zu",
check, i + 1);
}
+
+ /* and again ... now reporting errors because of duplicates */
+ for (i = 0; i < SDB_STATIC_ARRAY_LEN(test_data); ++i) {
+ int check;
+
+ check = sdb_avltree_insert(tree, &test_data[i]);
+ fail_unless(check < 0,
+ "sdb_avltree_insert(<tree>, <%s>) = %d (redo); expected: <0",
+ test_data[i].name, check);
+
+ check = (int)sdb_avltree_size(tree);
+ fail_unless(check == SDB_STATIC_ARRAY_LEN(test_data),
+ "sdb_avltree_size(<tree>) = %d; expected: %zu",
+ check, SDB_STATIC_ARRAY_LEN(test_data));
+ }
}
END_TEST
"sdb_avltree_iter_get_next(<iter>) = <obj>; expected: NULL");
sdb_avltree_iter_destroy(iter);
+
+ sdb_avltree_clear(tree);
+ check = sdb_avltree_size(tree);
+ fail_unless(check == 0,
+ "sdb_avltree_clear(<tree>) left %zu nodes in the tree; "
+ "expected: 0", check);
}
END_TEST