Tests: Use proper order for EXPECT_EQ()
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 3 Feb 2017 11:03:59 +0000 (12:03 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 3 Feb 2017 11:03:59 +0000 (12:03 +0100)
13 files changed:
tests/gtests/blenlib/BLI_array_store_test.cc
tests/gtests/blenlib/BLI_array_utils_test.cc
tests/gtests/blenlib/BLI_ghash_performance_test.cc
tests/gtests/blenlib/BLI_ghash_test.cc
tests/gtests/blenlib/BLI_hash_mm2a_test.cc
tests/gtests/blenlib/BLI_listbase_test.cc
tests/gtests/blenlib/BLI_path_util_test.cc
tests/gtests/blenlib/BLI_polyfill2d_test.cc
tests/gtests/blenlib/BLI_stack_test.cc
tests/gtests/blenlib/BLI_string_test.cc
tests/gtests/blenlib/BLI_string_utf8_test.cc
tests/gtests/bmesh/bmesh_core_test.cc
tests/gtests/guardedalloc/guardedalloc_alignment_test.cc

index bb2a3577553ca201b4ce48d5fec5989b163e358a..5af6e639e64599fd4b9c38fbdd0f04de3ee011c5 100644 (file)
@@ -326,7 +326,7 @@ TEST(array_store, NopState)
        BArrayStore *bs = BLI_array_store_create(1, 32);
        const unsigned char data[] = "test";
        BArrayState *state = BLI_array_store_state_add(bs, data, sizeof(data) - 1, NULL);
-       EXPECT_EQ(sizeof(data) - 1, BLI_array_store_state_size_get(state));
+       EXPECT_EQ(BLI_array_store_state_size_get(state), sizeof(data) - 1);
        BLI_array_store_state_remove(bs, state);
        BLI_array_store_destroy(bs);
 }
@@ -340,7 +340,7 @@ TEST(array_store, Single)
        size_t data_dst_len;
        data_dst = (char *)BLI_array_store_state_data_get_alloc(state, &data_dst_len);
        EXPECT_STREQ(data_src, data_dst);
-       EXPECT_EQ(sizeof(data_src), data_dst_len);
+       EXPECT_EQ(data_dst_len, sizeof(data_src));
        BLI_array_store_destroy(bs);
        MEM_freeN((void *)data_dst);
 }
@@ -354,8 +354,8 @@ TEST(array_store, DoubleNop)
        BArrayState *state_a = BLI_array_store_state_add(bs, data_src, sizeof(data_src), NULL);
        BArrayState *state_b = BLI_array_store_state_add(bs, data_src, sizeof(data_src), state_a);
 
-       EXPECT_EQ(sizeof(data_src),     BLI_array_store_calc_size_compacted_get(bs));
-       EXPECT_EQ(sizeof(data_src) * 2, BLI_array_store_calc_size_expanded_get(bs));
+       EXPECT_EQ(BLI_array_store_calc_size_compacted_get(bs), sizeof(data_src));
+       EXPECT_EQ(BLI_array_store_calc_size_expanded_get(bs), sizeof(data_src) * 2);
 
        size_t data_dst_len;
 
@@ -367,7 +367,7 @@ TEST(array_store, DoubleNop)
        EXPECT_STREQ(data_src, data_dst);
        MEM_freeN((void *)data_dst);
 
-       EXPECT_EQ(sizeof(data_src), data_dst_len);
+       EXPECT_EQ(data_dst_len, sizeof(data_src));
        BLI_array_store_destroy(bs);
 }
 
@@ -382,8 +382,8 @@ TEST(array_store, DoubleDiff)
        BArrayState *state_b = BLI_array_store_state_add(bs, data_src_b, sizeof(data_src_b), state_a);
        size_t data_dst_len;
 
-       EXPECT_EQ(sizeof(data_src_a) * 2, BLI_array_store_calc_size_compacted_get(bs));
-       EXPECT_EQ(sizeof(data_src_a) * 2, BLI_array_store_calc_size_expanded_get(bs));
+       EXPECT_EQ(BLI_array_store_calc_size_compacted_get(bs), sizeof(data_src_a) * 2);
+       EXPECT_EQ(BLI_array_store_calc_size_expanded_get(bs), sizeof(data_src_a) * 2);
 
        data_dst = (char *)BLI_array_store_state_data_get_alloc(state_a, &data_dst_len);
        EXPECT_STREQ(data_src_a, data_dst);
@@ -425,7 +425,7 @@ TEST(array_store, TextDupeIncreaseDecrease)
        testbuffer_list_store_populate(bs, &lb);
        EXPECT_TRUE(testbuffer_list_validate(&lb));
        EXPECT_TRUE(BLI_array_store_is_valid(bs));
-       EXPECT_EQ(strlen(D), BLI_array_store_calc_size_compacted_get(bs));
+       EXPECT_EQ(BLI_array_store_calc_size_compacted_get(bs), strlen(D));
 
        testbuffer_list_store_clear(bs, &lb);
        BLI_listbase_reverse(&lb);
@@ -435,7 +435,7 @@ TEST(array_store, TextDupeIncreaseDecrease)
        EXPECT_TRUE(testbuffer_list_validate(&lb));
        EXPECT_TRUE(BLI_array_store_is_valid(bs));
        /* larger since first block doesn't de-duplicate */
-       EXPECT_EQ(strlen(D) * 4, BLI_array_store_calc_size_compacted_get(bs));
+       EXPECT_EQ(BLI_array_store_calc_size_compacted_get(bs), strlen(D) * 4);
 
 #undef D
        testbuffer_list_free(&lb); \
