1
0
mirror of https://github.com/libuv/libuv synced 2025-03-28 21:13:16 +00:00

Unix: fix build for timer test

This commit is contained in:
Ryan Dahl 2011-04-15 11:20:59 -07:00
parent 84ebdf8429
commit c8bdf15f5d
5 changed files with 14 additions and 10 deletions

View File

@ -502,6 +502,11 @@ int oio_write2(oio_req* req, const char* msg) {
}
int oio_timeout(oio_req *req, int64_t timeout) {
return -1;
}
int oio_read(oio_req *req, oio_buf* bufs, int bufcnt) {
oio_handle* handle = req->handle;
ssize_t nread = -1;

View File

@ -1,7 +1,7 @@
TEST_DECLARE (echo_server)
TEST_DECLARE (ping_pong)
TEST_DECLARE (close_cb_stack);
TEST_DECLARE (timeout);
TEST_DECLARE (close_cb_stack)
TEST_DECLARE (timeout)
TEST_DECLARE (fail_always)
TEST_DECLARE (pass_always)

View File

@ -1,4 +1,3 @@
#ifndef TEST_RUNNER_H_
#define TEST_RUNNER_H_

View File

@ -2,23 +2,23 @@
#include "test.h"
int expected = 0;
int timeouts = 0;
static int expected = 0;
static int timeouts = 0;
void timeout_cb(oio_req *req) {
static void timeout_cb(oio_req *req) {
ASSERT(req != NULL);
free(req);
timeouts++;
}
void exit_timeout_cb(oio_req *req) {
static void exit_timeout_cb(oio_req *req) {
ASSERT(req != NULL);
ASSERT(timeouts == expected);
exit(0);
}
void dummy_timeout_cb(oio_req *req) {
static void dummy_timeout_cb(oio_req *req) {
/* Should never be called */
FATAL(dummy_timer_cb should never be called)
}
@ -59,4 +59,4 @@ TEST_IMPL(timeout) {
FATAL(should never get here)
return 2;
}
}

View File

@ -43,4 +43,4 @@
#define TEST_IMPL(name) \
int run_##name()
#endif /* TEST_H_ */
#endif /* TEST_H_ */