# HG changeset patch # User Mike Becker # Date 1565419512 -7200 # Node ID 82a88d938108e48062b7ab7964e120bfb390f7db # Parent 05957b1d10a5ad5dc80a115663964a4b067d76ed fixes array_equals test (broken on 32 bit platforms) diff -r 05957b1d10a5 -r 82a88d938108 test/array_tests.c --- 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),