Commit 38f2412e authored by Pekka Pessi's avatar Pekka Pessi

su tests: removed VC warnings from test_su.c, torture_su_alloc.c,...

su tests: removed VC warnings from test_su.c, torture_su_alloc.c, torture_su_bm.c, torture_su_time.c.

Patch from Michael Jerris.

darcs-hash:20061122173712-65a35-9125e1ba2192103096c17b73fe4dd23b27da5cf7.gz
parent c42dd35d
...@@ -481,7 +481,9 @@ int main(int argc, char *argv[]) ...@@ -481,7 +481,9 @@ int main(int argc, char *argv[])
su_clone_r ping = SU_CLONE_R_INIT, pong = SU_CLONE_R_INIT; su_clone_r ping = SU_CLONE_R_INIT, pong = SU_CLONE_R_INIT;
su_msg_r start_msg = SU_MSG_R_INIT; su_msg_r start_msg = SU_MSG_R_INIT;
su_timer_t *t; su_timer_t *t;
#if HAVE_ALARM
int opt_alarm = 1; int opt_alarm = 1;
#endif
struct pinger struct pinger
pinger = { PINGER, "ping", 1 }, pinger = { PINGER, "ping", 1 },
......
...@@ -613,7 +613,16 @@ static int test_auto(void) ...@@ -613,7 +613,16 @@ static int test_auto(void)
for (i = 1; i < 8192; i++) { for (i = 1; i < 8192; i++) {
TEST_1(b = su_realloc(tmphome, b, i)); TEST_1(b = su_realloc(tmphome, b, i));
b[i - 1] = (char)0xaa; b[i - 1] = '\125';
}
for (i = 1; i < 8192; i++) {
TEST(b[i - 1], '\125');
}
for (i = 1; i < 8192; i++) {
TEST_1(b = su_realloc(tmphome, b, i));
b[i - 1] = '\125';
if ((i % 32) == 0) if ((i % 32) == 0)
TEST_1(b = su_realloc(tmphome, b, 1)); TEST_1(b = su_realloc(tmphome, b, 1));
...@@ -622,9 +631,9 @@ static int test_auto(void) ...@@ -622,9 +631,9 @@ static int test_auto(void)
su_home_get_stats(tmphome, 0, hs, sizeof *hs); su_home_get_stats(tmphome, 0, hs, sizeof *hs);
TEST64(hs->hs_allocs.hsa_preload + hs->hs_allocs.hsa_number, TEST64(hs->hs_allocs.hsa_preload + hs->hs_allocs.hsa_number,
8191 + 8191 / 32); 8191 + 8191 + 8191 / 32);
TEST64(hs->hs_frees.hsf_preload + hs->hs_frees.hsf_number, TEST64(hs->hs_frees.hsf_preload + hs->hs_frees.hsf_number,
8191 + 8191 / 32 - 1); 8191 + 8191 + 8191 / 32 - 1);
/* /*
This test depends on macro SU_HOME_AUTO_SIZE() calculating This test depends on macro SU_HOME_AUTO_SIZE() calculating
offsetof(su_block_t, sub_nodes[7]) correctly with offsetof(su_block_t, sub_nodes[7]) correctly with
......
...@@ -176,7 +176,7 @@ char const Needle[] = ...@@ -176,7 +176,7 @@ char const Needle[] =
"ULLAMCORPER PRETIUM LOREM. VESTIBULUM ANTE IPSUM PRIMIS IN FAUCIBUS ORCI " "ULLAMCORPER PRETIUM LOREM. VESTIBULUM ANTE IPSUM PRIMIS IN FAUCIBUS ORCI "
"LUCTUS ET ULTRICES POSUERE CUBILIA CURAE;\n"; "LUCTUS ET ULTRICES POSUERE CUBILIA CURAE;\n";
int nlen = strlen(needle); size_t nlen = strlen(needle);
bm_fwd_table_t *fwd; bm_fwd_table_t *fwd;
......
...@@ -149,7 +149,7 @@ int test2(int flags) ...@@ -149,7 +149,7 @@ int test2(int flags)
const uint64_t granularity = 10000000U; const uint64_t granularity = 10000000U;
const uint64_t ntp_epoch = const uint64_t ntp_epoch =
(uint64_t)(141427) * (24 * 60 * 60L) * granularity; (uint64_t)(141427) * (24 * 60 * 60L) * granularity;
int i; isize_t i;
BEGIN(); BEGIN();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment