projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
memcached_behavior() causes commands to be buffered until they are flushed to
[m6w6/libmemcached]
/
tests
/
test.c
diff --git
a/tests/test.c
b/tests/test.c
index e5f4bc84911fb7ae1cd5e086a6dda843ff9f11f6..653a3ddc905511e932814ab823eb6b388c14a5b9 100644
(file)
--- a/
tests/test.c
+++ b/
tests/test.c
@@
-10,11
+10,12
@@
#include <sys/stat.h>
#include <unistd.h>
#include <time.h>
#include <sys/stat.h>
#include <unistd.h>
#include <time.h>
+#include <fnmatch.h>
#include "test.h"
#define TEST_PORT_BASE MEMCACHED_DEFAULT_PORT+10
#include "test.h"
#define TEST_PORT_BASE MEMCACHED_DEFAULT_PORT+10
-#define TEST_SERVERS
3
+#define TEST_SERVERS
5
long int timedif(struct timeval a, struct timeval b)
{
long int timedif(struct timeval a, struct timeval b)
{
@@
-75,6
+76,7
@@
int main(int argc, char *argv[])
char *wildcard= NULL;
memcached_server_st *servers;
collection_st *collection;
char *wildcard= NULL;
memcached_server_st *servers;
collection_st *collection;
+ collection_st *next;
uint8_t failed;
collection= gets_collections();
uint8_t failed;
collection= gets_collections();
@@
-106,20
+108,18
@@
int main(int argc, char *argv[])
for (x= 0; x < memcached_server_list_count(servers); x++)
{
printf("\t%s : %u\n", servers[x].hostname, servers[x].port);
for (x= 0; x < memcached_server_list_count(servers); x++)
{
printf("\t%s : %u\n", servers[x].hostname, servers[x].port);
- assert(servers[x].stack_responses == 0);
assert(servers[x].fd == -1);
assert(servers[x].cursor_active == 0);
}
printf("\n");
assert(servers[x].fd == -1);
assert(servers[x].cursor_active == 0);
}
printf("\n");
- collection_st *next;
for (next= collection; next->name; next++)
{
test_st *run;
run= next->tests;
for (next= collection; next->name; next++)
{
test_st *run;
run= next->tests;
- if (collection_to_run &&
strcmp(collection_to_run, next->name
))
+ if (collection_to_run &&
fnmatch(collection_to_run, next->name, 0
))
continue;
fprintf(stderr, "\n%s\n\n", next->name);
continue;
fprintf(stderr, "\n%s\n\n", next->name);
@@
-130,8
+130,9
@@
int main(int argc, char *argv[])
memcached_st *memc;
memcached_return rc;
struct timeval start_time, end_time;
memcached_st *memc;
memcached_return rc;
struct timeval start_time, end_time;
+ long int load_time;
- if (wildcard &&
strcmp(wildcard, run->name
))
+ if (wildcard &&
fnmatch(wildcard, run->name, 0
))
continue;
fprintf(stderr, "Testing %s", run->name);
continue;
fprintf(stderr, "Testing %s", run->name);
@@
-150,7
+151,6
@@
int main(int argc, char *argv[])
for (loop= 0; loop < memcached_server_list_count(servers); loop++)
{
for (loop= 0; loop < memcached_server_list_count(servers); loop++)
{
- assert(memc->hosts[loop].stack_responses == 0);
assert(memc->hosts[loop].fd == -1);
assert(memc->hosts[loop].cursor_active == 0);
}
assert(memc->hosts[loop].fd == -1);
assert(memc->hosts[loop].cursor_active == 0);
}
@@
-170,7
+170,7
@@
int main(int argc, char *argv[])
gettimeofday(&start_time, NULL);
failed= run->function(memc);
gettimeofday(&end_time, NULL);
gettimeofday(&start_time, NULL);
failed= run->function(memc);
gettimeofday(&end_time, NULL);
- lo
ng int lo
ad_time= timedif(end_time, start_time);
+ load_time= timedif(end_time, start_time);
if (failed)
fprintf(stderr, "\t\t\t\t\t %ld.%03ld [ failed ]\n", load_time / 1000,
load_time % 1000);
if (failed)
fprintf(stderr, "\t\t\t\t\t %ld.%03ld [ failed ]\n", load_time / 1000,
load_time % 1000);