@@ -708,7 +708,7 @@ static void random_chunk_mutate_helper(
        testbuffer_run_tests_single(bs, &lb);
 
        size_t expected_size = chunks_per_buffer * chunk_count * stride;
-       EXPECT_EQ(expected_size, BLI_array_store_calc_size_compacted_get(bs));
+       EXPECT_EQ(BLI_array_store_calc_size_compacted_get(bs), expected_size);
 
        BLI_array_store_destroy(bs);
 
index eabf5bc72cf8819a64ffb0d830f9229f9d873363..518cd097326403d8e8b17d4cd738e36ad26eb8bf 100644 (file)
@@ -45,50 +45,50 @@ TEST(array_utils, ReverseInt4)
 TEST(array_utils, FindIndexStringEmpty)
 {
        char data[] = "", find = '0';
-       EXPECT_EQ(-1, BLI_array_findindex(data,  ARRAY_SIZE(data) - 1, &find));
-       EXPECT_EQ(-1, BLI_array_rfindindex(data, ARRAY_SIZE(data) - 1, &find));
+       EXPECT_EQ(BLI_array_findindex(data,  ARRAY_SIZE(data) - 1, &find), -1);
+       EXPECT_EQ(BLI_array_rfindindex(data, ARRAY_SIZE(data) - 1, &find), -1);
 }
 
 TEST(array_utils, FindIndexStringSingle)
 {
        char data[] = "0", find = '0';
-       EXPECT_EQ(0, BLI_array_findindex(data,  ARRAY_SIZE(data) - 1, &find));
-       EXPECT_EQ(0, BLI_array_rfindindex(data, ARRAY_SIZE(data) - 1, &find));
+       EXPECT_EQ(BLI_array_findindex(data,  ARRAY_SIZE(data) - 1, &find), 0);
+       EXPECT_EQ(BLI_array_rfindindex(data, ARRAY_SIZE(data) - 1, &find), 0);
 }
 
 TEST(array_utils, FindIndexStringSingleMissing)
 {
        char data[] = "1", find = '0';
-       EXPECT_EQ(-1, BLI_array_findindex(data,  ARRAY_SIZE(data) - 1, &find));
-       EXPECT_EQ(-1, BLI_array_rfindindex(data, ARRAY_SIZE(data) - 1, &find));
+       EXPECT_EQ(BLI_array_findindex(data,  ARRAY_SIZE(data) - 1, &find), -1);
+       EXPECT_EQ(BLI_array_rfindindex(data, ARRAY_SIZE(data) - 1, &find), -1);
 }
 
 TEST(array_utils, FindIndexString4)
 {
        char data[] = "0123", find = '3';
-       EXPECT_EQ(3, BLI_array_findindex(data,  ARRAY_SIZE(data) - 1, &find));
-       EXPECT_EQ(3, BLI_array_rfindindex(data, ARRAY_SIZE(data) - 1, &find));
+       EXPECT_EQ(BLI_array_findindex(data,  ARRAY_SIZE(data) - 1, &find), 3);
+       EXPECT_EQ(BLI_array_rfindindex(data, ARRAY_SIZE(data) - 1, &find), 3);
 }
 
 TEST(array_utils, FindIndexInt4)
 {
        int data[] = {0, 1, 2, 3}, find = 3;
-       EXPECT_EQ(3, BLI_array_findindex(data,  ARRAY_SIZE(data), &find));
-       EXPECT_EQ(3, BLI_array_rfindindex(data, ARRAY_SIZE(data), &find));
+       EXPECT_EQ(BLI_array_findindex(data,  ARRAY_SIZE(data), &find), 3);
+       EXPECT_EQ(BLI_array_rfindindex(data, ARRAY_SIZE(data), &find), 3);
 }
 
 TEST(array_utils, FindIndexInt4_DupeEnd)
 {
        int data[] = {0, 1, 2, 0}, find = 0;
-       EXPECT_EQ(0, BLI_array_findindex(data,  ARRAY_SIZE(data), &find));
-       EXPECT_EQ(3, BLI_array_rfindindex(data, ARRAY_SIZE(data), &find));
+       EXPECT_EQ(BLI_array_findindex(data,  ARRAY_SIZE(data), &find), 0);
+       EXPECT_EQ(BLI_array_rfindindex(data, ARRAY_SIZE(data), &find), 3);
 }
 
 TEST(array_utils, FindIndexInt4_DupeMid)
 {
        int data[] = {1, 0, 0, 3}, find = 0;
-       EXPECT_EQ(1, BLI_array_findindex(data,  ARRAY_SIZE(data), &find));
-       EXPECT_EQ(2, BLI_array_rfindindex(data, ARRAY_SIZE(data), &find));
+       EXPECT_EQ(BLI_array_findindex(data,  ARRAY_SIZE(data), &find), 1);
+       EXPECT_EQ(BLI_array_rfindindex(data, ARRAY_SIZE(data), &find), 2);
 }
 
 TEST(array_utils, FindIndexPointer)
@@ -102,18 +102,18 @@ TEST(array_utils, FindIndexPointer)
 
 #define STACK_PUSH_AND_CHECK_FORWARD(v, i) { \
        STACK_PUSH(data, v); \
-       EXPECT_EQ(i, BLI_array_findindex(data,  STACK_SIZE(data), &(v))); \
+       EXPECT_EQ(BLI_array_findindex(data,  STACK_SIZE(data), &(v)), i); \
 } ((void)0)
 
 #define STACK_PUSH_AND_CHECK_BACKWARD(v, i) { \
        STACK_PUSH(data, v); \
-       EXPECT_EQ(i, BLI_array_rfindindex(data, STACK_SIZE(data), &(v))); \
+       EXPECT_EQ(BLI_array_rfindindex(data, STACK_SIZE(data), &(v)), i); \
 } ((void)0)
 
 #define STACK_PUSH_AND_CHECK_BOTH(v, i) { \
        STACK_PUSH(data, v); \
-       EXPECT_EQ(i, BLI_array_findindex(data,  STACK_SIZE(data), &(v))); \
-       EXPECT_EQ(i, BLI_array_rfindindex(data, STACK_SIZE(data), &(v))); \
+       EXPECT_EQ(BLI_array_findindex(data,  STACK_SIZE(data), &(v)), i); \
+       EXPECT_EQ(BLI_array_rfindindex(data, STACK_SIZE(data), &(v)), i); \
 } ((void)0)
 
        STACK_PUSH_AND_CHECK_BOTH(a, 0);
index fb32cb3f0a5a6358881cb4f9a463c20a1545241b..924c84d72d0ca3b26b7e44859fdf5928164f6eff 100644 (file)
@@ -118,21 +118,21 @@ static void str_ghash_tests(GHash *ghash, const char *id)
                TIMEIT_START(string_lookup);
 
                v = BLI_ghash_lookup(ghash, data_bis);
-               EXPECT_EQ(data_bis[0], GET_INT_FROM_POINTER(v));
+               EXPECT_EQ(GET_INT_FROM_POINTER(v), data_bis[0]);
 
                for (p = w = c = data_bis; *c; c++) {
                        if (*c == '.') {
                                *c = '\0';
                                v = BLI_ghash_lookup(ghash, w);
-                               EXPECT_EQ(w[0], GET_INT_FROM_POINTER(v));
+                               EXPECT_EQ(GET_INT_FROM_POINTER(v), w[0]);
                                v = BLI_ghash_lookup(ghash, p);
-                               EXPECT_EQ(p[0], GET_INT_FROM_POINTER(v));
+                               EXPECT_EQ(GET_INT_FROM_POINTER(v), p[0]);
                                p = w = c + 1;
                        }
                        else if (*c == ' ') {
                                *c = '\0';
                                v = BLI_ghash_lookup(ghash, w);
-                               EXPECT_EQ(w[0], GET_INT_FROM_POINTER(v));
+                               EXPECT_EQ(GET_INT_FROM_POINTER(v), w[0]);
                                w = c + 1;
                        }
                }
@@ -195,7 +195,7 @@ static void int_ghash_tests(GHash *ghash, const char *id, const unsigned int nbr
 
                while (i--) {
                        void *v = BLI_ghash_lookup(ghash, SET_UINT_IN_POINTER(i));
-                       EXPECT_EQ(i, GET_UINT_FROM_POINTER(v));
+                       EXPECT_EQ(GET_UINT_FROM_POINTER(v), i);
                }
 
                TIMEIT_END(int_lookup);
@@ -214,7 +214,7 @@ static void int_ghash_tests(GHash *ghash, const char *id, const unsigned int nbr
 
                TIMEIT_END(int_pop);
        }
-       EXPECT_EQ(0, BLI_ghash_size(ghash));
+       EXPECT_EQ(BLI_ghash_size(ghash), 0);
 
        BLI_ghash_free(ghash, NULL, NULL);
 
@@ -292,7 +292,7 @@ static void randint_ghash_tests(GHash *ghash, const char *id, const unsigned int
 
                for (i = nbr, dt = data; i--; dt++) {
                        void *v = BLI_ghash_lookup(ghash, SET_UINT_IN_POINTER(*dt));
-                       EXPECT_EQ(*dt, GET_UINT_FROM_POINTER(v));
+                       EXPECT_EQ(GET_UINT_FROM_POINTER(v), *dt);
                }
 
                TIMEIT_END(int_lookup);
@@ -403,7 +403,7 @@ static void int4_ghash_tests(GHash *ghash, const char *id, const unsigned int nb
 
                for (i = nbr, dt = data; i--; dt++) {
                        void *v = BLI_ghash_lookup(ghash, (void *)(*dt));
-                       EXPECT_EQ(i, GET_UINT_FROM_POINTER(v));
+                       EXPECT_EQ(GET_UINT_FROM_POINTER(v), i);
                }
 
                TIMEIT_END(int_v4_lookup);
@@ -469,7 +469,7 @@ static void multi_small_ghash_tests_one(GHash *ghash, RNG *rng, const unsigned i
 
        for (i = nbr, dt = data; i--; dt++) {
                void *v = BLI_ghash_lookup(ghash, SET_UINT_IN_POINTER(*dt));
-               EXPECT_EQ(*dt, GET_UINT_FROM_POINTER(v));
+               EXPECT_EQ(GET_UINT_FROM_POINTER(v), *dt);
        }
 
        BLI_ghash_clear(ghash, NULL, NULL);
index 71516e773b5b5302ae058bb44241b28e262b16a7..6d075e29114ae3433160850aed4bab506f3777af 100644 (file)
@@ -62,11 +62,11 @@ TEST(ghash, InsertLookup)
                BLI_ghash_insert(ghash, SET_UINT_IN_POINTER(*k), SET_UINT_IN_POINTER(*k));
        }
 
-       EXPECT_EQ(TESTCASE_SIZE, BLI_ghash_size(ghash));
+       EXPECT_EQ(BLI_ghash_size(ghash), TESTCASE_SIZE);
 
        for (i = TESTCASE_SIZE, k = keys; i--; k++) {
                void *v = BLI_ghash_lookup(ghash, SET_UINT_IN_POINTER(*k));
-               EXPECT_EQ(*k, GET_UINT_FROM_POINTER(v));
+               EXPECT_EQ(GET_UINT_FROM_POINTER(v), *k);
        }
 
        BLI_ghash_free(ghash, NULL, NULL);
@@ -85,16 +85,16 @@ TEST(ghash, InsertRemove)
                BLI_ghash_insert(ghash, SET_UINT_IN_POINTER(*k), SET_UINT_IN_POINTER(*k));
        }
 
-       EXPECT_EQ(TESTCASE_SIZE, BLI_ghash_size(ghash));
+       EXPECT_EQ(BLI_ghash_size(ghash), TESTCASE_SIZE);
        bkt_size = BLI_ghash_buckets_size(ghash);
 
        for (i = TESTCASE_SIZE, k = keys; i--; k++) {
                void *v = BLI_ghash_popkey(ghash, SET_UINT_IN_POINTER(*k), NULL);
-               EXPECT_EQ(*k, GET_UINT_FROM_POINTER(v));
+               EXPECT_EQ(GET_UINT_FROM_POINTER(v), *k);
        }
 
-       EXPECT_EQ(0, BLI_ghash_size(ghash));
-       EXPECT_EQ(bkt_size, BLI_ghash_buckets_size(ghash));
+       EXPECT_EQ(BLI_ghash_size(ghash), 0);
+       EXPECT_EQ(BLI_ghash_buckets_size(ghash), bkt_size);
 
        BLI_ghash_free(ghash, NULL, NULL);
 }
@@ -113,15 +113,15 @@ TEST(ghash, InsertRemoveShrink)
                BLI_ghash_insert(ghash, SET_UINT_IN_POINTER(*k), SET_UINT_IN_POINTER(*k));
        }
 
-       EXPECT_EQ(TESTCASE_SIZE, BLI_ghash_size(ghash));
+       EXPECT_EQ(BLI_ghash_size(ghash), TESTCASE_SIZE);
        bkt_size = BLI_ghash_buckets_size(ghash);
 
        for (i = TESTCASE_SIZE, k = keys; i--; k++) {
                void *v = BLI_ghash_popkey(ghash, SET_UINT_IN_POINTER(*k), NULL);
-               EXPECT_EQ(*k, GET_UINT_FROM_POINTER(v));
+               EXPECT_EQ(GET_UINT_FROM_POINTER(v), *k);
        }
 
-       EXPECT_EQ(0, BLI_ghash_size(ghash));
+       EXPECT_EQ(BLI_ghash_size(ghash), 0);
        EXPECT_LT(BLI_ghash_buckets_size(ghash), bkt_size);
 
        BLI_ghash_free(ghash, NULL, NULL);
