X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Ftest.c;h=215218c5f068e5a3f9bfc26c26a419d03bf9cd72;hb=8984944bbc4a973dd26ea48120240ef86698266d;hp=b177f64fdffdbb8a7d84f401ab5dcbd30691f10f;hpb=a4456cc10079f2e6f648befc91657f2723c825e5;p=m6w6%2Flibmemcached diff --git a/tests/test.c b/tests/test.c index b177f64f..215218c5 100644 --- a/tests/test.c +++ b/tests/test.c @@ -9,6 +9,9 @@ /* Sample test application. */ + +#include "config.h" + #include #include #include @@ -21,6 +24,7 @@ #include #include +#include "libmemcached/memcached.h" #include "test.h" static void world_stats_print(world_stats_st *stats) @@ -37,7 +41,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 +151,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 +362,9 @@ cleanup: world_stats_print(&stats); +#ifdef LIBMEMCACHED_WITH_SASL_SUPPORT + sasl_done(); +#endif + return stats.failed == 0 ? 0 : 1; }