Commit 2f808c37 authored by Pekka Pessi's avatar Pekka Pessi

Fixed win32-compatibility problems in test programs.

darcs-hash:20060215142225-65a35-c83d550e794fd23fa4a822d15bb54b597be36602.gz
parent fdf543e5
......@@ -67,6 +67,7 @@ typedef struct agent_t agent_t;
#include <limits.h>
#include <stdio.h>
#include <assert.h>
#include <unistd.h>
extern su_log_t nta_log[];
extern su_log_t tport_log[];
......
......@@ -549,7 +549,7 @@ static int test_auto(void)
for (i = 1; i < 8192; i++) {
TEST_1(b = su_realloc(tmphome, b, i));
b[i - 1] = 0xaa;
b[i - 1] = (char)0xaa;
if ((i % 32) == 0)
TEST_1(b = su_realloc(tmphome, b, 1));
......
......@@ -136,8 +136,17 @@ int wakeup(root_test_t *rt,
test_ep_t *ep)
{
char buffer[64];
int n, error;
su_wait_events(w, ep->s);
TEST_1(recv(ep->s, buffer, sizeof(buffer), 0) > 0);
n = recv(ep->s, buffer, sizeof(buffer), 0);
error = su_errno();
if (n < 0)
fprintf(stderr, "%s: %s\n", "recv", su_strerror(error));
TEST_1(n > 0);
rt->rt_received = ep->i;
......@@ -238,10 +247,12 @@ static int register_test(root_test_t *rt)
}
for (i = 0; i < 5; i++) {
rt->rt_ep[i]->registered =
su_root_register(rt->rt_root, rt->rt_ep[i]->wait,
wakeups[i], rt->rt_ep[i], 1);
TEST_1(rt->rt_ep[i]->registered > 0);
test_ep_t *ep = rt->rt_ep[i];
TEST_1(su_wait_create(ep->wait, ep->s, SU_WAIT_IN|SU_WAIT_ERR) != -1);
ep->registered =
su_root_register(rt->rt_root, ep->wait,
wakeups[i], ep, 1);
TEST_1(ep->registered > 0);
}
for (i = 0; i < 5; i++) {
......
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