@@ -141,16 +141,16 @@ TEST(ghash, Copy)
                BLI_ghash_insert(ghash, SET_UINT_IN_POINTER(*k), SET_UINT_IN_POINTER(*k));
        }
 
-       EXPECT_EQ(TESTCASE_SIZE, BLI_ghash_size(ghash));
+       EXPECT_EQ(BLI_ghash_size(ghash), TESTCASE_SIZE);
 
        ghash_copy = BLI_ghash_copy(ghash, NULL, NULL);
 
-       EXPECT_EQ(TESTCASE_SIZE, BLI_ghash_size(ghash_copy));
-       EXPECT_EQ(BLI_ghash_buckets_size(ghash), BLI_ghash_buckets_size(ghash_copy));
+       EXPECT_EQ(BLI_ghash_size(ghash_copy), TESTCASE_SIZE);
+       EXPECT_EQ(BLI_ghash_buckets_size(ghash_copy), BLI_ghash_buckets_size(ghash));
 
        for (i = TESTCASE_SIZE, k = keys; i--; k++) {
                void *v = BLI_ghash_lookup(ghash_copy, SET_UINT_IN_POINTER(*k));
-               EXPECT_EQ(*k, GET_UINT_FROM_POINTER(v));
+               EXPECT_EQ(GET_UINT_FROM_POINTER(v), *k);
        }
 
        BLI_ghash_free(ghash, NULL, NULL);
@@ -171,7 +171,7 @@ TEST(ghash, Pop)
                BLI_ghash_insert(ghash, SET_UINT_IN_POINTER(*k), SET_UINT_IN_POINTER(*k));
        }
 
-       EXPECT_EQ(TESTCASE_SIZE, BLI_ghash_size(ghash));
+       EXPECT_EQ(BLI_ghash_size(ghash), TESTCASE_SIZE);
 
        GHashIterState pop_state = {0};
 
@@ -186,7 +186,7 @@ TEST(ghash, Pop)
                }
        }
 
-       EXPECT_EQ((TESTCASE_SIZE - TESTCASE_SIZE / 2 + TESTCASE_SIZE / 4), BLI_ghash_size(ghash));
+       EXPECT_EQ(BLI_ghash_size(ghash), (TESTCASE_SIZE - TESTCASE_SIZE / 2 + TESTCASE_SIZE / 4));
 
        {
                void *k, *v;
@@ -194,7 +194,7 @@ TEST(ghash, Pop)
                        EXPECT_EQ(k, v);
                }
        }
-       EXPECT_EQ(0, BLI_ghash_size(ghash));
+       EXPECT_EQ(BLI_ghash_size(ghash), 0);
 
        BLI_ghash_free(ghash, NULL, NULL);
 }
index b35a1a809d69c9a468187b653cbdbda1794aa5cc..109c925af4c2b256ac2b737abd818c087ca52ddb 100644 (file)
@@ -19,9 +19,9 @@ TEST(hash_mm2a, MM2ABasic)
        BLI_hash_mm2a_init(&mm2, 0);
        BLI_hash_mm2a_add(&mm2, (const unsigned char *)data, strlen(data));
 #ifdef __LITTLE_ENDIAN__
-       EXPECT_EQ(1633988145, BLI_hash_mm2a_end(&mm2));
+       EXPECT_EQ(BLI_hash_mm2a_end(&mm2), 1633988145);
 #else
-       EXPECT_EQ(959283772, BLI_hash_mm2a_end(&mm2));
+       EXPECT_EQ(BLI_hash_mm2a_end(&mm2), 959283772);
 #endif
 }
 
@@ -43,11 +43,11 @@ TEST(hash_mm2a, MM2AConcatenateStrings)
        BLI_hash_mm2a_init(&mm2, 0);
        BLI_hash_mm2a_add(&mm2, (const unsigned char *)data123, strlen(data123));
 #ifdef __LITTLE_ENDIAN__
-       EXPECT_EQ(1545105348, hash);
+       EXPECT_EQ(hash, 1545105348);
 #else
-       EXPECT_EQ(2604964730, hash);
+       EXPECT_EQ(hash, 2604964730);
 #endif
-       EXPECT_EQ(hash, BLI_hash_mm2a_end(&mm2));
+       EXPECT_EQ(BLI_hash_mm2a_end(&mm2), hash);
 }
 
 TEST(hash_mm2a, MM2AIntegers)
@@ -67,9 +67,9 @@ TEST(hash_mm2a, MM2AIntegers)
        BLI_hash_mm2a_add(&mm2, (const unsigned char *)ints, sizeof(ints));
        /* Yes, same hash here on little and big endian. */
 #ifdef __LITTLE_ENDIAN__
-       EXPECT_EQ(405493096, hash);
+       EXPECT_EQ(hash, 405493096);
 #else
-       EXPECT_EQ(405493096, hash);
+       EXPECT_EQ(hash, 405493096);
 #endif
-       EXPECT_EQ(hash, BLI_hash_mm2a_end(&mm2));
+       EXPECT_EQ(BLI_hash_mm2a_end(&mm2), hash);
 }
index 994b8f74541d4763f61439b8dee2a2b8fb4159b5..4dac2d05bd84c1118e71d68c4eb3338d45915557 100644 (file)
@@ -74,25 +74,25 @@ TEST(listbase, FindLinkOrIndex)
 
        /* Empty list */
        BLI_listbase_clear(&lb);
-       EXPECT_EQ(NULL, BLI_findlink(&lb, -1));
-       EXPECT_EQ(NULL, BLI_findlink(&lb, 0));
-       EXPECT_EQ(NULL, BLI_findlink(&lb, 1));
-       EXPECT_EQ(NULL, BLI_rfindlink(&lb, -1));
-       EXPECT_EQ(NULL, BLI_rfindlink(&lb, 0));
-       EXPECT_EQ(NULL, BLI_rfindlink(&lb, 1));
-       EXPECT_EQ(-1, BLI_findindex(&lb, link1));
+       EXPECT_EQ(BLI_findlink(&lb, -1), (void*)NULL);
+       EXPECT_EQ(BLI_findlink(&lb, 0), (void*)NULL);
+       EXPECT_EQ(BLI_findlink(&lb, 1), (void*)NULL);
+       EXPECT_EQ(BLI_rfindlink(&lb, -1), (void*)NULL);
+       EXPECT_EQ(BLI_rfindlink(&lb, 0), (void*)NULL);
+       EXPECT_EQ(BLI_rfindlink(&lb, 1), (void*)NULL);
+       EXPECT_EQ(BLI_findindex(&lb, link1), -1);
 
        /* One link */
        BLI_addtail(&lb, link1);
-       EXPECT_EQ(link1, BLI_findlink(&lb, 0));
-       EXPECT_EQ(link1, BLI_rfindlink(&lb, 0));
-       EXPECT_EQ(0, BLI_findindex(&lb, link1));
+       EXPECT_EQ(BLI_findlink(&lb, 0), link1);
+       EXPECT_EQ(BLI_rfindlink(&lb, 0), link1);
+       EXPECT_EQ(BLI_findindex(&lb, link1), 0);
 
        /* Two links */
        BLI_addtail(&lb, link2);
-       EXPECT_EQ(link2, BLI_findlink(&lb, 1));
-       EXPECT_EQ(link2, BLI_rfindlink(&lb, 0));
-       EXPECT_EQ(1, BLI_findindex(&lb, link2));
+       EXPECT_EQ(BLI_findlink(&lb, 1), link2);
+       EXPECT_EQ(BLI_rfindlink(&lb, 0), link2);
+       EXPECT_EQ(BLI_findindex(&lb, link2), 1);
 
        BLI_freelistN(&lb);
 }
index c80987c3586564e2cf0a83f79dbe973ddd05b04e..d017ab18b4d5449c66001696e49f705325f78233 100644 (file)
@@ -121,42 +121,42 @@ TEST(path_util, PathUtilFrame)
        {
                char path[FILE_MAX] = "";
                ret = BLI_path_frame(path, 123, 1);
-               EXPECT_EQ(1, ret);
+               EXPECT_EQ(ret, 1);
                EXPECT_STREQ("123", path);
        }
 
        {
                char path[FILE_MAX] = "";
                ret = BLI_path_frame(path, 123, 12);
-               EXPECT_EQ(1, ret);
+               EXPECT_EQ(ret, 1);
                EXPECT_STREQ("000000000123", path);
        }
 
        {
                char path[FILE_MAX] = "test_";
                ret = BLI_path_frame(path, 123, 1);
-               EXPECT_EQ(1, ret);
+               EXPECT_EQ(ret, 1);
                EXPECT_STREQ("test_123", path);
        }
 
        {
                char path[FILE_MAX] = "test_";
                ret = BLI_path_frame(path, 1, 12);
-               EXPECT_EQ(1, ret);
+               EXPECT_EQ(ret, 1);
                EXPECT_STREQ("test_000000000001", path);
        }
 
        {
                char path[FILE_MAX] = "test_############";
                ret = BLI_path_frame(path, 1, 0);
-               EXPECT_EQ(1, ret);
+               EXPECT_EQ(ret, 1);
                EXPECT_STREQ("test_000000000001", path);
        }
 
        {
                char path[FILE_MAX] = "test_#_#_middle";
                ret = BLI_path_frame(path, 123, 0);
-               EXPECT_EQ(1, ret);
+               EXPECT_EQ(ret, 1);
                EXPECT_STREQ("test_#_123_middle", path);
        }
 
@@ -164,14 +164,14 @@ TEST(path_util, PathUtilFrame)
        {
                char path[FILE_MAX] = "";
                ret = BLI_path_frame(path, 123, 0);
-               EXPECT_EQ(0, ret);
+               EXPECT_EQ(ret, 0);
                EXPECT_STREQ("", path);
        }
 
        {
                char path[FILE_MAX] = "test_middle";
                ret = BLI_path_frame(path, 123, 0);
-               EXPECT_EQ(0, ret);
+               EXPECT_EQ(ret, 0);
                EXPECT_STREQ("test_middle", path);
        }
 }
index a7c2a9c92c914d3e82b4d957ed75e2617bd45e58..5d112751fa02e1fdf34bd094716af71be90c78e8 100644 (file)
@@ -98,14 +98,14 @@ static void  test_polyfill_topology(
                        }
                }
        }
-       EXPECT_EQ(poly_tot + (poly_tot - 3), BLI_edgehash_size(edgehash));
+       EXPECT_EQ(BLI_edgehash_size(edgehash), poly_tot + (poly_tot - 3));
 
        for (i = 0; i < poly_tot; i++) {
                const unsigned int v1 = i;
                const unsigned int v2 = (i + 1) % poly_tot;
                void **p = BLI_edgehash_lookup_p(edgehash, v1, v2);
-               EXPECT_EQ(1, (void *)p != NULL);
-               EXPECT_EQ(1, (intptr_t)*p);
+               EXPECT_EQ((void *)p != NULL, 1);
+               EXPECT_EQ((intptr_t)*p, 1);
        }
 
        for (ehi = BLI_edgehashIterator_new(edgehash), i = 0;
index 7fc8df18c08a4e613cfe919bf966ff2192cfb88c..1818893735563dbcbd51537dafcd5e50fb3f3f5f 100644 (file)
@@ -40,7 +40,7 @@ TEST(stack, One)
        EXPECT_FALSE(BLI_stack_is_empty(stack));
        EXPECT_EQ(BLI_stack_count(stack), 1);
        BLI_stack_pop(stack, (void *)&out);
-       EXPECT_EQ(in, out);
+       EXPECT_EQ(out, in);
        EXPECT_TRUE(BLI_stack_is_empty(stack));
        EXPECT_EQ(BLI_stack_count(stack), 0);
        BLI_stack_free(stack);
@@ -61,7 +61,7 @@ TEST(stack, Range)
        for (in = tot - 1; in >= 0; in--) {
                EXPECT_FALSE(BLI_stack_is_empty(stack));
                BLI_stack_pop(stack, (void *)&out);
-               EXPECT_EQ(in, out);
+               EXPECT_EQ(out, in);
 
        }
        EXPECT_TRUE(BLI_stack_is_empty(stack));
@@ -150,7 +150,7 @@ TEST(stack, Clear)
                for (in = tot - 1; in >= 0; in--) {
                        EXPECT_FALSE(BLI_stack_is_empty(stack));
                        BLI_stack_pop(stack, (void *)&out);
-                       EXPECT_EQ(in, out);
+                       EXPECT_EQ(out, in);
                }
 
                EXPECT_TRUE(BLI_stack_is_empty(stack));
@@ -204,10 +204,10 @@ TEST(stack, Reuse)
        while (!BLI_stack_is_empty(stack)) {
                i--;
                BLI_stack_pop(stack, (void *)&sizes_test[i]);
-               EXPECT_EQ(sizes[i], sizes_test[i]);
+               EXPECT_EQ(sizes_test[i], sizes[i]);
                EXPECT_GT(i, -1);
        }
-       EXPECT_EQ(i, 0);
+       EXPECT_EQ(0, i);
        EXPECT_EQ(memcmp(sizes, sizes_test, sizeof(sizes) - sizeof(int)), 0);
 
 
index 08f2a745bdb08f7f8291a142ba375ca54249a42d..f6f7e17c8ca67f0382f2026d26954ecdb4f0acfa 100644 (file)
@@ -44,7 +44,7 @@ TEST(string, StrPartition)
 
                /* "mat.e-r_ial" -> "mat", '.', "e-r_ial", 3 */
                pre_ln = BLI_str_partition(str, delim, &sep, &suf);
-               EXPECT_EQ(3, pre_ln);
+               EXPECT_EQ(pre_ln, 3);
                EXPECT_EQ(&str[3], sep);
                EXPECT_STREQ("e-r_ial", suf);
        }
