tests: enable sasl
[awesomized/libmemcached] / tests / libmemcached-1.0 / sasl.cc
index ee8b5e67166d649be03b3e642236f47e109ac6a2..44d0f31fbad57d383266ffa6ea3d7cd66d90a397 100644 (file)
@@ -34,7 +34,7 @@
  *
  */
 
-#include <config.h>
+#include <mem_config.h>
 #include <libtest/test.hpp>
 
 using namespace libtest;
@@ -43,14 +43,11 @@ using namespace libtest;
   Test cases
 */
 
-#include <libmemcached/memcached.h>
+#include <libmemcached-1.0/memcached.h>
 
 static test_return_t pre_sasl(memcached_st *)
 {
-  if (LIBMEMCACHED_WITH_SASL_SUPPORT == 0)
-  {
-    return TEST_SKIPPED;
-  }
+  SKIP_IF(LIBMEMCACHED_WITH_SASL_SUPPORT == 0);
 
   return TEST_SUCCESS;
 }
@@ -63,6 +60,7 @@ static test_return_t pre_sasl(memcached_st *)
  */
 static test_return_t sasl_auth_test(memcached_st *memc)
 {
+#ifdef LIBMEMCACHED_WITH_SASL_SUPPORT
   if (LIBMEMCACHED_WITH_SASL_SUPPORT)
   {
     test_compare(MEMCACHED_SUCCESS, memcached_set(memc, "foo", 3, "bar", 3, (time_t)0, (uint32_t)0));
@@ -79,6 +77,9 @@ static test_return_t sasl_auth_test(memcached_st *memc)
     memcached_quit(memc);
     return TEST_SUCCESS;
   }
+#else
+  (void)memc;
+#endif
 
   return TEST_SKIPPED;
 }
@@ -99,23 +100,14 @@ collection_st collection[] ={
 
 #include "tests/libmemcached_world.h"
 
-void get_world(Framework *world)
+void get_world(libtest::Framework* world)
 {
-  world->collections= collection;
-
-  world->_create= (test_callback_create_fn*)world_create;
-  world->_destroy= (test_callback_destroy_fn*)world_destroy;
-
-  world->item._startup= (test_callback_fn*)world_test_startup;
-  world->item.set_pre((test_callback_fn*)world_pre_run);
-  world->item.set_flush((test_callback_fn*)world_flush);
-  world->item.set_post((test_callback_fn*)world_post_run);
-  world->_on_error= (test_callback_error_fn*)world_on_error;
+  world->collections(collection);
 
-  world->collection_startup= (test_callback_fn*)world_container_startup;
-  world->collection_shutdown= (test_callback_fn*)world_container_shutdown;
+  world->create((test_callback_create_fn*)world_create);
+  world->destroy((test_callback_destroy_fn*)world_destroy);
 
-  world->set_runner(&defualt_libmemcached_runner);
+  world->set_runner(new LibmemcachedRunner);
 
   world->set_sasl("memcached", "memcached");
 }