]> git.proxmox.com Git - libgit2.git/blame - tests-clar/core/oid.c
Added an oid function that accepts nul-terminated strings
[libgit2.git] / tests-clar / core / oid.c
CommitLineData
3fd1520c 1#include "clar_libgit2.h"
34aff010 2
3static git_oid id;
4const char *str_oid = "ae90f12eea699729ed24555e40b9fd669da12a12";
5
6void test_core_oid__initialize(void)
7{
8 cl_git_pass(git_oid_fromstr(&id, str_oid));
9}
10
11void test_core_oid__streq(void)
12{
7c7ff7d1
RB
13 cl_assert(git_oid_streq(&id, str_oid) == 0);
14 cl_assert(git_oid_streq(&id, "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef") == -1);
34aff010 15
7c7ff7d1
RB
16 cl_assert(git_oid_streq(&id, "deadbeef") == -1);
17 cl_assert(git_oid_streq(&id, "I'm not an oid.... :)") == -1);
3fd1520c 18}