X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Ftest.c;h=45ee3ab46e9f07454d68384f78fdd9117470018d;hb=ea260e7bce23c9a41c3c60fd68f55b33608714a9;hp=b177f64fdffdbb8a7d84f401ab5dcbd30691f10f;hpb=02fa1c85c842e175225f74b0e213a5600d4c03cf;p=m6w6%2Flibmemcached diff --git a/tests/test.c b/tests/test.c index b177f64f..45ee3ab4 100644 --- a/tests/test.c +++ b/tests/test.c @@ -21,6 +21,7 @@ #include #include +#include "libmemcached/memcached.h" #include "test.h" static void world_stats_print(world_stats_st *stats) @@ -37,7 +38,7 @@ static void world_stats_print(world_stats_st *stats) fprintf(stderr, "\tSucceeded\t\t%u\n", stats->success); } -static long int timedif(struct timeval a, struct timeval b) +long int timedif(struct timeval a, struct timeval b) { long us, s; @@ -147,6 +148,14 @@ int main(int argc, char *argv[]) world_stats_st stats; +#ifdef LIBMEMCACHED_WITH_SASL_SUPPORT + if (sasl_client_init(NULL) != SASL_OK) + { + fprintf(stderr, "Failed to initialize sasl library!\n"); + return 1; + } +#endif + memset(&stats, 0, sizeof(stats)); memset(&world, 0, sizeof(world)); get_world(&world); @@ -350,5 +359,9 @@ cleanup: world_stats_print(&stats); +#ifdef LIBMEMCACHED_WITH_SASL_SUPPORT + sasl_done(); +#endif + return stats.failed == 0 ? 0 : 1; }