summaryrefslogtreecommitdiff
path: root/tests/core
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2014-03-23 13:34:33 +0100
committerCarlos Martín Nieto <cmn@dwim.me>2014-03-24 13:21:51 +0100
commit42dee8ecd78a10c91056ac80fdf0c67a4df57337 (patch)
treed5d34f5a1d91f0d6c14cb598d8a8c11daacf97c0 /tests/core
parent0deb534d765cf545f7cd65b9f5e79d344b6fbec0 (diff)
downloadlibgit2-42dee8ecd78a10c91056ac80fdf0c67a4df57337.tar.gz
settings: use git_buf for returning strings
This survived the last round of culling, as the signature is only in the comments.
Diffstat (limited to 'tests/core')
-rw-r--r--tests/core/env.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/core/env.c b/tests/core/env.c
index a32f5ed3e..4383d9695 100644
--- a/tests/core/env.c
+++ b/tests/core/env.c
@@ -218,7 +218,7 @@ void test_core_env__1(void)
static void check_global_searchpath(
const char *path, int position, const char *file, git_buf *temp)
{
- char out[GIT_PATH_MAX];
+ git_buf out = GIT_BUF_INIT;
/* build and set new path */
if (position < 0)
@@ -233,12 +233,12 @@ static void check_global_searchpath(
/* get path and make sure $PATH expansion worked */
cl_git_pass(git_libgit2_opts(
- GIT_OPT_GET_SEARCH_PATH, GIT_CONFIG_LEVEL_GLOBAL, out, sizeof(out)));
+ GIT_OPT_GET_SEARCH_PATH, GIT_CONFIG_LEVEL_GLOBAL, &out));
if (position < 0)
- cl_assert(git__prefixcmp(out, path) == 0);
+ cl_assert(git__prefixcmp(out.ptr, path) == 0);
else if (position > 0)
- cl_assert(git__suffixcmp(out, path) == 0);
+ cl_assert(git__suffixcmp(out.ptr, path) == 0);
else
cl_assert_equal_s(out, path);
@@ -250,6 +250,8 @@ static void check_global_searchpath(
GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_GLOBAL, NULL));
cl_assert_equal_i(
GIT_ENOTFOUND, git_sysdir_find_global_file(temp, file));
+
+ git_buf_free(&out);
}
void test_core_env__2(void)