Skip to content

Commit

Permalink
Merge pull request #1450 from val-ms/issue-1447-dead-code
Browse files Browse the repository at this point in the history
Tests: remove dead code
  • Loading branch information
val-ms authored Feb 21, 2025
2 parents 88e546b + 4b5130d commit 1f214b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
10 changes: 3 additions & 7 deletions unit_tests/check_bytecode.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,17 +501,13 @@ END_TEST

static void runload(const char *dbname, struct cl_engine *engine, unsigned signoexp)
{
const char *srcdir = getenv("srcdir");
char *str;
unsigned signo = 0;
int rc;
if (!srcdir) {
/* when run from automake srcdir is set, but if run manually then not */
srcdir = SRCDIR;
}
str = malloc(strlen(srcdir) + 1 + strlen(dbname) + 1);

str = malloc(strlen(SRCDIR) + 1 + strlen(dbname) + 1);
ck_assert_msg(!!str, "malloc");
sprintf(str, "%s" PATHSEP "%s", srcdir, dbname);
sprintf(str, "%s" PATHSEP "%s", SRCDIR, dbname);

rc = cl_load(str, engine, &signo, CL_DB_STDOPT);
ck_assert_msg(rc == CL_SUCCESS, "failed to load %s: %s\n",
Expand Down
15 changes: 2 additions & 13 deletions unit_tests/check_clamav.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,11 +538,6 @@ static unsigned skip_files(void)
unsigned skipped = 0;

/* skip .rar files if unrar is disabled */
const char *s = getenv("unrar_disabled");
if (s && !strcmp(s, "1")) {
skipped += 2;
}

#if HAVE_UNRAR
#else
skipped += 2;
Expand Down Expand Up @@ -1899,17 +1894,11 @@ void errmsg_expected(void)
int open_testfile(const char *name, int flags)
{
int fd;
const char *srcdir = getenv("srcdir");
char *str;

if (!srcdir) {
/* when run from automake srcdir is set, but if run manually then not */
srcdir = SRCDIR;
}

str = malloc(strlen(name) + strlen(srcdir) + 2);
str = malloc(strlen(name) + strlen(SRCDIR) + 2);
ck_assert_msg(!!str, "malloc");
sprintf(str, "%s" PATHSEP "%s", srcdir, name);
sprintf(str, "%s" PATHSEP "%s", SRCDIR, name);

fd = open(str, flags);
ck_assert_msg(fd >= 0, "open() failed: %s", str);
Expand Down

0 comments on commit 1f214b2

Please # to comment.