From: Joel Rosdahl Date: Mon, 30 Aug 2010 17:56:03 +0000 (+0200) Subject: Allow const string parameters to CHECK_STR_EQ() X-Git-Tag: v3.1~33 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5d8643612d11f1ade5efe016c6ac1da1eea1919e;p=thirdparty%2Fccache.git Allow const string parameters to CHECK_STR_EQ() --- diff --git a/test/framework.c b/test/framework.c index 0398831ee..53a8d60d2 100644 --- a/test/framework.c +++ b/test/framework.c @@ -204,7 +204,8 @@ cct_check_uns_eq(const char *file, int line, const char *expression, int cct_check_str_eq(const char *file, int line, const char *expression, - char *expected, char *actual, int free1, int free2) + const char *expected, const char *actual, int free1, + int free2) { int result; @@ -221,10 +222,10 @@ cct_check_str_eq(const char *file, int line, const char *expression, } if (free1) { - free(expected); + free((char *)expected); } if (free2) { - free(actual); + free((char *)actual); } return result; } diff --git a/test/framework.h b/test/framework.h index ab3e6076e..bdfa9c802 100644 --- a/test/framework.h +++ b/test/framework.h @@ -135,7 +135,8 @@ int cct_check_int_eq(const char *file, int line, const char *expression, int cct_check_uns_eq(const char *file, int line, const char *expression, unsigned expected, unsigned actual); int cct_check_str_eq(const char *file, int line, const char *expression, - char *expected, char *actual, int free1, int free2); + const char *expected, const char *actual, int free1, + int free2); int cct_check_args_eq(const char *file, int line, const char *expression, struct args *expected, struct args *actual, int free1, int free2);