X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Fmemcp.cc;h=89ded54c4ade924ecd50ab1701eff5249119adc8;hb=0eb039e8de2a95b35a082a21a103a68e1d08385f;hp=04c47f80956a014ccfa640c46fc87dd9f356a557;hpb=f47caf2833675cce0b62a6e4ffd6764c1490a8b4;p=awesomized%2Flibmemcached diff --git a/tests/memcp.cc b/tests/memcp.cc index 04c47f80..89ded54c 100644 --- a/tests/memcp.cc +++ b/tests/memcp.cc @@ -39,10 +39,12 @@ Test that we are cycling the servers we are creating during testing. */ -#include +#include "mem_config.h" -#include -#include +#include "libtest/test.hpp" +#include "libmemcached-1.0/memcached.h" + +#include using namespace libtest; @@ -50,7 +52,7 @@ using namespace libtest; #pragma GCC diagnostic ignored "-Wstrict-aliasing" #endif -static std::string executable("./clients/memcp"); +static std::string executable("./src/bin/memcp"); static test_return_t help_test(void *) { @@ -61,20 +63,33 @@ static test_return_t help_test(void *) return TEST_SUCCESS; } +#if 0 static test_return_t server_test(void *) { + int fd; + std::string tmp_file= create_tmpfile("memcp", fd); + ASSERT_TRUE(tmp_file.c_str()); + struct stat buf; + ASSERT_EQ(fstat(fd, &buf), 0); + ASSERT_EQ(buf.st_size, 0); + char buffer[1024]; snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port())); - const char *args[]= { buffer, 0 }; + const char *args[]= { buffer, tmp_file.c_str(), 0 }; test_compare(EXIT_SUCCESS, exec_cmdline(executable, args, true)); + close(fd); + unlink(tmp_file.c_str()); return TEST_SUCCESS; } +#endif test_st memcp_tests[] ={ {"--help", true, help_test }, +#if 0 {"--server_test", true, server_test }, +#endif {0, 0, 0} }; @@ -91,7 +106,7 @@ static void *world_create(server_startup_st& servers, test_return_t& error) return NULL; } - if (server_startup(servers, "memcached", libtest::default_port(), 0, NULL) == false) + if (server_startup(servers, "memcached", libtest::default_port(), NULL) == false) { error= TEST_FAILURE; }