change(tests/check_slug): avoided compiling warning.
This commit is contained in:
parent
3f410ef5d4
commit
0485554d44
1 changed files with 8 additions and 8 deletions
|
@ -52,7 +52,7 @@ END_TEST
|
||||||
|
|
||||||
START_TEST (test_r3_slug_find_pattern)
|
START_TEST (test_r3_slug_find_pattern)
|
||||||
{
|
{
|
||||||
int len;
|
unsigned int len;
|
||||||
char *test_str = "{name:\\s+}";
|
char *test_str = "{name:\\s+}";
|
||||||
const char * namerex = r3_slug_find_pattern(test_str, strlen(test_str), &len);
|
const char * namerex = r3_slug_find_pattern(test_str, strlen(test_str), &len);
|
||||||
ck_assert( strncmp(namerex, "\\s+", len) == 0 );
|
ck_assert( strncmp(namerex, "\\s+", len) == 0 );
|
||||||
|
@ -61,7 +61,7 @@ END_TEST
|
||||||
|
|
||||||
START_TEST (test_r3_slug_find_name)
|
START_TEST (test_r3_slug_find_name)
|
||||||
{
|
{
|
||||||
int len;
|
unsigned int len;
|
||||||
char *test_str = "{name:\\s+}";
|
char *test_str = "{name:\\s+}";
|
||||||
const char * namerex = r3_slug_find_name(test_str, strlen(test_str), &len);
|
const char * namerex = r3_slug_find_name(test_str, strlen(test_str), &len);
|
||||||
ck_assert( strncmp(namerex, "name", len) == 0 );
|
ck_assert( strncmp(namerex, "name", len) == 0 );
|
||||||
|
@ -70,7 +70,7 @@ END_TEST
|
||||||
|
|
||||||
START_TEST (test_r3_slug_find_name_without_pattern)
|
START_TEST (test_r3_slug_find_name_without_pattern)
|
||||||
{
|
{
|
||||||
int len;
|
unsigned int len;
|
||||||
char *test_str = "{name}";
|
char *test_str = "{name}";
|
||||||
const char * namerex = r3_slug_find_name(test_str, strlen(test_str), &len);
|
const char * namerex = r3_slug_find_name(test_str, strlen(test_str), &len);
|
||||||
ck_assert( strncmp(namerex, "name", len) == 0 );
|
ck_assert( strncmp(namerex, "name", len) == 0 );
|
||||||
|
@ -79,7 +79,7 @@ END_TEST
|
||||||
|
|
||||||
START_TEST (test_r3_slug_find_name_with_multiple_slug)
|
START_TEST (test_r3_slug_find_name_with_multiple_slug)
|
||||||
{
|
{
|
||||||
int len;
|
unsigned int len;
|
||||||
char *test_str = "{name}/{name2}";
|
char *test_str = "{name}/{name2}";
|
||||||
const char * namerex = r3_slug_find_name(test_str, strlen(test_str), &len);
|
const char * namerex = r3_slug_find_name(test_str, strlen(test_str), &len);
|
||||||
ck_assert( strncmp(namerex, "name", len) == 0 );
|
ck_assert( strncmp(namerex, "name", len) == 0 );
|
||||||
|
@ -88,7 +88,7 @@ END_TEST
|
||||||
|
|
||||||
START_TEST (test_r3_slug_find_placeholder)
|
START_TEST (test_r3_slug_find_placeholder)
|
||||||
{
|
{
|
||||||
int slug_len = 0;
|
unsigned int slug_len = 0;
|
||||||
const char * slug;
|
const char * slug;
|
||||||
char *test_str = "/user/{name:\\s+}/to/{id}";
|
char *test_str = "/user/{name:\\s+}/to/{id}";
|
||||||
slug = r3_slug_find_placeholder(test_str, strlen(test_str), &slug_len);
|
slug = r3_slug_find_placeholder(test_str, strlen(test_str), &slug_len);
|
||||||
|
@ -118,7 +118,7 @@ START_TEST (test_incomplete_slug)
|
||||||
char * pattern = "/user/{name:\\d{3}}/to/{id";
|
char * pattern = "/user/{name:\\d{3}}/to/{id";
|
||||||
cnt = r3_slug_count(pattern, strlen(pattern), &errstr);
|
cnt = r3_slug_count(pattern, strlen(pattern), &errstr);
|
||||||
ck_assert_int_eq(cnt, -1);
|
ck_assert_int_eq(cnt, -1);
|
||||||
ck_assert(errstr);
|
ck_assert(errstr != NULL);
|
||||||
printf("%s\n",errstr);
|
printf("%s\n",errstr);
|
||||||
free(errstr);
|
free(errstr);
|
||||||
}
|
}
|
||||||
|
@ -190,7 +190,7 @@ END_TEST
|
||||||
|
|
||||||
START_TEST (test_r3_slug_find_placeholder_with_broken_slug)
|
START_TEST (test_r3_slug_find_placeholder_with_broken_slug)
|
||||||
{
|
{
|
||||||
int slug_len = 0;
|
unsigned int slug_len = 0;
|
||||||
char *sl_test = "/user/{name:\\s+/to/{id";
|
char *sl_test = "/user/{name:\\s+/to/{id";
|
||||||
const char * slug = r3_slug_find_placeholder(sl_test, strlen(sl_test), &slug_len);
|
const char * slug = r3_slug_find_placeholder(sl_test, strlen(sl_test), &slug_len);
|
||||||
ck_assert(slug == 0);
|
ck_assert(slug == 0);
|
||||||
|
|
Loading…
Reference in a new issue