From: Brian Aker Date: Thu, 2 May 2013 02:16:42 +0000 (-0400) Subject: Refactor memcapable test. Update m4 for append file. X-Git-Tag: 1.0.18~24^2~6 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=d9b744aa354952e18e07d6448a4004aa0c7e5802;p=awesomized%2Flibmemcached Refactor memcapable test. Update m4 for append file. --- diff --git a/m4/ax_append_to_file.m4 b/m4/ax_append_to_file.m4 index c88affb4..f9f54e08 100644 --- a/m4/ax_append_to_file.m4 +++ b/m4/ax_append_to_file.m4 @@ -19,9 +19,9 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 7 +#serial 8 AC_DEFUN([AX_APPEND_TO_FILE],[ AC_REQUIRE([AX_FILE_ESCAPES]) -printf "$2" >> "$1" +printf "$2\n" >> "$1" ]) diff --git a/tests/memcapable.cc b/tests/memcapable.cc index 04a7b342..63a1d269 100644 --- a/tests/memcapable.cc +++ b/tests/memcapable.cc @@ -74,7 +74,7 @@ static test_return_t ascii_test(void *) { char buffer[1024]; snprintf(buffer, sizeof(buffer), "%d", int(default_port())); - const char *args[]= { "-p", buffer, " -a ", 0 }; + const char *args[]= { "-p", buffer, "-a", 0 }; test_true(exec_cmdline(executable, args, true) <= EXIT_FAILURE); @@ -85,7 +85,7 @@ static test_return_t binary_test(void *) { char buffer[1024]; snprintf(buffer, sizeof(buffer), "%d", int(default_port())); - const char *args[]= { "-p", buffer, " -b ", 0 }; + const char *args[]= { "-p", buffer, "-b", 0 }; test_true(exec_cmdline(executable, args, true) <= EXIT_FAILURE); @@ -107,16 +107,9 @@ collection_st collection[] ={ static void *world_create(server_startup_st& servers, test_return_t& error) { - if (libtest::has_memcached() == false) - { - error= TEST_SKIPPED; - return NULL; - } - - if (server_startup(servers, "memcached", libtest::default_port(), NULL) == false) - { - error= TEST_SKIPPED; - } + SKIP_UNLESS(libtest::has_memcached()) + + SKIP_UNLESS(server_startup(servers, "memcached", libtest::default_port(), NULL)) return &servers; }