index 4466b153c93b557285a908bd2872044f5133a548..b4c6015b7bfb0dcfe2d338eb05af51555491efca 100644 (file)
#include "parser/parser.h"
#include "testutils.h"
-#include <assert.h>
-
#include <check.h>
#include <string.h>
};
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,
};
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,
sdb_data_t d = { SDB_TYPE_STRING, { .string = "a" } };
sdb_store_expr_t *e = sdb_store_expr_constvalue(&d);
- sdb_store_matcher_t *always = sdb_store_isnnull_matcher(e);
sdb_store_matcher_t *never = sdb_store_isnull_matcher(e);
+ sdb_store_matcher_t *always = sdb_store_inv_matcher(never);
struct {
const char *op;
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 },
{ "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 },