[commit] r11935 - freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua
Author: mikej Date: Thu Feb 12 15:01:58 2009 New Revision: 11935 Log: Tue Feb 10 07:36:35 CST 2009 Pekka Pessi <first.last@nokia.com> * check_nua: use tcase_add_test() and s2_select_tests() from <s2check.h> Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/check_nua.c freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/check_nua.h Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/check_nua.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/check_nua.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/check_nua.c Thu Feb 12 15:01:58 2009 @@ -45,36 +45,6 @@ #include "test_s2.h" -static char const * const default_patterns[] = { "*", NULL }; -static char const * const *test_patterns = default_patterns; - -void check_nua_tcase_add_test(TCase *tc, TFun tf, char const *name) -{ - char const * const *patterns; - -#if HAVE_FNMATCH_H - for (patterns = test_patterns; *patterns; patterns++) { - if (!fnmatch(*patterns, name, 0)) { - if (strcmp(*patterns, "*")) { - printf("%s: running\n", name); - } - _tcase_add_test(tc, tf, name, 0, 0, 1); - return; - } - } -#else - for (patterns = test_patterns; *patterns; patterns++) { - if (!strcmp(*patterns, name) || !strcmp(*patterns, "*")) { - if (strcmp(*patterns, "*")) { - printf("%s: running\n", name); - } - _tcase_add_test(tc, tf, name, 0, 0, 1); - return; - } - } -#endif -} - int main(int argc, char *argv[]) { int failed = 0; @@ -86,28 +56,7 @@ if (getenv("CHECK_NUA_VERBOSE")) s2_start_stop = strtoul(getenv("CHECK_NUA_VERBOSE"), NULL, 10); - if (getenv("CHECK_NUA_CASES")) { - size_t i; - char *s, **patterns; - char *cases = strdup(getenv("CHECK_NUA_CASES")); - - /* Count commas */ - for (i = 2, s = cases; (s = strchr(s, ',')); s++, i++); - - patterns = calloc(i, sizeof *patterns); - - /* Split by commas */ - for (i = 0, s = cases;; i++) { - patterns[i] = s; - if (s == NULL) - break; - s = strchr(s, ','); - if (s) - *s++ = '\0'; - } - - test_patterns = (char const * const *)patterns; - } + s2_select_tests(getenv("CHECK_NUA_CASES")); check_register_cases(suite); check_session_cases(suite); Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/check_nua.h ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/check_nua.h (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/check_nua.h Thu Feb 12 15:01:58 2009 @@ -1,12 +1,6 @@ #ifndef CHECK_NUA_H -#include <check.h> - -#undef tcase_add_test -#define tcase_add_test(tc, tf) \ - check_nua_tcase_add_test(tc, tf, "" #tf "") - -void check_nua_tcase_add_test(TCase *, TFun, char const *name); +#include <s2check.h> void check_session_cases(Suite *suite); void check_register_cases(Suite *suite);
participants (1)
-
FreeSWITCH SVN