summaryrefslogtreecommitdiffstats
path: root/test/sorted_array_test.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-12-31 15:48:28 +0100
committerDavid Robillard <d@drobilla.net>2020-12-31 18:13:35 +0100
commitad42412e3353893ccb365cf357a286b0afe545ba (patch)
treea5b1951eeb2d8a396e5d3d33dbf9cee8d326d6b9 /test/sorted_array_test.c
parenta4a67d67cbbed4e027a4587c9956adbd404d097d (diff)
downloadzix-ad42412e3353893ccb365cf357a286b0afe545ba.tar.gz
zix-ad42412e3353893ccb365cf357a286b0afe545ba.tar.bz2
zix-ad42412e3353893ccb365cf357a286b0afe545ba.zip
Initialize all variables
Diffstat (limited to 'test/sorted_array_test.c')
-rw-r--r--test/sorted_array_test.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/sorted_array_test.c b/test/sorted_array_test.c
index d991784..a782db4 100644
--- a/test/sorted_array_test.c
+++ b/test/sorted_array_test.c
@@ -58,8 +58,8 @@ test_fail(void)
static int
stress(unsigned test_num, unsigned n_elems)
{
- intptr_t r;
- ZixSortedArrayIter ti;
+ intptr_t r = 0;
+ ZixSortedArrayIter ti = NULL;
ZixSortedArray* t =
zix_sorted_array_new(true, int_cmp, NULL, sizeof(intptr_t));
@@ -126,7 +126,8 @@ stress(unsigned test_num, unsigned n_elems)
// Delete all elements
for (unsigned e = 0; e < n_elems; e++) {
r = ith_elem(test_num, n_elems, e);
- ZixSortedArrayIter item;
+
+ ZixSortedArrayIter item = NULL;
if (zix_sorted_array_find(t, &r, &item) != ZIX_STATUS_SUCCESS) {
fprintf(stderr, "Failed to find item to remove\n");
return test_fail();