summaryrefslogtreecommitdiff
path: root/tests/object
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2014-08-18 12:41:06 +0200
committerVicent Marti <tanoku@gmail.com>2014-08-18 12:41:06 +0200
commit4ca0b566ca811550b4db31045e580b4970e5b8e3 (patch)
treee34ed66136f5a6cdf496b4d8c8a52fcb9c17702e /tests/object
parent59403f1ff55346c64bfaa0744ea7f3375da71725 (diff)
downloadlibgit2-4ca0b566ca811550b4db31045e580b4970e5b8e3.tar.gz
oid: Export `git_oid_tostr_s` instead of `_allocfmt`vmg/tostr_s
The old `allocfmt` is of no use to callers, as they are not able to free the returned buffer. Export a new API that returns a static string that doesn't need to be freed.
Diffstat (limited to 'tests/object')
-rw-r--r--tests/object/raw/compare.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/object/raw/compare.c b/tests/object/raw/compare.c
index 1c9ce4b81..56c016b72 100644
--- a/tests/object/raw/compare.c
+++ b/tests/object/raw/compare.c
@@ -90,7 +90,7 @@ void test_object_raw_compare__compare_fmt_oids(void)
cl_assert_equal_s(exp, out);
}
-void test_object_raw_compare__compare_allocfmt_oids(void)
+void test_object_raw_compare__compare_static_oids(void)
{
const char *exp = "16a0123456789abcdef4b775213c23a8bd74f5e0";
git_oid in;
@@ -98,10 +98,9 @@ void test_object_raw_compare__compare_allocfmt_oids(void)
cl_git_pass(git_oid_fromstr(&in, exp));
- out = git_oid_allocfmt(&in);
+ out = git_oid_tostr_s(&in);
cl_assert(out);
cl_assert_equal_s(exp, out);
- git__free(out);
}
void test_object_raw_compare__compare_pathfmt_oids(void)