Code

store_lookup_test: Verify that NULL is not a valid attribute name.
authorSebastian Harl <sh@tokkee.org>
Sun, 22 Jun 2014 14:06:42 +0000 (16:06 +0200)
committerSebastian Harl <sh@tokkee.org>
Sun, 22 Jun 2014 14:06:42 +0000 (16:06 +0200)
t/unit/core/store_lookup_test.c

index c3f3b514a17a0c279582e0c4c3b73bf3900808ee..5c3dc4866493e2caa0bfe2fc9a2254163aebae5b 100644 (file)
@@ -203,6 +203,11 @@ START_TEST(test_store_match_attr)
        fail_unless(obj != NULL,
                        "sdb_store_get_host(a) = NULL; expected: <host>");
 
+       fail_unless(sdb_store_attr_matcher(NULL, "re", 0) == NULL,
+                       "sdb_store_attr_matcher(NULL, \"re\", 0) = <m>; expected: NULL");
+       fail_unless(sdb_store_attr_matcher(NULL, "re", 1) == NULL,
+                       "sdb_store_attr_matcher(NULL, \"re\", 1) = <m>; expected: NULL");
+
        for (i = 0; i < SDB_STATIC_ARRAY_LEN(golden_data); ++i) {
                sdb_store_matcher_t *m, *n;
                char buf[1024];