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/t09-tree.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/t09-tree.c')
-rw-r--r-- | tests/t09-tree.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/tests/t09-tree.c b/tests/t09-tree.c index 8c0b5b024..cb127556b 100644 --- a/tests/t09-tree.c +++ b/tests/t09-tree.c @@ -29,7 +29,7 @@ static const char *tree_oid = "1810dff58d8a660512d4832e740f692884338ccd"; -BEGIN_TEST("readtree", tree_entry_access_test) +BEGIN_TEST(read0, "acces randomly the entries on a loaded tree") git_oid id; git_repository *repo; git_tree *tree; @@ -51,7 +51,7 @@ BEGIN_TEST("readtree", tree_entry_access_test) git_repository_free(repo); END_TEST -BEGIN_TEST("readtree", tree_read_test) +BEGIN_TEST(read1, "read a tree from the repository") git_oid id; git_repository *repo; git_tree *tree; @@ -76,7 +76,7 @@ BEGIN_TEST("readtree", tree_read_test) git_repository_free(repo); END_TEST -BEGIN_TEST("modify", tree_in_memory_add_test) +BEGIN_TEST(write0, "add a new entry to a tree and write it back to disk") const unsigned int entry_count = 128; git_repository *repo; @@ -106,7 +106,7 @@ BEGIN_TEST("modify", tree_in_memory_add_test) git_repository_free(repo); END_TEST -BEGIN_TEST("modify", tree_add_entry_test) +BEGIN_TEST(write1, "add several entries in-memory and validate that they exist; write back to disk") git_oid id; git_repository *repo; git_tree *tree; @@ -157,14 +157,10 @@ BEGIN_TEST("modify", tree_add_entry_test) END_TEST -git_testsuite *libgit2_suite_tree(void) -{ - git_testsuite *suite = git_testsuite_new("Tree"); +BEGIN_SUITE(tree) + ADD_TEST(read0); + ADD_TEST(read1); + ADD_TEST(write0); + ADD_TEST(write1); +END_SUITE - ADD_TEST(suite, "readtree", tree_entry_access_test); - ADD_TEST(suite, "readtree", tree_read_test); - ADD_TEST(suite, "modify", tree_in_memory_add_test); - ADD_TEST(suite, "modify", tree_add_entry_test); - - return suite; -} |