summaryrefslogtreecommitdiff
path: root/tests/t1003-readpackedref.c
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2011-02-02 02:15:25 +0200
committerVicent Marti <tanoku@gmail.com>2011-02-02 02:15:25 +0200
commit2a1732b43904d67cfeb301a5287b13c5893f9b64 (patch)
treed5560b1826b3f8369aebc0ed3d887d556f245e8f /tests/t1003-readpackedref.c
parentb70e4f8a0391a8ec9bcc2ba06a30cc4889e93191 (diff)
downloadlibgit2-2a1732b43904d67cfeb301a5287b13c5893f9b64.tar.gz
Rewrite the unit testing suite
NIH Enterprises presents: a new testing system based on CuTesT, which is faster than our previous one and fortunately uses no preprocessing on the source files, which means we can run that from CMake. The test suites have been gathered together into bigger files (one file per suite, testing each of the different submodules of the library). Signed-off-by: Vicent Marti <tanoku@gmail.com>
Diffstat (limited to 'tests/t1003-readpackedref.c')
-rw-r--r--tests/t1003-readpackedref.c39
1 files changed, 0 insertions, 39 deletions
diff --git a/tests/t1003-readpackedref.c b/tests/t1003-readpackedref.c
deleted file mode 100644
index d76bdcf3e..000000000
--- a/tests/t1003-readpackedref.c
+++ /dev/null
@@ -1,39 +0,0 @@
-#include "test_lib.h"
-#include "test_helpers.h"
-#include "refs.h"
-
-static const char *packed_head_name = "refs/heads/packed";
-static const char *packed_test_head_name = "refs/heads/packed-test";
-
-BEGIN_TEST(packed_reference_looking_up)
- git_repository *repo;
- git_reference *reference;
- git_object *object;
-
- must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
-
- must_pass(git_repository_lookup_ref(&reference, repo, packed_head_name));
- must_be_true(reference->type == GIT_REF_OID);
- must_be_true(reference->packed == 1);
- must_be_true(strcmp(reference->name, packed_head_name) == 0);
-
- must_pass(git_repository_lookup(&object, repo, git_reference_oid(reference), GIT_OBJ_ANY));
- must_be_true(object != NULL);
- must_be_true(git_object_type(object) == GIT_OBJ_COMMIT);
-
- git_repository_free(repo);
-END_TEST
-
-BEGIN_TEST(packed_exists_but_more_recent_loose_reference_is_retrieved)
- git_repository *repo;
- git_reference *reference;
-
- must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
- must_pass(git_repository_lookup_ref(&reference, repo, packed_head_name));
- must_pass(git_repository_lookup_ref(&reference, repo, packed_test_head_name));
- must_be_true(reference->type == GIT_REF_OID);
- must_be_true(reference->packed == 0);
- must_be_true(strcmp(reference->name, packed_test_head_name) == 0);
-
- git_repository_free(repo);
-END_TEST