]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-dict-backend: test-dict-sql - Use test_assert_strcmp*()
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 25 Feb 2021 13:49:47 +0000 (15:49 +0200)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Thu, 4 Mar 2021 13:24:23 +0000 (13:24 +0000)
src/lib-dict-backend/test-dict-sql.c

index b7dfd88d0b0b361af5773c2c489f51987ada2c7d..b5a966e1d6719345a40a319deeced2022f536008 100644 (file)
@@ -65,7 +65,7 @@ static void test_lookup_one(void)
        test_set_expected(dict, &res);
 
        test_assert(dict_lookup(dict, pool, "shared/dictmap/hello/world", &value, &error) == 1);
-       test_assert(value != NULL && strcmp(value, "one") == 0);
+       test_assert_strcmp(value, "one");
         if (error != NULL)
                 i_error("dict_lookup failed: %s", error);
        test_teardown(&dict);
@@ -213,8 +213,8 @@ static void test_iterate(void)
        size_t idx = 0;
        while(dict_iterate(iter, &key, &value)) {
                i_assert(idx < rset.rows);
-               test_assert_idx(strcmp(key, "shared/counters/global/counter") == 0 &&
-                               strcmp(value, rset.row_data[idx][0]) == 0, idx);
+               test_assert_strcmp_idx(key, "shared/counters/global/counter", idx);
+               test_assert_strcmp_idx(value, rset.row_data[idx][0], idx);
                idx++;
        }
 
@@ -240,8 +240,8 @@ static void test_iterate(void)
 
        while(dict_iterate(iter, &key, &value)) {
                i_assert(idx < rset.rows);
-               test_assert_idx(strcmp(key, "shared/counters/global/counter") == 0 &&
-                               strcmp(value, rset.row_data[idx][0]) == 0, idx);
+               test_assert_strcmp_idx(key, "shared/counters/global/counter", idx);
+               test_assert_strcmp_idx(value, rset.row_data[idx][0], idx);
                idx++;
        }