diff options
author | Xavier L <xavier.l@afrosoft.tk> | 2013-03-21 12:16:31 -0400 |
---|---|---|
committer | Xavier L <xavier.l@afrosoft.tk> | 2013-03-21 12:16:31 -0400 |
commit | 7e527ca700cbc98f9cd6acb52dc7b6180b3bcc35 (patch) | |
tree | 24b185a9bb0c889ab1798cb2041df0feea5f25b9 | |
parent | 0c8efb38f9ffb1c4fffe620174669c51866eff79 (diff) | |
download | libgit2-7e527ca700cbc98f9cd6acb52dc7b6180b3bcc35.tar.gz |
Added test case for new function
-rw-r--r-- | tests-clar/core/oid.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests-clar/core/oid.c b/tests-clar/core/oid.c index c89713955..1f2c72e7e 100644 --- a/tests-clar/core/oid.c +++ b/tests-clar/core/oid.c @@ -1,11 +1,17 @@ #include "clar_libgit2.h" static git_oid id; +static git_oid idp; +static git_oid idm; const char *str_oid = "ae90f12eea699729ed24555e40b9fd669da12a12"; +const char *str_oid_p = "ae90f12eea699729ed"; +const char *str_oid_m = "ae90f12eea699729ed24555e40b9fd669da12a12oiahs"; void test_core_oid__initialize(void) { cl_git_pass(git_oid_fromstr(&id, str_oid)); + cl_git_pass(git_oid_fromstrp(&idp, str_oid_p)); + cl_git_pass(git_oid_fromstrp(&idm, str_oid_m)); } void test_core_oid__streq(void) @@ -15,4 +21,12 @@ void test_core_oid__streq(void) cl_assert(git_oid_streq(&id, "deadbeef") == -1); cl_assert(git_oid_streq(&id, "I'm not an oid.... :)") == -1); + + cl_assert(git_oid_streq(&idp, "ae90f12eea699729ed0000000000000000000000") == 0); + cl_assert(git_oid_streq(&idp, "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef") == -1); + + cl_assert(git_oid_streq(&idp, "deadbeef") == -1); + cl_assert(git_oid_streq(&idp, "I'm not an oid.... :)") == -1); + + cl_assert(git_oid_cmp(&id, &idm) == 0); } |