Commit 0952278f by Patrick Steinhardt

tests: fix warning for implicit conversion of integer to pointer

GCC warns by default when implicitly converting integers to pointers or
the other way round, and commit fa48d2ea (vector: do not malloc
0-length vectors on dup, 2018-09-26) introduced such an implicit
conversion into our vector tests. While this is totally fine in this
test, as the pointer's value is never being used in the first place, we
can trivially avoid the warning by instead just inserting a pointer for
a variable allocated on the stack into the vector.

(cherry picked from commit dbb4a586)
parent 2e7d53ac
......@@ -412,7 +412,7 @@ void test_core_vector__dup_empty_vector(void)
{
git_vector v = GIT_VECTOR_INIT;
git_vector dup = GIT_VECTOR_INIT;
void *dummy = 0xDEAFBEEB;
int dummy;
cl_assert_equal_i(0, v.length);
......@@ -420,7 +420,7 @@ void test_core_vector__dup_empty_vector(void)
cl_assert_equal_i(0, dup._alloc_size);
cl_assert_equal_i(0, dup.length);
cl_git_pass(git_vector_insert(&dup, dummy));
cl_git_pass(git_vector_insert(&dup, &dummy));
cl_assert_equal_i(8, dup._alloc_size);
cl_assert_equal_i(1, dup.length);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment