WIP
[m6w6/libmemcached] / tests / libmemcached-1.0 / plus.cpp
index 145f979765a0612870fb00dcd97cb34d585cb3bd..1077ae72fd1a80b8ba98d803d400dfbb5d8dbf5e 100644 (file)
  *
  */
 
-#include <mem_config.h>
+#include "mem_config.h"
 
 /*
   C++ interface test
 */
-#include <libmemcached-1.0/memcached.hpp>
-#include <libtest/test.hpp>
+#include "libmemcached-1.0/memcached.hpp"
+#include "libtest/test.hpp"
 
 #include <cstdio>
 #include <cstdlib>
@@ -49,7 +49,9 @@
 #include <sys/time.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <unistd.h>
+#if HAVE_UNISTD_H
+#  include <unistd.h>
+#endif
 #include <ctime>
 
 #include <string>
@@ -181,6 +183,13 @@ static test_return_t mget_test(memcached_st *original)
   vector<char> return_value;
 
   /* We need to empty the server before we continue the test */
+  bool flush_res= memc.flush();
+  if (flush_res == false)
+  {
+    std::string error_string;
+    ASSERT_TRUE(memc.error(error_string));
+    Error << error_string;
+  }
   test_true(memc.flush());
 
   test_true(memc.mget(keys));