Code

store_lookup_test: Fixed user-data passed to the lookup callback.
authorSebastian Harl <sh@tokkee.org>
Wed, 9 Apr 2014 14:25:29 +0000 (16:25 +0200)
committerSebastian Harl <sh@tokkee.org>
Wed, 9 Apr 2014 14:25:29 +0000 (16:25 +0200)
t/core/store_lookup_test.c

index 3b9a6d0cc9c65dec37cdd9fe16a109a7d2e370f8..8aa730b1bdcf2d3ed29608c3a1913aab72cee2d7 100644 (file)
@@ -438,15 +438,15 @@ START_TEST(test_lookup)
                { "attribute.k1 != 'v2'",  3 },
        };
 
                { "attribute.k1 != 'v2'",  3 },
        };
 
-       size_t i;
        int check, n;
        int check, n;
+       size_t i;
 
 
-       i = 0;
-       check = sdb_store_lookup(NULL, lookup_cb, &i);
+       n = 0;
+       check = sdb_store_lookup(NULL, lookup_cb, &n);
        fail_unless(check == 0,
                        "sdb_store_lookup() = %d; expected: 0", check);
        fail_unless(check == 0,
                        "sdb_store_lookup() = %d; expected: 0", check);
-       fail_unless(i == 3,
-                       "sdb_store_lookup called callback %d times; expected: 3", (int)i);
+       fail_unless(n == 3,
+                       "sdb_store_lookup called callback %d times; expected: 3", (int)n);
 
        for (i = 0; i < SDB_STATIC_ARRAY_LEN(golden_data); ++i) {
                sdb_store_matcher_t *m = sdb_fe_parse_matcher(golden_data[i].query, -1);
 
        for (i = 0; i < SDB_STATIC_ARRAY_LEN(golden_data); ++i) {
                sdb_store_matcher_t *m = sdb_fe_parse_matcher(golden_data[i].query, -1);