projects
/
awesomized
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Updated memcached.h so that it contains only its structure.
[awesomized/libmemcached]
/
tests
/
test.c
diff --git
a/tests/test.c
b/tests/test.c
index a10cc47655097d86383328880d5257e421c8d02b..fb501fadc2edcc6d57270c2cd47ce52cdc21a5d8 100644
(file)
--- a/
tests/test.c
+++ b/
tests/test.c
@@
-32,7
+32,7
@@
static void world_stats_print(world_stats_st *stats)
static long int timedif(struct timeval a, struct timeval b)
{
static long int timedif(struct timeval a, struct timeval b)
{
-
register int
us, s;
+
long
us, s;
us = (int)(a.tv_usec - b.tv_usec);
us /= 1000;
us = (int)(a.tv_usec - b.tv_usec);
us /= 1000;
@@
-57,7
+57,6
@@
const char *test_strerror(test_return_t code)
fprintf(stderr, "Unknown return value\n");
abort();
}
fprintf(stderr, "Unknown return value\n");
abort();
}
-
}
void create_core(void)
}
void create_core(void)
@@
-125,9
+124,16
@@
int main(int argc, char *argv[])
collection= world.collections;
if (world.create)
collection= world.collections;
if (world.create)
- world_ptr= world.create();
+ {
+ test_return_t error;
+ world_ptr= world.create(&error);
+ if (error != TEST_SUCCESS)
+ exit(1);
+ }
else
else
+ {
world_ptr= NULL;
world_ptr= NULL;
+ }
if (argc > 1)
collection_to_run= argv[1];
if (argc > 1)
collection_to_run= argv[1];
@@
-235,7
+241,16
@@
error:
fprintf(stderr, "All tests completed successfully\n\n");
if (world.destroy)
fprintf(stderr, "All tests completed successfully\n\n");
if (world.destroy)
- world.destroy(world_ptr);
+ {
+ test_return_t error;
+ error= world.destroy(world_ptr);
+
+ if (error != TEST_SUCCESS)
+ {
+ fprintf(stderr, "Failure during shutdown.\n");
+ stats.failed++; // We do this to make our exit code return 1
+ }
+ }
world_stats_print(&stats);
world_stats_print(&stats);