convert a checked fixture into an unchecked fixture,

it is sufficient if that setup code is run once, this speeds up the tests.
fix some helgrind warnings
(the phishcheck struct is going to be freed anyway, so writing
something to it doesn't help anyway)

git-svn: trunk@4180
0.95
Török Edvin 17 years ago
parent e9e40c70bc
commit 3baee5029c
  1. 1
      libclamav/phish_domaincheck_db.c
  2. 2
      libclamav/phishcheck.c
  3. 5
      libclamav/regex_list.c
  4. 5
      unit_tests/check_regex.c

@ -74,7 +74,6 @@ void domainlist_done(struct cl_engine* engine)
if(engine && engine->domainlist_matcher) {
regex_list_done(engine->domainlist_matcher);
free(engine->domainlist_matcher);
engine->domainlist_matcher = NULL;
}
}

@ -895,14 +895,12 @@ void phishing_done(struct cl_engine* engine)
cli_dbgmsg("Cleaning up phishcheck\n");
if(pchk && !pchk->is_disabled) {
free_regex(&pchk->preg_numeric);
pchk->is_disabled = 1;
}
whitelist_done(engine);
domainlist_done(engine);
if(pchk) {
cli_dbgmsg("Freeing phishcheck struct\n");
free(pchk);
engine->phishcheck = NULL;
}
cli_dbgmsg("Phishcheck cleaned up\n");
}

@ -587,11 +587,6 @@ void regex_list_done(struct regex_matcher* matcher)
}
hashtab_free(&matcher->suffix_hash);
cli_bm_free(&matcher->md5_hashes);
matcher->list_built=0;
matcher->list_loaded=0;
}
if(matcher->list_inited) {
matcher->list_inited=0;
}
}

@ -332,7 +332,6 @@ static void psetup2(void)
static void pteardown(void)
{
if(engine) {
phishing_done(engine);
cl_free(engine);
}
engine = NULL;
@ -453,7 +452,7 @@ Suite *test_regex_suite(void)
#endif
tc_phish = tcase_create("phishingScan");
suite_add_tcase(s, tc_phish);
tcase_add_checked_fixture(tc_phish, psetup, pteardown);
tcase_add_unchecked_fixture(tc_phish, psetup, pteardown);
#ifdef CHECK_HAVE_LOOPS
tcase_add_loop_test(tc_phish, phishingScan_test, 0, sizeof(rtests)/sizeof(rtests[0]));
#endif
@ -462,7 +461,7 @@ Suite *test_regex_suite(void)
tc_phish2 = tcase_create("phishingScan with 2 dbs");
suite_add_tcase(s, tc_phish2);
tcase_add_checked_fixture(tc_phish2, psetup2, pteardown);
tcase_add_unchecked_fixture(tc_phish2, psetup2, pteardown);
#ifdef CHECK_HAVE_LOOPS
tcase_add_loop_test(tc_phish2, phishingScan_test, 0, sizeof(rtests)/sizeof(rtests[0]));
#endif

Loading…
Cancel
Save