diff options
author | Vicent Marti <tanoku@gmail.com> | 2011-03-03 18:19:05 +0200 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2011-03-03 20:23:52 +0200 |
commit | 3dccfed16382c64370dd0fd88668c9d9accae6ed (patch) | |
tree | 21406b78ecda452244d9ceb64e5ac9ea8337ffd9 /tests/t07-hashtable.c | |
parent | 8fc050961c6f5d3bc8f2bc27799922bebae4b743 (diff) | |
download | libgit2-3dccfed16382c64370dd0fd88668c9d9accae6ed.tar.gz |
Cleanup the testing toolkit
Tests are now declared with detailed descriptions and a short test name:
BEGIN_TEST(the_test0, "this is an example test that does something")
...
END_TEST
Modules are declared through a simple macro interface:
BEGIN_MODULE(mod_name)
ADD_TEST(the_test0);
...
END_MODULE
Error messages when tests fail have been greatly improved.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
Diffstat (limited to 'tests/t07-hashtable.c')
-rw-r--r-- | tests/t07-hashtable.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/tests/t07-hashtable.c b/tests/t07-hashtable.c index 76eb0d1a1..597136965 100644 --- a/tests/t07-hashtable.c +++ b/tests/t07-hashtable.c @@ -49,7 +49,7 @@ int hash_cmpkey(const void *a, const void *b) return git_oid_cmp(a, b); } -BEGIN_TEST("table", table_create) +BEGIN_TEST(table0, "create a new hashtable") git_hashtable *table = NULL; @@ -61,7 +61,7 @@ BEGIN_TEST("table", table_create) END_TEST -BEGIN_TEST("table", table_populate) +BEGIN_TEST(table1, "fill the hashtable with random entries") const int objects_n = 32; int i; @@ -109,7 +109,7 @@ BEGIN_TEST("table", table_populate) END_TEST -BEGIN_TEST("table", table_resize) +BEGIN_TEST(table2, "make sure the table resizes automatically") const int objects_n = 64; int i; @@ -150,7 +150,7 @@ BEGIN_TEST("table", table_resize) END_TEST -BEGIN_TEST("tableit", table_iterator) +BEGIN_TEST(tableit0, "iterate through all the contents of the table") const int objects_n = 32; int i; @@ -184,14 +184,10 @@ BEGIN_TEST("tableit", table_iterator) END_TEST -git_testsuite *libgit2_suite_hashtable(void) -{ - git_testsuite *suite = git_testsuite_new("Hashtable"); - - ADD_TEST(suite, "table", table_create); - ADD_TEST(suite, "table", table_populate); - ADD_TEST(suite, "table", table_resize); - ADD_TEST(suite, "tableit", table_iterator); +BEGIN_SUITE(hashtable) + ADD_TEST(table0); + ADD_TEST(table1); + ADD_TEST(table2); + ADD_TEST(tableit0); +END_SUITE - return suite; -} |