index 89ef451aba32dc285c3a6fd47c5ef61f7c13c782..3b0e956e327404f11c42e96d8391dce60bb08b3b 100644 (file)
{
const char *hosts[] = { "a", "b", "c" };
+ struct {
+ const char *host;
+ const char *metric;
+ } metrics[] = {
+ { "a", "m1" },
+ { "b", "m1" },
+ { "b", "m2" },
+ };
+
struct {
const char *host;
const char *service;
hosts[i], status);
}
+ for (i = 0; i < SDB_STATIC_ARRAY_LEN(metrics); ++i) {
+ int status = sdb_store_metric(metrics[i].host,
+ metrics[i].metric, /* store */ NULL, 1);
+ fail_unless(status == 0,
+ "sdb_store_metric(%s, %s, NULL, 1) = %d; expected: 0",
+ metrics[i].host, metrics[i].metric, status);
+ }
+
for (i = 0; i < SDB_STATIC_ARRAY_LEN(services); ++i) {
int status = sdb_store_service(services[i].host,
services[i].service, 1);
{ SDB_HOST, "^b$", 1, 0 },
{ SDB_HOST, "^a$", 0, 0 },
{ SDB_HOST, "^b$", 0, 0 },
+ { SDB_METRIC, NULL, 0, 1 },
+ { SDB_METRIC, NULL, 1, 1 },
+ { SDB_METRIC, "m1", 0, 1 },
+ { SDB_METRIC, "m1", 1, 1 },
+ { SDB_METRIC, "^m1$", 1, 1 },
+ { SDB_METRIC, "m", 1, 1 },
+ { SDB_METRIC, "s", 1, 0 },
+ { SDB_METRIC, "m2", 0, 0 },
+ { SDB_METRIC, "x1", 0, 0 },
+ { SDB_METRIC, "x1", 1, 0 },
{ SDB_SERVICE, NULL, 0, 1 },
{ SDB_SERVICE, NULL, 1, 1 },
{ SDB_SERVICE, "s1", 0, 1 },
{ "k1", { SDB_TYPE_STRING, { .string = "v1" } }, 0, 1, 1, 1, 0 },
{ "k1", { SDB_TYPE_STRING, { .string = "v2" } }, 1, 1, 0, 0, 0 },
{ "k1", { SDB_TYPE_STRING, { .string = "v0" } }, 0, 0, 0, 1, 1 },
+ { "k1", { SDB_TYPE_STRING, { .string = "0" } }, 0, 0, 0, 1, 1 },
{ "k2", { SDB_TYPE_INTEGER, { .integer = 123 } }, 0, 1, 1, 1, 0 },
{ "k2", { SDB_TYPE_INTEGER, { .integer = 124 } }, 1, 1, 0, 0, 0 },
{ "k2", { SDB_TYPE_INTEGER, { .integer = 122 } }, 0, 0, 0, 1, 1 },
{ "k3", { SDB_TYPE_STRING, { .string = "123" } }, 0, 0, 0, 0, 0 },
{ "k3", { SDB_TYPE_INTEGER, { .integer = 123 } }, 0, 0, 0, 0, 0 },
/* type mismatch */
- { "k1", { SDB_TYPE_INTEGER, { .integer = 0 } }, 0, 0, 0, 0, 0 },
- { "k2", { SDB_TYPE_STRING, { .string = "123" } }, 0, 0, 0, 0, 0 },
+ { "k1", { SDB_TYPE_INTEGER, { .integer = 0 } }, 0, 0, 0, 1, 1 },
+ { "k2", { SDB_TYPE_STRING, { .string = "123" } }, 0, 1, 1, 1, 0 },
};
int status;
const sdb_data_t value;
int expected_lt, expected_le, expected_eq, expected_ge, expected_gt;
} golden_data[] = {
+ { "b", SDB_FIELD_NAME,
+ { SDB_TYPE_STRING, { .string = "a" } }, 0, 0, 0, 1, 1 },
+ { "b", SDB_FIELD_NAME,
+ { SDB_TYPE_STRING, { .string = "b" } }, 0, 1, 1, 1, 0 },
+ { "b", SDB_FIELD_NAME,
+ { SDB_TYPE_STRING, { .string = "c" } }, 1, 1, 0, 0, 0 },
/* last-update = 1 for all objects */
{ "a", SDB_FIELD_LAST_UPDATE,
{ SDB_TYPE_DATETIME, { .datetime = 1 } }, 0, 1, 1, 1, 0 },
{ SDB_TYPE_INTEGER, { .integer = 0 } }, 0, 0, 0, 0, 0 },
{ "a", SDB_FIELD_BACKEND,
{ SDB_TYPE_INTEGER, { .integer = 0 } }, 0, 0, 0, 0, 0 },
+ { "a", SDB_FIELD_BACKEND,
+ { SDB_TYPE_INTEGER, { .integer = 0 } }, 0, 0, 0, 0, 0 },
+ /* (64bit) integer value without zero-bytes */
+ { "a", SDB_FIELD_BACKEND,
+ { SDB_TYPE_INTEGER, { .integer = 0xffffffffffffffffL } },
+ 0, 0, 0, 0, 0 },
};
int status;
status = sdb_store_matcher_matches(m, obj, /* filter */ NULL);
fail_unless(status == tests[j].expected,
- "sdb_store_matcher_matches(%s, <obj>, NULL) = %d; "
+ "sdb_store_matcher_matches(%s, <host '%s'>, NULL) = %d; "
"expected: %d",
sdb_store_matcher_tostring(m, m_str, sizeof(m_str)),
status, tests[j].expected);
START_TEST(test_parse_cmp)
{
- sdb_data_t hostname = { SDB_TYPE_STRING, { .string = "hostname" } };
- sdb_data_t srvname = { SDB_TYPE_STRING, { .string = "srvname" } };
- sdb_data_t attrname = { SDB_TYPE_STRING, { .string = "attrname" } };
+ sdb_data_t hostname = { SDB_TYPE_STRING, { .string = "hostname" } };
+ sdb_data_t metricname = { SDB_TYPE_STRING, { .string = "metricname" } };
+ sdb_data_t srvname = { SDB_TYPE_STRING, { .string = "srvname" } };
+ sdb_data_t attrname = { SDB_TYPE_STRING, { .string = "attrname" } };
+ sdb_data_t attrvalue = { SDB_TYPE_INTEGER, { .integer = 4711 } };
sdb_store_matcher_t *check;
const sdb_data_t *value;
int expected;
} golden_data[] = {
- { "host", NULL, "=", &hostname, MATCHER_NAME },
- { "host", NULL, "!=", &hostname, MATCHER_NOT },
- { "host", NULL, "=~", &hostname, MATCHER_NAME },
- { "host", NULL, "!~", &hostname, MATCHER_NOT },
- { "host", "attr", "=", &hostname, -1 },
- { "host", "attr", "!=", &hostname, -1 },
- { "host", NULL, "&^", &hostname, -1 },
- { "host", NULL, "<", &hostname, -1 },
- { "host", NULL, "<=", &hostname, -1 },
- { "host", NULL, ">=", &hostname, -1 },
- { "host", NULL, ">", &hostname, -1 },
- { "host", NULL, "=", NULL, -1 },
- { "service", NULL, "=", &srvname, MATCHER_NAME },
- { "service", NULL, "!=", &srvname, MATCHER_NOT },
- { "service", NULL, "=~", &srvname, MATCHER_NAME },
- { "service", NULL, "!~", &srvname, MATCHER_NOT },
- { "service", "attr", "=", &srvname, -1 },
- { "service", "attr", "!=", &srvname, -1 },
- { "service", NULL, "&^", &srvname, -1 },
- { "service", NULL, "<", &srvname, -1 },
- { "service", NULL, "<=", &srvname, -1 },
- { "service", NULL, ">=", &srvname, -1 },
- { "service", NULL, ">", &srvname, -1 },
- { "service", NULL, "=", NULL, -1 },
- { "attribute", NULL, "=", &attrname, MATCHER_NAME },
- { "attribute", NULL, "!=", &attrname, MATCHER_NOT },
- { "attribute", NULL, "=~", &attrname, MATCHER_NAME },
- { "attribute", NULL, "!~", &attrname, MATCHER_NOT },
- { "attribute", NULL, "<", &attrname, -1 },
- { "attribute", NULL, "<=", &attrname, -1 },
- { "attribute", NULL, ">=", &attrname, -1 },
- { "attribute", NULL, ">", &attrname, -1 },
- { "attribute", NULL, "=", NULL, -1 },
- { "attribute", "attr", "=", &attrname, MATCHER_ATTR },
- { "attribute", "attr", "!=", &attrname, MATCHER_NOT },
- { "attribute", "attr", "=~", &attrname, MATCHER_ATTR },
- { "attribute", "attr", "!~", &attrname, MATCHER_NOT },
- { "attribute", "attr", "&^", &attrname, -1 },
- { "attribute", "attr", "<", NULL, -1 },
- { "attribute", "attr", "<", &attrname, MATCHER_LT },
- { "attribute", "attr", "<=", &attrname, MATCHER_LE },
-/* { "attribute", "attr", "=", &attrname, MATCHER_EQ }, */
- { "attribute", "attr", ">=", &attrname, MATCHER_GE },
- { "attribute", "attr", ">", &attrname, MATCHER_GT },
- { "attribute", "attr", "IS", NULL, MATCHER_ISNULL },
- { "attribute", "attr", "IS", &attrname, -1 },
- { "foo", NULL, "=", &attrname, -1 },
- { "foo", "attr", "=", &attrname, -1 },
+ { "host", NULL, "=", &hostname, MATCHER_NAME },
+ { "host", NULL, "!=", &hostname, MATCHER_NOT },
+ { "host", NULL, "=~", &hostname, MATCHER_NAME },
+ { "host", NULL, "!~", &hostname, MATCHER_NOT },
+ { "host", "attr", "=", &hostname, -1 },
+ { "host", "attr", "!=", &hostname, -1 },
+ { "host", "attr", "!=", &attrvalue, -1 },
+ { "host", "attr", "<=", &attrvalue, -1 },
+ { "host", NULL, "&^", &hostname, -1 },
+ { "host", NULL, "<", &hostname, -1 },
+ { "host", NULL, "<=", &hostname, -1 },
+ { "host", NULL, ">=", &hostname, -1 },
+ { "host", NULL, ">", &hostname, -1 },
+ { "host", NULL, "=", NULL, -1 },
+ { "metric", NULL, "=", &metricname, MATCHER_NAME },
+ { "metric", NULL, "!=", &metricname, MATCHER_NOT },
+ { "metric", NULL, "=~", &metricname, MATCHER_NAME },
+ { "metric", NULL, "!~", &metricname, MATCHER_NOT },
+ { "metric", "attr", "=", &metricname, -1 },
+ { "metric", "attr", "!=", &metricname, -1 },
+ { "metric", "attr", "!=", &attrvalue, -1 },
+ { "metric", "attr", "<=", &attrvalue, -1 },
+ { "metric", NULL, "&^", &metricname, -1 },
+ { "metric", NULL, "<", &metricname, -1 },
+ { "metric", NULL, "<=", &metricname, -1 },
+ { "metric", NULL, ">=", &metricname, -1 },
+ { "metric", NULL, ">", &metricname, -1 },
+ { "metric", NULL, "=", NULL, -1 },
+ { "service", NULL, "=", &srvname, MATCHER_NAME },
+ { "service", NULL, "!=", &srvname, MATCHER_NOT },
+ { "service", NULL, "=~", &srvname, MATCHER_NAME },
+ { "service", NULL, "!~", &srvname, MATCHER_NOT },
+ { "service", "attr", "=", &srvname, -1 },
+ { "service", "attr", "!=", &srvname, -1 },
+ { "service", "attr", "!=", &attrvalue, -1 },
+ { "service", "attr", "<=", &attrvalue, -1 },
+ { "service", NULL, "&^", &srvname, -1 },
+ { "service", NULL, "<", &srvname, -1 },
+ { "service", NULL, "<=", &srvname, -1 },
+ { "service", NULL, ">=", &srvname, -1 },
+ { "service", NULL, ">", &srvname, -1 },
+ { "service", NULL, "=", NULL, -1 },
+ { "attribute", NULL, "=", &attrname, MATCHER_NAME },
+ { "attribute", NULL, "!=", &attrname, MATCHER_NOT },
+ { "attribute", NULL, "=~", &attrname, MATCHER_NAME },
+ { "attribute", NULL, "!~", &attrname, MATCHER_NOT },
+ { "attribute", NULL, "<", &attrname, -1 },
+ { "attribute", NULL, "<=", &attrname, -1 },
+ { "attribute", NULL, ">=", &attrname, -1 },
+ { "attribute", NULL, ">", &attrname, -1 },
+ { "attribute", NULL, "=", NULL, -1 },
+ { "attribute", "attr", "=", &attrname, MATCHER_ATTR },
+ { "attribute", "attr", "!=", &attrname, MATCHER_NOT },
+ { "attribute", "attr", "=~", &attrname, MATCHER_ATTR },
+ { "attribute", "attr", "!~", &attrname, MATCHER_NOT },
+ { "attribute", "attr", "&^", &attrname, -1 },
+ { "attribute", "attr", "<", NULL, -1 },
+ { "attribute", "attr", "<", &attrname, MATCHER_LT },
+ { "attribute", "attr", "<=", &attrname, MATCHER_LE },
+/* { "attribute", "attr", "=", &attrname, MATCHER_EQ }, */
+ { "attribute", "attr", ">=", &attrname, MATCHER_GE },
+ { "attribute", "attr", ">", &attrname, MATCHER_GT },
+ { "attribute", "attr", "IS", NULL, MATCHER_ISNULL },
+ { "attribute", "attr", "IS", &attrname, -1 },
+ { "foo", NULL, "=", &attrname, -1 },
+ { "foo", "attr", "=", &attrname, -1 },
};
for (i = 0; i < SDB_STATIC_ARRAY_LEN(golden_data); ++i) {
}
END_TEST
+START_TEST(test_parse_field_cmp)
+{
+ sdb_data_t datetime = { SDB_TYPE_DATETIME, { .datetime = 1 } };
+ sdb_data_t string = { SDB_TYPE_STRING, { .string = "s" } };
+
+ struct {
+ const char *field;
+ const char *op;
+ const sdb_data_t *value;
+ int expected;
+ } golden_data[] = {
+ { "name", "<", &string, MATCHER_LT },
+ { "name", "<=", &string, MATCHER_LE },
+ { "name", "=", &string, MATCHER_EQ },
+ { "name", ">=", &string, MATCHER_GE },
+ { "name", ">", &string, MATCHER_GT },
+ { "name", "!=", &string, MATCHER_NOT },
+ { "last_update", "<", &datetime, MATCHER_LT },
+ { "last_update", "<=", &datetime, MATCHER_LE },
+ { "last_update", "=", &datetime, MATCHER_EQ },
+ { "last_update", ">=", &datetime, MATCHER_GE },
+ { "last_update", ">", &datetime, MATCHER_GT },
+ { "last_update", "!=", &datetime, MATCHER_NOT },
+ { "age", "<", &datetime, MATCHER_LT },
+ { "age", "<=", &datetime, MATCHER_LE },
+ { "age", "=", &datetime, MATCHER_EQ },
+ { "age", ">=", &datetime, MATCHER_GE },
+ { "age", ">", &datetime, MATCHER_GT },
+ { "age", "!=", &datetime, MATCHER_NOT },
+ { "interval", "<", &datetime, MATCHER_LT },
+ { "interval", "<=", &datetime, MATCHER_LE },
+ { "interval", "=", &datetime, MATCHER_EQ },
+ { "interval", ">=", &datetime, MATCHER_GE },
+ { "interval", ">", &datetime, MATCHER_GT },
+ { "interval", "!=", &datetime, MATCHER_NOT },
+ { "backend", "=", &string, MATCHER_EQ },
+ { "backend", "!=", &string, MATCHER_NOT },
+ /* the behavior for other operators on .backend
+ * is currently unspecified */
+ { "last_update", "=", NULL, -1 },
+ { "last_update", "IS", NULL, -1 },
+ { "age", "=", NULL, -1 },
+ { "interval", "=", NULL, -1 },
+ { "backend", "=", NULL, -1 },
+ { "backend", "=~", &string, -1 },
+ };
+
+ size_t i;
+
+ for (i = 0; i < SDB_STATIC_ARRAY_LEN(golden_data); ++i) {
+ sdb_store_matcher_t *check;
+ sdb_store_expr_t *expr;
+ char buf[1024];
+
+ if (sdb_data_format(golden_data[i].value,
+ buf, sizeof(buf), SDB_UNQUOTED) < 0)
+ snprintf(buf, sizeof(buf), "ERR");
+
+ expr = sdb_store_expr_constvalue(golden_data[i].value);
+ fail_unless(expr != NULL || golden_data[i].value == NULL,
+ "sdb_store_expr_constvalue(%s) = NULL; expected: <expr>",
+ buf);
+
+ check = sdb_store_matcher_parse_field_cmp(golden_data[i].field,
+ golden_data[i].op, expr);
+ sdb_object_deref(SDB_OBJ(expr));
+
+ if (golden_data[i].expected == -1) {
+ fail_unless(check == NULL,
+ "sdb_store_matcher_parse_field_cmp(%s, %s, expr{%s}) = %p; "
+ "expected: NULL", golden_data[i].field,
+ golden_data[i].op, buf, check);
+ continue;
+ }
+
+ fail_unless(check != NULL,
+ "sdb_store_matcher_parse_field_cmp(%s, %s, %s) = %p; "
+ "expected: NULL", golden_data[i].field,
+ golden_data[i].op, buf, check);
+ fail_unless(M(check)->type == golden_data[i].expected,
+ "sdb_store_matcher_parse_field_cmp(%s, %s, %s) returned "
+ "matcher of type %d; expected: %d", golden_data[i].field,
+ golden_data[i].op, buf, M(check)->type,
+ golden_data[i].expected);
+
+ sdb_object_deref(SDB_OBJ(check));
+ }
+}
+END_TEST
+
static int
scan_cb(sdb_store_obj_t *obj, void *user_data)
{
int expected;
const char *tostring_re;
} golden_data[] = {
- { "host = 'a'", NULL, 1,
+ { "host = 'a'", NULL, 1,
"OBJ\\[host\\]\\{ NAME\\{ 'a', \\(nil\\) \\} \\}" },
- { "host = 'a'", "host = 'x'", 0, /* filter never matches */
+ { "host = 'a'", "host = 'x'", 0, /* filter never matches */
"OBJ\\[host\\]\\{ NAME\\{ 'a', \\(nil\\) \\} \\}" },
{ "host = 'a'",
- "NOT attribute.x = ''", 1, /* filter always matches */
+ "NOT attribute[x] = ''", 1, /* filter always matches */
"OBJ\\[host\\]\\{ NAME\\{ 'a', \\(nil\\) \\} \\}" },
- { "host =~ 'a|b'", NULL, 2,
+ { "host =~ 'a|b'", NULL, 2,
"OBJ\\[host\\]\\{ NAME\\{ NULL, "PTR_RE" \\} \\}" },
- { "host =~ 'host'", NULL, 0,
+ { "host =~ 'host'", NULL, 0,
"OBJ\\[host\\]\\{ NAME\\{ NULL, "PTR_RE" \\} \\}" },
- { "host =~ '.'", NULL, 3,
+ { "host =~ '.'", NULL, 3,
"OBJ\\[host\\]\\{ NAME\\{ NULL, "PTR_RE" \\} \\}" },
- { "service = 's1'", NULL, 2,
+ { "metric = 'm1'", NULL, 2,
+ "OBJ\\[metric\\]\\{ NAME\\{ 'm1', \\(nil\\) } \\}" },
+ { "metric= 'm1'", "host = 'x'", 0, /* filter never matches */
+ "OBJ\\[metric\\]\\{ NAME\\{ 'm1', \\(nil\\) } \\}" },
+ { "metric = 'm1'",
+ "NOT attribute[x] = ''", 2, /* filter always matches */
+ "OBJ\\[metric\\]\\{ NAME\\{ 'm1', \\(nil\\) } \\}" },
+ { "metric =~ 'm'", NULL, 2,
+ "OBJ\\[metric\\]\\{ NAME\\{ NULL, "PTR_RE" } \\}" },
+ { "metric !~ 'm'", NULL, 1,
+ "\\(NOT, OBJ\\[metric\\]\\{ NAME\\{ NULL, "PTR_RE" } \\}\\)" },
+ { "metric =~ 'x'", NULL, 0,
+ "OBJ\\[metric\\]\\{ NAME\\{ NULL, "PTR_RE" } \\}" },
+ { "service = 's1'", NULL, 2,
"OBJ\\[service\\]\\{ NAME\\{ 's1', \\(nil\\) } \\}" },
- { "service = 's1'", "host = 'x'", 0, /* filter never matches */
+ { "service = 's1'", "host = 'x'", 0, /* filter never matches */
"OBJ\\[service\\]\\{ NAME\\{ 's1', \\(nil\\) } \\}" },
{ "service = 's1'",
- "NOT attribute.x = ''", 2, /* filter always matches */
+ "NOT attribute[x] = ''", 2, /* filter always matches */
"OBJ\\[service\\]\\{ NAME\\{ 's1', \\(nil\\) } \\}" },
- { "service =~ 's'", NULL, 2,
+ { "service =~ 's'", NULL, 2,
"OBJ\\[service\\]\\{ NAME\\{ NULL, "PTR_RE" } \\}" },
- { "service !~ 's'", NULL, 1,
+ { "service !~ 's'", NULL, 1,
"\\(NOT, OBJ\\[service\\]\\{ NAME\\{ NULL, "PTR_RE" } \\}\\)" },
- { "attribute = 'k1'", NULL, 1,
+ { "attribute = 'k1'", NULL, 1,
"OBJ\\[attribute\\]\\{ NAME\\{ 'k1', \\(nil\\) \\} " },
- { "attribute = 'k1'", "host = 'x'", 0, /* filter never matches */
+ { "attribute = 'k1'", "host = 'x'", 0, /* filter never matches */
"OBJ\\[attribute\\]\\{ NAME\\{ 'k1', \\(nil\\) \\} " },
{ "attribute = 'k1'",
- "NOT attribute.x = ''", 1, /* filter always matches */
+ "NOT attribute[x] = ''", 1, /* filter always matches */
"OBJ\\[attribute\\]\\{ NAME\\{ 'k1', \\(nil\\) \\} " },
- { "attribute = 'x'", NULL, 0,
+ { "attribute = 'x'", NULL, 0,
"OBJ\\[attribute\\]\\{ NAME\\{ 'x', \\(nil\\) \\}" },
- { "attribute.k1 = 'v1'", NULL, 1,
+ { "attribute[k1] = 'v1'", NULL, 1,
"ATTR\\[k1\\]\\{ VALUE\\{ 'v1', \\(nil\\) \\} \\}" },
- { "attribute.k1 IS NULL", NULL, 2,
+ { "attribute[k1] IS NULL", NULL, 2,
"\\(IS NULL, ATTR\\[k1\\]\\)" },
- { "attribute.x1 IS NULL", NULL, 3,
+ { "attribute[x1] IS NULL", NULL, 3,
"\\(IS NULL, ATTR\\[x1\\]\\)" },
- { "attribute.k1 IS NOT NULL", NULL, 1,
+ { "attribute[k1] IS NOT NULL", NULL, 1,
"\\(NOT, \\(IS NULL, ATTR\\[k1\\]\\)\\)" },
- { "attribute.x1 IS NOT NULL", NULL, 0,
+ { "attribute[x1] IS NOT NULL", NULL, 0,
"\\(NOT, \\(IS NULL, ATTR\\[x1\\]\\)\\)" },
- { "attribute.k2 < 123", NULL, 0,
+ { "attribute[k2] < 123", NULL, 0,
"ATTR\\[k2\\]\\{ < 123 \\}" },
- { "attribute.k2 <= 123", NULL, 1,
+ { "attribute[k2] <= 123", NULL, 1,
"ATTR\\[k2\\]\\{ <= 123 \\}" },
- { "attribute.k2 >= 123", NULL, 1,
+ { "attribute[k2] >= 123", NULL, 1,
"ATTR\\[k2\\]\\{ >= 123 \\}" },
- { "attribute.k2 > 123", NULL, 0,
+ { "attribute[k2] > 123", NULL, 0,
"ATTR\\[k2\\]\\{ > 123 \\}" },
- { "attribute.k2 = 123", NULL, 1,
+ { "attribute[k2] = 123", NULL, 1,
"ATTR\\[k2\\]\\{ = 123 \\}" },
- { "attribute.k2 != 123", NULL, 2,
+ { "attribute[k2] != 123", NULL, 2,
"\\(NOT, ATTR\\[k2\\]\\{ = 123 \\}\\)" },
- { "attribute.k1 != 'v1'", NULL, 2,
+ { "attribute[k1] != 'v1'", NULL, 2,
"\\(NOT, ATTR\\[k1\\]\\{ VALUE\\{ 'v1', \\(nil\\) \\} \\}\\)" },
- { "attribute.k1 != 'v2'", NULL, 3,
+ { "attribute[k1] != 'v2'", NULL, 3,
"\\(NOT, ATTR\\[k1\\]\\{ VALUE\\{ 'v2', \\(nil\\) \\} \\}\\)" },
{ "attribute != 'x' "
- "AND attribute.y !~ 'x'", NULL, 3,
+ "AND attribute[y] !~ 'x'", NULL, 3,
"\\(AND, "
"\\(NOT, OBJ\\[attribute\\]\\{ NAME\\{ 'x', \\(nil\\) \\} \\}\\), "
"\\(NOT, ATTR\\[y\\]\\{ VALUE\\{ NULL, "PTR_RE" \\} \\}\\)\\)" },
tcase_add_test(tc, test_obj_cond);
tcase_add_test(tc, test_store_match_op);
tcase_add_test(tc, test_parse_cmp);
+ tcase_add_test(tc, test_parse_field_cmp);
tcase_add_test(tc, test_scan);
suite_add_tcase(s, tc);