|
|
|
@ -388,6 +388,20 @@ static const int expected_testfiles = 48; |
|
|
|
|
static const int expected_testfiles = 46; |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
static unsigned skip_unrar_files(void) |
|
|
|
|
{ |
|
|
|
|
const char *s = getenv("unrar_disabled"); |
|
|
|
|
|
|
|
|
|
if (!s) |
|
|
|
|
return 0; |
|
|
|
|
|
|
|
|
|
if (strcmp(s, "1")) |
|
|
|
|
return 0; |
|
|
|
|
|
|
|
|
|
/* number of .rar files we skipp */ |
|
|
|
|
return 2; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void init_testfiles(void) |
|
|
|
|
{ |
|
|
|
|
struct dirent *dirent; |
|
|
|
@ -403,7 +417,11 @@ static void init_testfiles(void) |
|
|
|
|
while ((dirent = readdir(d))) { |
|
|
|
|
if (strncmp(dirent->d_name, "clam", 4)) |
|
|
|
|
continue; |
|
|
|
|
i++; |
|
|
|
|
if (strstr(dirent->d_name, ".rar") && skip_unrar_files()) { |
|
|
|
|
cli_dbgmsg("skipping (no unrar) %s\n", dirent->d_name); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
i++; |
|
|
|
|
testfiles = cli_realloc(testfiles, i*sizeof(*testfiles)); |
|
|
|
|
fail_unless(!!testfiles, "cli_realloc"); |
|
|
|
|
testfiles[i-1] = strdup(dirent->d_name); |
|
|
|
@ -411,6 +429,7 @@ static void init_testfiles(void) |
|
|
|
|
testfiles_n = i; |
|
|
|
|
if (get_fpu_endian() == FPU_ENDIAN_UNKNOWN) |
|
|
|
|
expect--; |
|
|
|
|
expect -= skip_unrar_files(); |
|
|
|
|
fail_unless_fmt(testfiles_n == expect, "testfiles: %d != %d", testfiles_n, expect); |
|
|
|
|
|
|
|
|
|
closedir(d); |
|
|
|
@ -626,6 +645,7 @@ static Suite *test_cl_suite(void) |
|
|
|
|
#ifdef CHECK_HAVE_LOOPS |
|
|
|
|
if (get_fpu_endian() == FPU_ENDIAN_UNKNOWN) |
|
|
|
|
expect--; |
|
|
|
|
expect -= skip_unrar_files(); |
|
|
|
|
tcase_add_loop_test(tc_cl_scan, test_cl_scandesc, 0, expect); |
|
|
|
|
tcase_add_loop_test(tc_cl_scan, test_cl_scandesc_allscan, 0, expect); |
|
|
|
|
tcase_add_loop_test(tc_cl_scan, test_cl_scanfile, 0, expect); |
|
|
|
|