tests more consistent
[protos/libecoli.git] / lib / ecoli_node_re.c
index 5bcc407..ea7254b 100644 (file)
@@ -40,6 +40,8 @@
 #include <ecoli_completed.h>
 #include <ecoli_node_re.h>
 
+EC_LOG_TYPE_REGISTER(node_re);
+
 struct ec_node_re {
        struct ec_node gen;
        char *re_str;
@@ -69,12 +71,6 @@ ec_node_re_parse(const struct ec_node *gen_node,
        return 1;
 }
 
-static size_t ec_node_re_get_max_parse_len(const struct ec_node *gen_node)
-{
-       (void)gen_node;
-       return 1;
-}
-
 static void ec_node_re_free_priv(struct ec_node *gen_node)
 {
        struct ec_node_re *node = (struct ec_node_re *)gen_node;
@@ -87,7 +83,6 @@ static struct ec_node_type ec_node_re_type = {
        .name = "re",
        .parse = ec_node_re_parse,
        .complete = ec_node_default_complete,
-       .get_max_parse_len = ec_node_re_get_max_parse_len,
        .size = sizeof(struct ec_node_re),
        .free_priv = ec_node_re_free_priv,
 };
@@ -142,22 +137,22 @@ fail:
 static int ec_node_re_testcase(void)
 {
        struct ec_node *node;
-       int ret = 0;
+       int testres = 0;
 
-       node = ec_node_re(NULL, "fo+|bar");
+       node = ec_node_re(EC_NO_ID, "fo+|bar");
        if (node == NULL) {
-               ec_log(EC_LOG_ERR, "cannot create node\n");
+               EC_LOG(EC_LOG_ERR, "cannot create node\n");
                return -1;
        }
-       ret |= EC_TEST_CHECK_PARSE(node, 1, "foo");
-       ret |= EC_TEST_CHECK_PARSE(node, 1, "foo", "bar");
-       ret |= EC_TEST_CHECK_PARSE(node, 1, "bar");
-       ret |= EC_TEST_CHECK_PARSE(node, -1, "foobar");
-       ret |= EC_TEST_CHECK_PARSE(node, -1, " foo");
-       ret |= EC_TEST_CHECK_PARSE(node, -1, "");
+       testres |= EC_TEST_CHECK_PARSE(node, 1, "foo");
+       testres |= EC_TEST_CHECK_PARSE(node, 1, "foo", "bar");
+       testres |= EC_TEST_CHECK_PARSE(node, 1, "bar");
+       testres |= EC_TEST_CHECK_PARSE(node, -1, "foobar");
+       testres |= EC_TEST_CHECK_PARSE(node, -1, " foo");
+       testres |= EC_TEST_CHECK_PARSE(node, -1, "");
        ec_node_free(node);
 
-       return ret;
+       return testres;
 }
 /* LCOV_EXCL_STOP */