Use GIT_INLINE macro instead of keyword inline.
[libgit2.git] / tests / t0201-existsloose.c
blob004393eb8ee7f51fc57f25ebfee55193d74b3b07
1 #include "test_lib.h"
2 #include "test_helpers.h"
3 #include <git/odb.h>
4 #include "fileops.h"
6 static char *odb_dir = "test-objects";
8 /* one == 8b137891791fe96927ad78e64b0aad7bded08bdc */
9 static unsigned char one_bytes[] = {
10 0x31, 0x78, 0x9c, 0xe3, 0x02, 0x00, 0x00, 0x0b,
11 0x00, 0x0b,
14 static unsigned char one_data[] = {
15 0x0a,
18 static object_data one = {
19 one_bytes,
20 sizeof(one_bytes),
21 "8b137891791fe96927ad78e64b0aad7bded08bdc",
22 "blob",
23 "test-objects/8b",
24 "test-objects/8b/137891791fe96927ad78e64b0aad7bded08bdc",
25 one_data,
26 sizeof(one_data),
30 BEGIN_TEST(exists_loose_one)
31 git_odb *db;
32 git_oid id, id2;
34 must_pass(write_object_files(odb_dir, &one));
35 must_pass(git_odb_open(&db, odb_dir));
36 must_pass(git_oid_mkstr(&id, one.id));
38 must_be_true(git_odb_exists(db, &id));
40 /* Test for a non-existant object */
41 must_pass(git_oid_mkstr(&id2,"8b137891791fe96927ad78e64b0aad7bded08baa"));
42 must_be_true(0 == git_odb_exists(db, &id2));
44 git_odb_close(db);
45 must_pass(remove_object_files(odb_dir, &one));
46 END_TEST