aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/unit1309.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/unit1309.c')
-rw-r--r--tests/unit/unit1309.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/unit/unit1309.c b/tests/unit/unit1309.c
index 6cf886e9e..9d1e70d27 100644
--- a/tests/unit/unit1309.c
+++ b/tests/unit/unit1309.c
@@ -74,17 +74,19 @@ UNITTEST_START
struct Curl_tree nodes[NUM_NODES*3];
int rc;
int i, j;
- struct timeval tv_now = {0, 0};
+ struct curltime tv_now = {0, 0};
root = NULL; /* the empty tree */
/* add nodes */
for(i = 0; i < NUM_NODES; i++) {
- struct timeval key;
+ struct curltime key;
+ size_t payload;
key.tv_sec = 0;
key.tv_usec = (541*i)%1023;
+ payload = (size_t) key.tv_usec;
- nodes[i].payload = (void *)key.tv_usec; /* for simplicity */
+ nodes[i].payload = (void *)payload; /* for simplicity */
root = Curl_splayinsert(key, root, &nodes[i]);
}
@@ -109,14 +111,15 @@ UNITTEST_START
/* rebuild tree */
for(i = 0; i < NUM_NODES; i++) {
- struct timeval key;
+ struct curltime key;
key.tv_sec = 0;
key.tv_usec = (541*i)%1023;
/* add some nodes with the same key */
for(j = 0; j <= i % 3; j++) {
- nodes[i*3+j].payload = (void *)(key.tv_usec*10 + j); /* for simplicity */
+ size_t payload = key.tv_usec*10 + j;
+ nodes[i*3+j].payload = (void *)payload; /* for simplicity */
root = Curl_splayinsert(key, root, &nodes[i*3+j]);
}
}