aboutsummaryrefslogtreecommitdiff
path: root/tests/torture.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2015-09-07 10:39:51 +0200
committerAndreas Schneider <asn@cryptomilk.org>2015-09-07 10:40:12 +0200
commit82a80b205bb5159c3e8da635c47882a14c17120b (patch)
tree9e00b3d674276c9a227f167b4b4712db912a5b96 /tests/torture.c
parent5b586fdfecbe12f3f8e69099d809ca96c7cb978e (diff)
downloadlibssh-82a80b205bb5159c3e8da635c47882a14c17120b.tar.gz
libssh-82a80b205bb5159c3e8da635c47882a14c17120b.tar.xz
libssh-82a80b205bb5159c3e8da635c47882a14c17120b.zip
tests: Migrate to new cmocka API
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'tests/torture.c')
-rw-r--r--tests/torture.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/tests/torture.c b/tests/torture.c
index b0c7a59f..ea4bc839 100644
--- a/tests/torture.c
+++ b/tests/torture.c
@@ -651,29 +651,22 @@ int torture_libssh_verbosity(void){
return verbosity;
}
-void _torture_filter_tests(UnitTest *tests, size_t ntests){
+void _torture_filter_tests(struct CMUnitTest *tests, size_t ntests)
+{
size_t i,j;
- const char *name, *last_name=NULL;
+ const char *name;
if (pattern == NULL){
return;
}
for (i=0; i < ntests; ++i){
- if(tests[i].function_type == UNIT_TEST_FUNCTION_TYPE_SETUP){
- /* match on the next test name */
- name = tests[i+1].name;
- } else if (tests[i].function_type == UNIT_TEST_FUNCTION_TYPE_TEARDOWN){
- /* match on the previous test name */
- name = last_name;
- } else {
- name = last_name = tests[i].name;
- }
+ name = tests[i].name;
/*printf("match(%s,%s)\n",name,pattern);*/
if (!match_pattern(name, pattern)){
for (j = i; j < ntests-1;++j){
tests[j]=tests[j+1];
}
tests[ntests-1].name = NULL;
- tests[ntests-1].function = NULL;
+ tests[ntests-1].test_func = NULL;
ntests--;
--i;
}