From 394621956d2598c4ae398049796997df734bea93 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Tue, 7 Jun 2016 21:51:28 +0200 Subject: [PATCH] missing include, gcc fix --- src/util/parser.test.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/util/parser.test.c b/src/util/parser.test.c index 3c60fee54..da0d8dacb 100644 --- a/src/util/parser.test.c +++ b/src/util/parser.test.c @@ -1,6 +1,7 @@ #include #include "parser.h" +#include #include static void test_parse_token(CuTest *tc) { @@ -13,7 +14,7 @@ static void test_parse_token(CuTest *tc) { CuAssertPtrEquals(tc, (void *)(orig+5), (void *)str); CuAssertStrEquals(tc, "SHORT", tok); tok = parse_token(&str, lbuf, sizeof(lbuf)); - CuAssertPtrEquals(tc, (void *)(orig + 11), (void *)str); + CuAssertPtrEquals(tc, (void *)(orig + strlen(orig)), (void *)str); CuAssertStrEquals(tc, "TOKEN", tok); tok = parse_token(&str, lbuf, sizeof(lbuf)); CuAssertPtrEquals(tc, NULL, (void *)tok); @@ -26,7 +27,7 @@ static void test_parse_token_limit(CuTest *tc) { orig = str = "LONG_TOKEN"; tok = parse_token(&str, lbuf, sizeof(lbuf)); - CuAssertPtrEquals(tc, (void *)(orig + 10), (void *)str); + CuAssertPtrEquals(tc, (void *)(orig + strlen(orig)), (void *)str); CuAssertStrEquals(tc, tok, "LONG_TO"); tok = parse_token(&str, lbuf, sizeof(lbuf)); CuAssertPtrEquals(tc, NULL, (void *)tok);