@@ -55,7 +55,7 @@ TEST(string, StrPartition)
 
                /* ".mate-rial--" -> "", '.', "mate-rial--", 0 */
                pre_ln = BLI_str_partition(str, delim, &sep, &suf);
-               EXPECT_EQ(0, pre_ln);
+               EXPECT_EQ(pre_ln, 0);
                EXPECT_EQ(&str[0], sep);
                EXPECT_STREQ("mate-rial--", suf);
        }
@@ -65,7 +65,7 @@ TEST(string, StrPartition)
 
                /* ".__.--_" -> "", '.', "__.--_", 0 */
                pre_ln = BLI_str_partition(str, delim, &sep, &suf);
-               EXPECT_EQ(0, pre_ln);
+               EXPECT_EQ(pre_ln, 0);
                EXPECT_EQ(&str[0], sep);
                EXPECT_STREQ("__.--_", suf);
        }
@@ -75,9 +75,9 @@ TEST(string, StrPartition)
 
                /* "" -> "", NULL, NULL, 0 */
                pre_ln = BLI_str_partition(str, delim, &sep, &suf);
-               EXPECT_EQ(0, pre_ln);
-               EXPECT_EQ(NULL, sep);
-               EXPECT_EQ(NULL, suf);
+               EXPECT_EQ(pre_ln, 0);
+               EXPECT_EQ(sep, (void*)NULL);
+               EXPECT_EQ(suf, (void*)NULL);
        }
 
        {
@@ -85,9 +85,9 @@ TEST(string, StrPartition)
 
                /* "material" -> "material", NULL, NULL, 8 */
                pre_ln = BLI_str_partition(str, delim, &sep, &suf);
-               EXPECT_EQ(8, pre_ln);
-               EXPECT_EQ(NULL, sep);
-               EXPECT_EQ(NULL, suf);
+               EXPECT_EQ(pre_ln, 8);
+               EXPECT_EQ(sep, (void*)NULL);
+               EXPECT_EQ(suf, (void*)NULL);
        }
 }
 
@@ -103,7 +103,7 @@ TEST(string, StrRPartition)
 
                /* "mat.e-r_ial" -> "mat.e-r", '_', "ial", 7 */
                pre_ln = BLI_str_rpartition(str, delim, &sep, &suf);
-               EXPECT_EQ(7, pre_ln);
+               EXPECT_EQ(pre_ln, 7);
                EXPECT_EQ(&str[7], sep);
                EXPECT_STREQ("ial", suf);
        }
@@ -114,7 +114,7 @@ TEST(string, StrRPartition)
 
                /* ".mate-rial--" -> ".mate-rial-", '-', "", 11 */
                pre_ln = BLI_str_rpartition(str, delim, &sep, &suf);
-               EXPECT_EQ(11, pre_ln);
+               EXPECT_EQ(pre_ln, 11);
                EXPECT_EQ(&str[11], sep);
                EXPECT_STREQ("", suf);
        }
@@ -124,7 +124,7 @@ TEST(string, StrRPartition)
 
                /* ".__.--_" -> ".__.--", '_', "", 6 */
                pre_ln = BLI_str_rpartition(str, delim, &sep, &suf);
-               EXPECT_EQ(6, pre_ln);
+               EXPECT_EQ(pre_ln, 6);
                EXPECT_EQ(&str[6], sep);
                EXPECT_STREQ("", suf);
        }
@@ -134,9 +134,9 @@ TEST(string, StrRPartition)
 
                /* "" -> "", NULL, NULL, 0 */
                pre_ln = BLI_str_rpartition(str, delim, &sep, &suf);
-               EXPECT_EQ(0, pre_ln);
-               EXPECT_EQ(NULL, sep);
-               EXPECT_EQ(NULL, suf);
+               EXPECT_EQ(pre_ln, 0);
+               EXPECT_EQ(sep, (void*)NULL);
+               EXPECT_EQ(suf, (void*)NULL);
        }
 
        {
@@ -144,9 +144,9 @@ TEST(string, StrRPartition)
 
                /* "material" -> "material", NULL, NULL, 8 */
                pre_ln = BLI_str_rpartition(str, delim, &sep, &suf);
-               EXPECT_EQ(8, pre_ln);
-               EXPECT_EQ(NULL, sep);
-               EXPECT_EQ(NULL, suf);
+               EXPECT_EQ(pre_ln, 8);
+               EXPECT_EQ(sep, (void*)NULL);
+               EXPECT_EQ(suf, (void*)NULL);
        }
 }
 
@@ -164,7 +164,7 @@ TEST(string, StrPartitionEx)
 
                /* "mat.e-r_ia.l" over "mat.e-r" -> "mat.e", '.', "r_ia.l", 3 */
                pre_ln = BLI_str_partition_ex(str, str + 6, delim, &sep, &suf, true);
-               EXPECT_EQ(5, pre_ln);
+               EXPECT_EQ(pre_ln, 5);
                EXPECT_EQ(&str[5], sep);
                EXPECT_STREQ("r_ia.l", suf);
        }
@@ -175,9 +175,9 @@ TEST(string, StrPartitionEx)
 
                /* "mate.rial" over "mate" -> "mate.rial", NULL, NULL, 4 */
                pre_ln = BLI_str_partition_ex(str, str + 4, delim, &sep, &suf, true);
-               EXPECT_EQ(4, pre_ln);
-               EXPECT_EQ(NULL, sep);
-               EXPECT_EQ(NULL, suf);
+               EXPECT_EQ(pre_ln, 4);
+               EXPECT_EQ(sep, (void*)NULL);
+               EXPECT_EQ(suf, (void*)NULL);
        }
 }
 
