fixes array_equals test (broken on 32 bit platforms) feature/array

Sat, 10 Aug 2019 08:45:12 +0200

author
Mike Becker <universe@uap-core.de>
date
Sat, 10 Aug 2019 08:45:12 +0200
branch
feature/array
changeset 350
82a88d938108
parent 349
05957b1d10a5
child 352
83888029778a

fixes array_equals test (broken on 32 bit platforms)

test/array_tests.c file | annotate | diff | comparison | revisions
--- a/test/array_tests.c	Sat Aug 10 08:44:36 2019 +0200
+++ b/test/array_tests.c	Sat Aug 10 08:45:12 2019 +0200
@@ -161,13 +161,13 @@
 }
 
 UCX_TEST(test_ucx_array_equals) {
-    UcxArray a1 = ucx_array_new(16, sizeof(int));
-    UcxArray a2 = ucx_array_new(16, sizeof(int));
-    UcxArray a3 = ucx_array_new(16, sizeof(long int));
-    UcxArray a4 = ucx_array_new(16, sizeof(int));
+    UcxArray a1 = ucx_array_new(16, sizeof(int32_t));
+    UcxArray a2 = ucx_array_new(16, sizeof(int32_t));
+    UcxArray a3 = ucx_array_new(16, sizeof(int64_t));
+    UcxArray a4 = ucx_array_new(16, sizeof(int32_t));
     
-    int *intelems;
-    long int *longintelems;
+    int32_t *intelems;
+    int64_t *longintelems;
     
     a1.size = 5;
     intelems = a1.data;
@@ -200,12 +200,12 @@
     
     UCX_TEST_BEGIN
     
-    UCX_TEST_ASSERT(ucx_array_equals(a1, a2, ucx_cmp_int, NULL), "failed");
-    UCX_TEST_ASSERT(!ucx_array_equals(a1, a4, ucx_cmp_int, NULL), "failed");
-    UCX_TEST_ASSERT(!ucx_array_equals(a4, a1, ucx_cmp_int, NULL), "failed");
-    UCX_TEST_ASSERT(!ucx_array_equals(a1, a3, ucx_cmp_int, NULL),
+    UCX_TEST_ASSERT(ucx_array_equals(a1, a2, ucx_cmp_int32, NULL), "failed");
+    UCX_TEST_ASSERT(!ucx_array_equals(a1, a4, ucx_cmp_int32, NULL), "failed");
+    UCX_TEST_ASSERT(!ucx_array_equals(a4, a1, ucx_cmp_int32, NULL), "failed");
+    UCX_TEST_ASSERT(!ucx_array_equals(a1, a3, ucx_cmp_int64, NULL),
             "comparing arrays of different element size shall fail");
-    UCX_TEST_ASSERT(!ucx_array_equals(a3, a1, ucx_cmp_int, NULL),
+    UCX_TEST_ASSERT(!ucx_array_equals(a3, a1, ucx_cmp_int64, NULL),
             "comparing arrays of different element size shall fail");
     
     UCX_TEST_ASSERT(ucx_array_equals(a1, a2, NULL, NULL),

mercurial