Fix unit tests when run as root (bb #1635).

0.96
Török Edvin 16 years ago
parent 4cda88ccac
commit 92740b7383
  1. 4
      ChangeLog
  2. 4
      unit_tests/check_clamd.c

@ -1,3 +1,7 @@
Wed Jul 15 16:25:00 EEST 2009 (edwin)
-------------------------------------
* unit_tests/check_clamd.c: fix unit tests when run as root (bb #1635).
Wed Jul 15 12:50:50 CEST 2009 (acab) Wed Jul 15 12:50:50 CEST 2009 (acab)
------------------------------------ ------------------------------------
* libclamav/ishield.c: fix distcheck, patch from edwin * libclamav/ishield.c: fix distcheck, patch from edwin

@ -740,6 +740,8 @@ static void test_idsession_commands(int split, int instream)
/* test all commands that must be accepted inside an IDSESSION */ /* test all commands that must be accepted inside an IDSESSION */
for (i=0;i < sizeof(basic_tests)/sizeof(basic_tests[0]); i++) { for (i=0;i < sizeof(basic_tests)/sizeof(basic_tests[0]); i++) {
const struct basic_test *test = &basic_tests[i]; const struct basic_test *test = &basic_tests[i];
if (test->skiproot && isroot)
continue;
if (test->ids == IDS_OK) { if (test->ids == IDS_OK) {
fail_unless(p+strlen(test->command)+2 < buf+sizeof(buf), "Buffer too small"); fail_unless(p+strlen(test->command)+2 < buf+sizeof(buf), "Buffer too small");
*p++ = 'z'; *p++ = 'z';
@ -792,6 +794,8 @@ static void test_idsession_commands(int split, int instream)
p = recvdata; p = recvdata;
for (i=0;i < sizeof(basic_tests)/sizeof(basic_tests[0]); i++) { for (i=0;i < sizeof(basic_tests)/sizeof(basic_tests[0]); i++) {
const struct basic_test *test = &basic_tests[i]; const struct basic_test *test = &basic_tests[i];
if (test->skiproot && isroot)
continue;
if (test->ids == IDS_OK) { if (test->ids == IDS_OK) {
unsigned id; unsigned id;
char *q = strchr(p, ':'); char *q = strchr(p, ':');

Loading…
Cancel
Save