@@ -193,7 +193,7 @@ TEST(string, StrPartitionUtf8)
 
                /* "ma\xc3\xb1te-r\xe2\x98\xafial" -> "ma", '\xc3\xb1', "te-r\xe2\x98\xafial", 2 */
                pre_ln = BLI_str_partition_utf8(str, delim, &sep, &suf);
-               EXPECT_EQ(2, pre_ln);
+               EXPECT_EQ(pre_ln, 2);
                EXPECT_EQ(&str[2], sep);
                EXPECT_STREQ("te-r\xe2\x98\xafial", suf);
        }
@@ -204,7 +204,7 @@ TEST(string, StrPartitionUtf8)
 
                /* "\xe2\x98\xafmate-rial-\xc3\xb1" -> "", '\xe2\x98\xaf', "mate-rial-\xc3\xb1", 0 */
                pre_ln = BLI_str_partition_utf8(str, delim, &sep, &suf);
-               EXPECT_EQ(0, pre_ln);
+               EXPECT_EQ(pre_ln, 0);
                EXPECT_EQ(&str[0], sep);
                EXPECT_STREQ("mate-rial-\xc3\xb1", suf);
        }
@@ -214,7 +214,7 @@ TEST(string, StrPartitionUtf8)
 
                /* "\xe2\x98\xaf.\xc3\xb1_.--\xc3\xb1" -> "", '\xe2\x98\xaf', ".\xc3\xb1_.--\xc3\xb1", 0 */
                pre_ln = BLI_str_partition_utf8(str, delim, &sep, &suf);
-               EXPECT_EQ(0, pre_ln);
+               EXPECT_EQ(pre_ln, 0);
                EXPECT_EQ(&str[0], sep);
                EXPECT_STREQ(".\xc3\xb1_.--\xc3\xb1", suf);
        }
@@ -224,9 +224,9 @@ TEST(string, StrPartitionUtf8)
 
                /* "" -> "", NULL, NULL, 0 */
                pre_ln = BLI_str_partition_utf8(str, delim, &sep, &suf);
-               EXPECT_EQ(0, pre_ln);
-               EXPECT_EQ(NULL, sep);
-               EXPECT_EQ(NULL, suf);
+               EXPECT_EQ(pre_ln, 0);
+               EXPECT_EQ(sep, (void*)NULL);
+               EXPECT_EQ(suf, (void*)NULL);
        }
 
        {
@@ -234,9 +234,9 @@ TEST(string, StrPartitionUtf8)
 
                /* "material" -> "material", NULL, NULL, 8 */
                pre_ln = BLI_str_partition_utf8(str, delim, &sep, &suf);
-               EXPECT_EQ(8, pre_ln);
-               EXPECT_EQ(NULL, sep);
-               EXPECT_EQ(NULL, suf);
+               EXPECT_EQ(pre_ln, 8);
+               EXPECT_EQ(sep, (void*)NULL);
+               EXPECT_EQ(suf, (void*)NULL);
        }
 }
 
@@ -252,7 +252,7 @@ TEST(string, StrRPartitionUtf8)
 
                /* "ma\xc3\xb1te-r\xe2\x98\xafial" -> "mat\xc3\xb1te-r", '\xe2\x98\xaf', "ial", 8 */
                pre_ln = BLI_str_rpartition_utf8(str, delim, &sep, &suf);
-               EXPECT_EQ(8, pre_ln);
+               EXPECT_EQ(pre_ln, 8);
                EXPECT_EQ(&str[8], sep);
                EXPECT_STREQ("ial", suf);
        }
@@ -263,7 +263,7 @@ TEST(string, StrRPartitionUtf8)
 
                /* "\xe2\x98\xafmate-rial-\xc3\xb1" -> "\xe2\x98\xafmate-rial-", '\xc3\xb1', "", 13 */
                pre_ln = BLI_str_rpartition_utf8(str, delim, &sep, &suf);
-               EXPECT_EQ(13, pre_ln);
+               EXPECT_EQ(pre_ln, 13);
                EXPECT_EQ(&str[13], sep);
                EXPECT_STREQ("", suf);
        }
@@ -273,7 +273,7 @@ TEST(string, StrRPartitionUtf8)
 
                /* "\xe2\x98\xaf.\xc3\xb1_.--\xc3\xb1" -> "\xe2\x98\xaf.\xc3\xb1_.--", '\xc3\xb1', "", 10 */
                pre_ln = BLI_str_rpartition_utf8(str, delim, &sep, &suf);
-               EXPECT_EQ(10, pre_ln);
+               EXPECT_EQ(pre_ln, 10);
                EXPECT_EQ(&str[10], sep);
                EXPECT_STREQ("", suf);
        }
@@ -283,9 +283,9 @@ TEST(string, StrRPartitionUtf8)
 
                /* "" -> "", NULL, NULL, 0 */
                pre_ln = BLI_str_rpartition_utf8(str, delim, &sep, &suf);
-               EXPECT_EQ(0, pre_ln);
-               EXPECT_EQ(NULL, sep);
-               EXPECT_EQ(NULL, suf);
+               EXPECT_EQ(pre_ln, 0);
+               EXPECT_EQ(sep, (void*)NULL);
+               EXPECT_EQ(suf, (void*)NULL);
        }
 
        {
@@ -293,9 +293,9 @@ TEST(string, StrRPartitionUtf8)
 
                /* "material" -> "material", NULL, NULL, 8 */
                pre_ln = BLI_str_rpartition_utf8(str, delim, &sep, &suf);
-               EXPECT_EQ(8, pre_ln);
-               EXPECT_EQ(NULL, sep);
-               EXPECT_EQ(NULL, suf);
+               EXPECT_EQ(pre_ln, 8);
+               EXPECT_EQ(sep, (void*)NULL);
+               EXPECT_EQ(suf, (void*)NULL);
        }
 }
 
@@ -313,7 +313,7 @@ TEST(string, StrPartitionExUtf8)
 
                /* "ma\xc3\xb1te-r\xe2\x98\xafial" over "ma\xc3\xb1te" -> "ma", '\xc3\xb1', "te-r\xe2\x98\xafial", 2 */
                pre_ln = BLI_str_partition_ex_utf8(str, str + 6, delim, &sep, &suf, true);
-               EXPECT_EQ(2, pre_ln);
+               EXPECT_EQ(pre_ln, 2);
                EXPECT_EQ(&str[2], sep);
                EXPECT_STREQ("te-r\xe2\x98\xafial", suf);
        }
