index c6eeb6bc3ae4d83b2cc6c323063795c5fe04083d..1adece554b031c6f94712b2a4977aa6ed2715e63 100644 (file)
} golden_data[] = {
{ "host = 'a'", NULL, 1,
"OBJ\\[host\\]\\{ NAME\\{ 'a', \\(nil\\) \\} \\}" },
- { "host = 'a'", "host = 'b'", 0,
+ { "host = 'a'", "host = 'x'", 0, /* filter never matches */
"OBJ\\[host\\]\\{ NAME\\{ 'a', \\(nil\\) \\} \\}" },
{ "host = 'a'",
- "attribute.x IS NULL", 1,
+ "NOT attribute.x = ''", 1, /* filter always matches */
"OBJ\\[host\\]\\{ NAME\\{ 'a', \\(nil\\) \\} \\}" },
{ "host =~ 'a|b'", NULL, 2,
"OBJ\\[host\\]\\{ NAME\\{ NULL, "PTR_RE" \\} \\}" },
"OBJ\\[host\\]\\{ NAME\\{ NULL, "PTR_RE" \\} \\}" },
{ "service = 's1'", NULL, 2,
"OBJ\\[service\\]\\{ NAME\\{ 's1', \\(nil\\) } \\}" },
+ { "service = 's1'", "host = 'x'", 0, /* filter never matches */
+ "OBJ\\[service\\]\\{ NAME\\{ 's1', \\(nil\\) } \\}" },
+ { "service = 's1'",
+ "NOT attribute.x = ''", 2, /* filter always matches */
+ "OBJ\\[service\\]\\{ NAME\\{ 's1', \\(nil\\) } \\}" },
{ "service =~ 's'", NULL, 2,
"OBJ\\[service\\]\\{ NAME\\{ NULL, "PTR_RE" } \\}" },
{ "service !~ 's'", NULL, 1,
"\\(NOT, OBJ\\[service\\]\\{ NAME\\{ NULL, "PTR_RE" } \\}\\)" },
{ "attribute = 'k1'", NULL, 1,
"OBJ\\[attribute\\]\\{ NAME\\{ 'k1', \\(nil\\) \\} " },
+ { "attribute = 'k1'", "host = 'x'", 0, /* filter never matches */
+ "OBJ\\[attribute\\]\\{ NAME\\{ 'k1', \\(nil\\) \\} " },
+ { "attribute = 'k1'",
+ "NOT attribute.x = ''", 1, /* filter always matches */
+ "OBJ\\[attribute\\]\\{ NAME\\{ 'k1', \\(nil\\) \\} " },
{ "attribute = 'x'", NULL, 0,
"OBJ\\[attribute\\]\\{ NAME\\{ 'x', \\(nil\\) \\}" },
{ "attribute.k1 = 'v1'", NULL, 1,
n = 0;
sdb_store_scan(m, filter, scan_cb, &n);
fail_unless(n == golden_data[i].expected,
- "sdb_store_scan(matcher{%s}, filter{NULL}) found %d hosts; "
- "expected: %d", golden_data[i].query, n,
- golden_data[i].expected);
+ "sdb_store_scan(matcher{%s}, filter{%s}) found %d hosts; "
+ "expected: %d", golden_data[i].query, golden_data[i].filter,
+ n, golden_data[i].expected);
sdb_object_deref(SDB_OBJ(filter));
sdb_object_deref(SDB_OBJ(m));
}