Code

store_lookup_test: Continue loop after fail().
authorSebastian Harl <sh@tokkee.org>
Sun, 23 Feb 2014 04:25:56 +0000 (20:25 -0800)
committerSebastian Harl <sh@tokkee.org>
Sun, 23 Feb 2014 04:25:56 +0000 (20:25 -0800)
The compiler does not know that fail aborts the test program and clang
(correctly) complains that the variable ('m' in this case) might be used
uninitialized afterwards.

t/core/store_lookup_test.c

index 48bb4832f4b81e723743d27cefd1c705e40e93a5..74274f80c0cf0f8fc6ec75b7a4dcc909c1c19449 100644 (file)
@@ -293,8 +293,10 @@ START_TEST(test_store_match_op)
                else if (! strcmp(golden_data[i].op, "AND"))
                        m = sdb_store_con_matcher(golden_data[i].left,
                                        golden_data[i].right);
-               else
+               else {
                        fail("INTERNAL ERROR: unexpected operator %s", golden_data[i].op);
+                       continue;
+               }
 
 #define TO_NAME(v) (((v) == always) ? "always" \
                : ((v) == never) ? "never" : "<unknown>")