summaryrefslogtreecommitdiff
path: root/tests/libgit2/object/raw/compare.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/libgit2/object/raw/compare.c')
-rw-r--r--tests/libgit2/object/raw/compare.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/tests/libgit2/object/raw/compare.c b/tests/libgit2/object/raw/compare.c
index 56c016b72..9258eef41 100644
--- a/tests/libgit2/object/raw/compare.c
+++ b/tests/libgit2/object/raw/compare.c
@@ -13,9 +13,9 @@ void test_object_raw_compare__succeed_on_copy_oid(void)
0xa8, 0xbd, 0x74, 0xf5, 0xe0,
};
memset(&b, 0, sizeof(b));
- git_oid_fromraw(&a, exp);
+ git_oid__fromraw(&a, exp, GIT_OID_SHA1);
git_oid_cpy(&b, &a);
- cl_git_pass(memcmp(a.id, exp, sizeof(a.id)));
+ cl_git_pass(memcmp(a.id, exp, GIT_OID_SHA1_SIZE));
}
void test_object_raw_compare__succeed_on_oid_comparison_lesser(void)
@@ -33,8 +33,8 @@ void test_object_raw_compare__succeed_on_oid_comparison_lesser(void)
0xb7, 0x75, 0x21, 0x3c, 0x23,
0xa8, 0xbd, 0x74, 0xf5, 0xf0,
};
- git_oid_fromraw(&a, a_in);
- git_oid_fromraw(&b, b_in);
+ git_oid__fromraw(&a, a_in, GIT_OID_SHA1);
+ git_oid__fromraw(&b, b_in, GIT_OID_SHA1);
cl_assert(git_oid_cmp(&a, &b) < 0);
}
@@ -47,8 +47,8 @@ void test_object_raw_compare__succeed_on_oid_comparison_equal(void)
0xb7, 0x75, 0x21, 0x3c, 0x23,
0xa8, 0xbd, 0x74, 0xf5, 0xe0,
};
- git_oid_fromraw(&a, a_in);
- git_oid_fromraw(&b, a_in);
+ git_oid__fromraw(&a, a_in, GIT_OID_SHA1);
+ git_oid__fromraw(&b, a_in, GIT_OID_SHA1);
cl_assert(git_oid_cmp(&a, &b) == 0);
}
@@ -67,8 +67,8 @@ void test_object_raw_compare__succeed_on_oid_comparison_greater(void)
0xb7, 0x75, 0x21, 0x3c, 0x23,
0xa8, 0xbd, 0x74, 0xf5, 0xd0,
};
- git_oid_fromraw(&a, a_in);
- git_oid_fromraw(&b, b_in);
+ git_oid__fromraw(&a, a_in, GIT_OID_SHA1);
+ git_oid__fromraw(&b, b_in, GIT_OID_SHA1);
cl_assert(git_oid_cmp(&a, &b) > 0);
}
@@ -76,17 +76,17 @@ void test_object_raw_compare__compare_fmt_oids(void)
{
const char *exp = "16a0123456789abcdef4b775213c23a8bd74f5e0";
git_oid in;
- char out[GIT_OID_HEXSZ + 1];
+ char out[GIT_OID_SHA1_HEXSIZE + 1];
- cl_git_pass(git_oid_fromstr(&in, exp));
+ cl_git_pass(git_oid__fromstr(&in, exp, GIT_OID_SHA1));
/* Format doesn't touch the last byte */
- out[GIT_OID_HEXSZ] = 'Z';
+ out[GIT_OID_SHA1_HEXSIZE] = 'Z';
git_oid_fmt(out, &in);
- cl_assert(out[GIT_OID_HEXSZ] == 'Z');
+ cl_assert(out[GIT_OID_SHA1_HEXSIZE] == 'Z');
/* Format produced the right result */
- out[GIT_OID_HEXSZ] = '\0';
+ out[GIT_OID_SHA1_HEXSIZE] = '\0';
cl_assert_equal_s(exp, out);
}
@@ -96,7 +96,7 @@ void test_object_raw_compare__compare_static_oids(void)
git_oid in;
char *out;
- cl_git_pass(git_oid_fromstr(&in, exp));
+ cl_git_pass(git_oid__fromstr(&in, exp, GIT_OID_SHA1));
out = git_oid_tostr_s(&in);
cl_assert(out);
@@ -108,16 +108,16 @@ void test_object_raw_compare__compare_pathfmt_oids(void)
const char *exp1 = "16a0123456789abcdef4b775213c23a8bd74f5e0";
const char *exp2 = "16/a0123456789abcdef4b775213c23a8bd74f5e0";
git_oid in;
- char out[GIT_OID_HEXSZ + 2];
+ char out[GIT_OID_SHA1_HEXSIZE + 2];
- cl_git_pass(git_oid_fromstr(&in, exp1));
+ cl_git_pass(git_oid__fromstr(&in, exp1, GIT_OID_SHA1));
/* Format doesn't touch the last byte */
- out[GIT_OID_HEXSZ + 1] = 'Z';
+ out[GIT_OID_SHA1_HEXSIZE + 1] = 'Z';
git_oid_pathfmt(out, &in);
- cl_assert(out[GIT_OID_HEXSZ + 1] == 'Z');
+ cl_assert(out[GIT_OID_SHA1_HEXSIZE + 1] == 'Z');
/* Format produced the right result */
- out[GIT_OID_HEXSZ + 1] = '\0';
+ out[GIT_OID_SHA1_HEXSIZE + 1] = '\0';
cl_assert_equal_s(exp2, out);
}