X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=t%2Funit%2Fcore%2Fstore_lookup_test.c;h=b4c6015b7bfb0dcfe2d338eb05af51555491efca;hb=9097c9c3259b2943dc0088b250ec871172025303;hp=14d2209a933e0e398a620532a419fae0c27e0e19;hpb=d8d03b18f0e0a4c39e2adec3cc2cd093d52c1f93;p=sysdb.git diff --git a/t/unit/core/store_lookup_test.c b/t/unit/core/store_lookup_test.c index 14d2209..b4c6015 100644 --- a/t/unit/core/store_lookup_test.c +++ b/t/unit/core/store_lookup_test.c @@ -34,8 +34,6 @@ #include "parser/parser.h" #include "testutils.h" -#include - #include #include @@ -265,7 +263,7 @@ START_TEST(test_cmp_attr) }; const char *op_str[] = { "<", "<=", "=", ">=", ">" }; - assert(SDB_STATIC_ARRAY_LEN(tests) == SDB_STATIC_ARRAY_LEN(op_str)); + ck_assert(SDB_STATIC_ARRAY_LEN(tests) == SDB_STATIC_ARRAY_LEN(op_str)); host = sdb_store_get_host("a"); fail_unless(host != NULL, @@ -373,7 +371,7 @@ START_TEST(test_cmp_obj) }; char *op_str[] = { "<", "<=", "=", ">=", ">" }; - assert(SDB_STATIC_ARRAY_LEN(tests) == SDB_STATIC_ARRAY_LEN(op_str)); + ck_assert(SDB_STATIC_ARRAY_LEN(tests) == SDB_STATIC_ARRAY_LEN(op_str)); host = sdb_store_get_host(cmp_obj_data[_i].host); fail_unless(host != NULL, @@ -577,6 +575,9 @@ struct { NULL, 1 }, { "host.attribute['x1'] IS NULL", NULL, 3 }, + /* not a boolean so neither TRUE nor FALSE: */ + { "attribute['k1'] IS TRUE", NULL, 0 }, + { "attribute['k1'] IS FALSE", NULL, 0 }, { "attribute['k1'] = 'v1'", NULL, 1 }, { "attribute['k1'] = 'v1'", "name != 'k1'", 0 }, @@ -592,8 +593,13 @@ struct { { "attribute['x1'] !~ 'v'", NULL, 0 }, { "attribute['k1'] IS NULL", NULL, 1 }, { "attribute['x1'] IS NULL", NULL, 3 }, + { "attribute['k1'] IS TRUE", NULL, 0 }, + { "attribute['x1'] IS TRUE", NULL, 0 }, + { "attribute['k1'] IS FALSE", NULL, 0 }, + { "attribute['x1'] IS FALSE", NULL, 0 }, { "attribute['k1'] IS NOT NULL", NULL, 2 }, { "attribute['x1'] IS NOT NULL", NULL, 0 }, + { "attribute['x1'] IS NOT TRUE", NULL, 3 }, { "attribute['k2'] < 123", NULL, 0 }, { "attribute['k2'] <= 123", NULL, 1 }, { "attribute['k2'] >= 123", NULL, 1 },