mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-03 02:40:09 +00:00

This includes a few cleanups that came up while converting these files. This commit introduces a could new git error classes, including the catchall class: GITERR_INVALID which I'm using as the class for invalid and out of range values which are detected at too low a level of library to use a higher level classification. For example, an overflow error in parsing an integer or a bad letter in parsing an OID string would generate an error in this class.
19 lines
478 B
C
19 lines
478 B
C
#include "clar_libgit2.h"
|
|
|
|
static git_oid id;
|
|
const char *str_oid = "ae90f12eea699729ed24555e40b9fd669da12a12";
|
|
|
|
void test_core_oid__initialize(void)
|
|
{
|
|
cl_git_pass(git_oid_fromstr(&id, str_oid));
|
|
}
|
|
|
|
void test_core_oid__streq(void)
|
|
{
|
|
cl_assert(git_oid_streq(&id, str_oid) == 0);
|
|
cl_assert(git_oid_streq(&id, "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef") == -1);
|
|
|
|
cl_assert(git_oid_streq(&id, "deadbeef") == -1);
|
|
cl_assert(git_oid_streq(&id, "I'm not an oid.... :)") == -1);
|
|
}
|