diff options
Diffstat (limited to 'tests-clar')
| -rw-r--r-- | tests-clar/checkout/conflict.c | 3 | ||||
| -rw-r--r-- | tests-clar/core/iconv.c | 14 | ||||
| -rw-r--r-- | tests-clar/pack/indexer.c | 2 | ||||
| -rw-r--r-- | tests-clar/repo/init.c | 2 | ||||
| -rw-r--r-- | tests-clar/threads/refdb.c | 6 |
5 files changed, 19 insertions, 8 deletions
diff --git a/tests-clar/checkout/conflict.c b/tests-clar/checkout/conflict.c index d261f3860..66965a89b 100644 --- a/tests-clar/checkout/conflict.c +++ b/tests-clar/checkout/conflict.c @@ -1071,6 +1071,9 @@ static void collect_progress( { git_vector *paths = payload; + (void)completed_steps; + (void)total_steps; + if (path == NULL) return; diff --git a/tests-clar/core/iconv.c b/tests-clar/core/iconv.c index 73bc99a23..8aedab206 100644 --- a/tests-clar/core/iconv.c +++ b/tests-clar/core/iconv.c @@ -1,22 +1,29 @@ #include "clar_libgit2.h" #include "path.h" +#ifdef GIT_USE_ICONV static git_path_iconv_t ic; static char *nfc = "\xC3\x85\x73\x74\x72\xC3\xB6\x6D"; static char *nfd = "\x41\xCC\x8A\x73\x74\x72\x6F\xCC\x88\x6D"; +#endif void test_core_iconv__initialize(void) { +#ifdef GIT_USE_ICONV cl_git_pass(git_path_iconv_init_precompose(&ic)); +#endif } void test_core_iconv__cleanup(void) { +#ifdef GIT_USE_ICONV git_path_iconv_clear(&ic); +#endif } void test_core_iconv__unchanged(void) { +#ifdef GIT_USE_ICONV char *data = "Ascii data", *original = data; size_t datalen = strlen(data); @@ -25,10 +32,12 @@ void test_core_iconv__unchanged(void) /* There are no high bits set, so this should leave data untouched */ cl_assert(data == original); +#endif } void test_core_iconv__decomposed_to_precomposed(void) { +#ifdef GIT_USE_ICONV char *data = nfd; size_t datalen = strlen(nfd); @@ -38,15 +47,13 @@ void test_core_iconv__decomposed_to_precomposed(void) /* The decomposed nfd string should be transformed to the nfc form * (on platforms where iconv is enabled, of course). */ -#ifdef GIT_USE_ICONV cl_assert_equal_s(nfc, data); -#else - cl_assert_equal_s(nfd, data); #endif } void test_core_iconv__precomposed_is_unmodified(void) { +#ifdef GIT_USE_ICONV char *data = nfc; size_t datalen = strlen(nfc); @@ -57,4 +64,5 @@ void test_core_iconv__precomposed_is_unmodified(void) * the high-bit set, the iconv transform should result in no change. */ cl_assert_equal_s(nfc, data); +#endif } diff --git a/tests-clar/pack/indexer.c b/tests-clar/pack/indexer.c index e26b3ec20..d7953300f 100644 --- a/tests-clar/pack/indexer.c +++ b/tests-clar/pack/indexer.c @@ -100,7 +100,6 @@ void test_pack_indexer__fix_thin(void) unsigned char buffer[128]; int fd; ssize_t read; - git_off_t left; struct stat st; const char *name = "pack-11f0f69b334728fdd8bc86b80499f22f29d85b15.pack"; @@ -108,7 +107,6 @@ void test_pack_indexer__fix_thin(void) cl_assert(fd != -1); cl_git_pass(p_stat(name, &st)); - left = st.st_size; cl_git_pass(git_indexer_new(&idx, ".", NULL, NULL, NULL)); read = p_read(fd, buffer, sizeof(buffer)); diff --git a/tests-clar/repo/init.c b/tests-clar/repo/init.c index 617fdf879..aea383c64 100644 --- a/tests-clar/repo/init.c +++ b/tests-clar/repo/init.c @@ -232,6 +232,7 @@ void test_repo_init__detect_ignorecase(void) void test_repo_init__detect_precompose_unicode_required(void) { +#ifdef GIT_USE_ICONV char *composed = "ḱṷṓn", *decomposed = "ḱṷṓn"; struct stat st; bool found_with_nfd; @@ -240,7 +241,6 @@ void test_repo_init__detect_precompose_unicode_required(void) found_with_nfd = (p_stat(decomposed, &st) == 0); cl_must_pass(p_unlink(composed)); -#ifdef GIT_USE_ICONV assert_config_entry_on_init("core.precomposeunicode", found_with_nfd); #else assert_config_entry_on_init("core.precomposeunicode", GIT_ENOTFOUND); diff --git a/tests-clar/threads/refdb.c b/tests-clar/threads/refdb.c index f8d76cb9b..3c651e341 100644 --- a/tests-clar/threads/refdb.c +++ b/tests-clar/threads/refdb.c @@ -147,13 +147,16 @@ static void *delete_refs(void *arg) void test_threads_refdb__edit_while_iterate(void) { int r, t; - git_thread th[THREADS]; int id[THREADS]; git_oid head; git_reference *ref; char name[128]; git_refdb *refdb; +#ifdef GIT_THREADS + git_thread th[THREADS]; +#endif + g_repo = cl_git_sandbox_init("testrepo2"); cl_git_pass(git_reference_name_to_id(&head, g_repo, "HEAD")); @@ -187,7 +190,6 @@ void test_threads_refdb__edit_while_iterate(void) #ifdef GIT_THREADS cl_git_pass(git_thread_create(&th[t], NULL, fn, &id[t])); #else - th[t] = t; fn(&id[t]); #endif } |
