Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

test: fix compiler warnings

* remove unused variables and functions
* replace %llu with %zu when printing size_t variables
  • Loading branch information...
bnoordhuis committed Mar 16, 2012
1 parent 681aa83 commit 379ca428ef5dbf2a29897ed4d34506dad0b96757
Showing with 7 additions and 18 deletions.
  1. +0 −7 test/dns-server.c
  2. +1 −1 test/test-get-memory.c
  3. +6 −6 test/test-platform-output.c
  4. +0 −1 test/test-tcp-writealot.c
  5. +0 −3 test/test-udp-multicast-ttl.c
@@ -50,14 +50,12 @@ typedef struct {
static uv_loop_t* loop;


static int server_closed;
static uv_tcp_t server;


static void after_write(uv_write_t* req, int status);
static void after_read(uv_stream_t*, ssize_t nread, uv_buf_t buf);
static void on_close(uv_handle_t* peer);
static void on_server_close(uv_handle_t* handle);
static void on_connection(uv_stream_t*, int status);

#define WRITE_BUF_LEN (64*1024)
@@ -283,11 +281,6 @@ static void on_connection(uv_stream_t* server, int status) {
}


static void on_server_close(uv_handle_t* handle) {
ASSERT(handle == (uv_handle_t*)&server);
}


static int dns_start(int port) {
struct sockaddr_in addr = uv_ip4_addr("0.0.0.0", port);
int r;
@@ -26,7 +26,7 @@ TEST_IMPL(get_memory) {
uint64_t free_mem = uv_get_free_memory();
uint64_t total_mem = uv_get_total_memory();

printf("free_mem=%llu, total_mem=%llu\n", free_mem, total_mem);
printf("free_mem=%zu, total_mem=%zu\n", free_mem, total_mem);

ASSERT(free_mem > 0);
ASSERT(total_mem > 0);
@@ -40,7 +40,7 @@ TEST_IMPL(platform_output) {

err = uv_resident_set_memory(&rss);
ASSERT(UV_OK == err.code);
fprintf(stderr, "uv_resident_set_memory: %d\n", rss);
fprintf(stderr, "uv_resident_set_memory: %zu\n", rss);

err = uv_uptime(&uptime);
ASSERT(UV_OK == err.code);
@@ -53,11 +53,11 @@ TEST_IMPL(platform_output) {
for (i = 0; i < count; i++) {
fprintf(stderr, " model: %s\n", cpus[i].model);
fprintf(stderr, " speed: %d\n", cpus[i].speed);
fprintf(stderr, " times.sys: %llu\n", cpus[i].cpu_times.sys);
fprintf(stderr, " times.user: %llu\n", cpus[i].cpu_times.user);
fprintf(stderr, " times.idle: %llu\n", cpus[i].cpu_times.idle);
fprintf(stderr, " times.irq: %llu\n", cpus[i].cpu_times.irq);
fprintf(stderr, " times.nice: %llu\n", cpus[i].cpu_times.nice);
fprintf(stderr, " times.sys: %zu\n", cpus[i].cpu_times.sys);
fprintf(stderr, " times.user: %zu\n", cpus[i].cpu_times.user);
fprintf(stderr, " times.idle: %zu\n", cpus[i].cpu_times.idle);
fprintf(stderr, " times.irq: %zu\n", cpus[i].cpu_times.irq);
fprintf(stderr, " times.nice: %zu\n", cpus[i].cpu_times.nice);
}
uv_free_cpu_info(cpus, count);

@@ -41,7 +41,6 @@ static int write_cb_called = 0;
static int close_cb_called = 0;
static int bytes_sent = 0;
static int bytes_sent_done = 0;
static int bytes_received = 0;
static int bytes_received_done = 0;


@@ -32,10 +32,7 @@
static uv_udp_t server;
static uv_udp_t client;

static int cl_recv_cb_called;

static int sv_send_cb_called;

static int close_cb_called;


0 comments on commit 379ca42

Please sign in to comment.
You can’t perform that action at this time.