@@ -324,9 +324,9 @@ TEST(string, StrPartitionExUtf8)
 
                /* "mate\xe2\x98\xafrial" over "mate" -> "mate\xe2\x98\xafrial", NULL, NULL, 4 */
                pre_ln = BLI_str_partition_ex_utf8(str, str + 4, delim, &sep, &suf, true);
-               EXPECT_EQ(4, pre_ln);
-               EXPECT_EQ(NULL, sep);
-               EXPECT_EQ(NULL, suf);
+               EXPECT_EQ(pre_ln, 4);
+               EXPECT_EQ(sep, (void*)NULL);
+               EXPECT_EQ(suf, (void*)NULL);
        }
 }
 
@@ -373,7 +373,7 @@ TEST(string, StrFormatIntGrouped)
        const int word_cmp_size = ARRAY_SIZE(word_cmp); \
        const int word_num = BLI_string_find_split_words( \
                word_str_src, word_str_src_len, ' ', word_info, word_cmp_size_input); \
-       EXPECT_EQ(word_num, word_cmp_size - 1); \
+       EXPECT_EQ(word_cmp_size - 1, word_num); \
        EXPECT_EQ_ARRAY_ND<const int[2]>(word_cmp, word_info, word_cmp_size, 2); \
 } ((void)0)
 
@@ -449,20 +449,20 @@ TEST(string, StringStrncasestr)
        const char *res;
 
        res = BLI_strncasestr(str_test0, "", 0);
-       EXPECT_EQ(str_test0, res);
+       EXPECT_EQ(res, str_test0);
 
        res = BLI_strncasestr(str_test0, " ", 1);
-       EXPECT_EQ(str_test0 + 6, res);
+       EXPECT_EQ(res, str_test0 + 6);
 
        res = BLI_strncasestr(str_test0, "her", 3);
-       EXPECT_EQ(str_test0 + 7, res);
+       EXPECT_EQ(res, str_test0 + 7);
 
        res = BLI_strncasestr(str_test0, "ARCh", 4);
-       EXPECT_EQ(str_test0 + 2, res);
+       EXPECT_EQ(res, str_test0 + 2);
 
        res = BLI_strncasestr(str_test0, "earcq", 4);
-       EXPECT_EQ(str_test0 + 1, res);
+       EXPECT_EQ(res, str_test0 + 1);
 
        res = BLI_strncasestr(str_test0, "not there", 9);
-       EXPECT_EQ(NULL, res);
+       EXPECT_EQ(res, (void*)NULL);
 }
index c0beb92eeec9dbed65d018b1ed392b580ad97067..95d73b4242f4e9f8751375ac227096bb14ba7a18 100644 (file)
@@ -298,7 +298,7 @@ TEST(string, Utf8InvalidBytes)
                const int num_errors_found = BLI_utf8_invalid_strip(buff, sizeof(buff) - 1);
 
                printf("[%02d] -> [%02d] \"%s\"  ->  \"%s\"\n", num_errors, num_errors_found, tst, buff);
-               EXPECT_EQ(num_errors, num_errors_found);
+               EXPECT_EQ(num_errors_found, num_errors);
                EXPECT_STREQ(buff, tst_stripped);
        }
 }
index f386abc0b2b24cc1c0d87b4988d2f0aded7107ba..b2cb1a4e8a38e3c9e410a569a78e398ab90cd492 100644 (file)
@@ -12,18 +12,18 @@ TEST(bmesh_core, BMVertCreate) {
        BMeshCreateParams bm_params;
        bm_params.use_toolflags = true;
        bm = BM_mesh_create(&bm_mesh_allocsize_default, &bm_params);
-       EXPECT_EQ(0, bm->totvert);
+       EXPECT_EQ(bm->totvert, 0);
        /* make a custom layer so we can see if it is copied properly */
        BM_data_layer_add(bm, &bm->vdata, CD_PROP_FLT);
        bv1 = BM_vert_create(bm, co1, NULL, BM_CREATE_NOP);
        ASSERT_TRUE(bv1 != NULL);
-       EXPECT_EQ(1.0f, bv1->co[0]);
-       EXPECT_EQ(2.0f, bv1->co[1]);
-       EXPECT_EQ(0.0f, bv1->co[2]);
+       EXPECT_EQ(bv1->co[0], 1.0f);
+       EXPECT_EQ(bv1->co[1], 2.0f);
+       EXPECT_EQ(bv1->co[2], 0.0f);
        EXPECT_TRUE(is_zero_v3(bv1->no));
-       EXPECT_EQ((char)BM_VERT, bv1->head.htype);
-       EXPECT_EQ(0, bv1->head.hflag);
-       EXPECT_EQ(0, bv1->head.api_flag);
+       EXPECT_EQ(bv1->head.htype, (char)BM_VERT);
+       EXPECT_EQ(bv1->head.hflag, 0);
+       EXPECT_EQ(bv1->head.api_flag, 0);
        bv2 = BM_vert_create(bm, NULL, NULL, BM_CREATE_NOP);
        ASSERT_TRUE(bv2 != NULL);
        EXPECT_TRUE(is_zero_v3(bv2->co));
@@ -33,7 +33,7 @@ TEST(bmesh_core, BMVertCreate) {
        bv3 = BM_vert_create(bm, co1, bv2, BM_CREATE_NOP);
        ASSERT_TRUE(bv3 != NULL);
        EXPECT_FALSE(BM_elem_flag_test((BMElem *)bv3, BM_ELEM_SELECT));
-       EXPECT_EQ(1.5f, BM_elem_float_data_get(&bm->vdata, bv3, CD_PROP_FLT));
-       EXPECT_EQ(3, BM_mesh_elem_count(bm, BM_VERT));
+       EXPECT_EQ(BM_elem_float_data_get(&bm->vdata, bv3, CD_PROP_FLT), 1.5f);
+       EXPECT_EQ(BM_mesh_elem_count(bm, BM_VERT), 3);
        BM_mesh_free(bm);
 }
index 345c3824b6348cf75ca1b19ee7e45cf4a53ceb19..01ff38f05281b921a31094d8e80dd615fd54aba8 100644 (file)
@@ -8,7 +8,7 @@ extern "C" {
 
 #include "MEM_guardedalloc.h"
 
-#define CHECK_ALIGNMENT(ptr, align) EXPECT_EQ(0, (size_t)ptr % align)
+#define CHECK_ALIGNMENT(ptr, align) EXPECT_EQ((size_t)ptr % align, 0)
 
 namespace {