return true;
}
- bool build(int argc, const char *argv[]);
+ bool build(size_t argc, const char *argv[]);
};
#include <sstream>
-bool BlobslapWorker::build(int argc, const char *argv[])
+bool BlobslapWorker::build(size_t argc, const char *argv[])
{
std::stringstream arg_buffer;
- for (int x= 1 ; x < argc ; x++)
+ for (size_t x= 0 ; x < argc ; x++)
{
add_option(argv[x]);
}
return true;
}
- bool build(int argc, const char *argv[]);
+ bool build(size_t argc, const char *argv[]);
};
-bool Gearmand::build(int argc, const char *argv[])
+bool Gearmand::build(size_t argc, const char *argv[])
{
std::stringstream arg_buffer;
add_option("--listen=localhost");
- for (int x= 1 ; x < argc ; x++)
+ for (size_t x= 0 ; x < argc ; x++)
{
add_option(argv[x]);
}
bool has_socket_file_option() const
{
- return true;
+ return has_socket();
}
void socket_file_option(Application& app, const std::string& socket_arg)
return true;
}
- bool build(int argc, const char *argv[]);
+ bool build(size_t argc, const char *argv[]);
};
class MemcachedSaSL : public Memcached
#include <sstream>
-bool Memcached::build(int argc, const char *argv[])
+bool Memcached::build(size_t argc, const char *argv[])
{
std::stringstream arg_buffer;
output << " Exec:" << arg.running();
}
-
return output; // for multiple << operators
}
fatal_message("has_pid() failed, programer error");
}
- Application app(name(), is_libtool());
+ Application app(executable(), is_libtool());
if (args(app) == false)
{
Error << "Could not build command()";
Error << "Application::run() " << ret;
return false;
}
+ _running= app.print();
if (Application::SUCCESS != (ret= app.wait()))
{
- Error << "Application::wait() " << ret;
+ Error << "Application::wait() " << app.print() << " " << ret;
return false;
}
app.add_option(daemon_file_option());
}
- if (_is_socket and has_socket_file_option())
+ if (has_socket_file_option())
{
- if (not set_socket_file())
+ Error << "adding socket option ";
+ if (set_socket_file() == false)
{
return false;
}
{
if (arg.empty() == false)
{
- std::string buffer("--socket=");
+ std::string buffer("--pid-file=");
buffer+= arg;
app.add_option(buffer);
}
virtual pid_t get_pid(bool error_is_ok= false)= 0;
- virtual bool build(int argc, const char *argv[])= 0;
+ virtual bool build(size_t argc, const char *argv[])= 0;
void add_option(const std::string&);
void add_option(const std::string&, const std::string&);
test_skip(true, has_gearmand_binary());
#endif
- const char *argv[1]= { "cycle_gearmand" };
- test_true(server_startup(*servers, "gearmand", get_free_port(), 1, argv));
+ test_true(server_startup(*servers, "gearmand", get_free_port(), 0, NULL));
return TEST_SUCCESS;
}
if (MEMCACHED_BINARY and HAVE_LIBMEMCACHED)
{
test_true(has_memcached_binary());
- const char *argv[1]= { "cycle_memcached" };
- test_true(server_startup(*servers, "memcached", get_free_port(), 1, argv));
+ test_true(server_startup(*servers, "memcached", get_free_port(), 0, NULL));
return TEST_SUCCESS;
}
if (HAVE_LIBMEMCACHED)
{
test_true(has_memcached_binary());
- const char *argv[1]= { "cycle_memcached" };
- test_true(servers->start_socket_server("memcached", get_free_port(), 1, argv));
+ test_true(servers->start_socket_server("memcached", get_free_port(), 0, NULL));
return TEST_SUCCESS;
}
if (HAVE_LIBMEMCACHED)
{
test_true(has_memcached_sasl_binary());
- const char *argv[1]= { "cycle_memcached_sasl" };
- test_true(server_startup(*servers, "memcached-sasl", get_free_port(), 1, argv));
+ test_true(server_startup(*servers, "memcached-sasl", get_free_port(), 0, NULL));
return TEST_SUCCESS;
}
{
in_port_t port= libtest::get_free_port();
- const char *argv[1]= { "memcached" };
if (servers.sasl())
{
- if (server_startup(servers, "memcached-sasl", port, 1, argv) == false)
+ if (server_startup(servers, "memcached-sasl", port, 0, NULL) == false)
{
fatal_message("Could not start memcached-sasl");
}
}
else
{
- if (server_startup(servers, "memcached", port, 1, argv) == false)
+ if (server_startup(servers, "memcached", port, 0, NULL) == false)
{
fatal_message("Could not start memcached");
}
return NULL;
}
- const char *argv[1]= { "memcapable" };
- if (not server_startup(servers, "memcached", libtest::default_port(), 1, argv))
+ if (server_startup(servers, "memcached", libtest::default_port(), 0, NULL) == false)
{
error= TEST_FAILURE;
}
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif
-static std::string executable;
-
-static test_return_t quiet_test(void *)
-{
- const char *args[]= { "--quiet", 0 };
-
- test_compare(EXIT_FAILURE, exec_cmdline(executable, args, true));
-
- return TEST_SUCCESS;
-}
+static std::string executable("clients/memcat");
static test_return_t help_test(void *)
{
}
test_st memcat_tests[] ={
- {"--quiet", true, quiet_test },
{"--help", true, help_test },
{"cat(FOUND)", true, cat_test },
{"cat(NOT_FOUND)", true, NOT_FOUND_test },
return NULL;
}
- const char *argv[1]= { "memcat" };
- if (not server_startup(servers, "memcached", libtest::default_port(), 1, argv))
+ if (not server_startup(servers, "memcached", libtest::default_port(), 0, NULL))
{
error= TEST_FAILURE;
}
void get_world(Framework *world)
{
- executable= "clients/memcat";
world->collections= collection;
world->_create= world_create;
}
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif
-static std::string executable;
-
-static test_return_t quiet_test(void *)
-{
- const char *args[]= { "--quiet", 0 };
-
- test_compare(EXIT_FAILURE, exec_cmdline(executable, args, true));
-
- return TEST_SUCCESS;
-}
+static std::string executable("./clients/memcp");
static test_return_t help_test(void *)
{
}
test_st memcp_tests[] ={
- {"--quiet", true, quiet_test },
{"--help", true, help_test },
{"--server_test", true, server_test },
{0, 0, 0}
return NULL;
}
- const char *argv[1]= { "memcp" };
- if (not server_startup(servers, "memcached", libtest::default_port(), 1, argv))
+ if (server_startup(servers, "memcached", libtest::default_port(), 0, NULL) == false)
{
error= TEST_FAILURE;
}
void get_world(Framework *world)
{
- executable= "./clients/memcp";
world->collections= collection;
world->_create= world_create;
}
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif
-static std::string executable;
-
-static test_return_t quiet_test(void *)
-{
- const char *args[]= { "--quiet", 0 };
-
- test_compare(EXIT_FAILURE, exec_cmdline(executable, args, true));
-
- return TEST_SUCCESS;
-}
+static std::string executable("./clients/memdump");
static test_return_t help_test(void *)
{
}
test_st memdump_tests[] ={
- {"--quiet", true, quiet_test },
{"--help", true, help_test },
{"--server", true, server_test },
{"FOUND", true, FOUND_test },
return NULL;
}
- const char *argv[1]= { "memdump" };
- if (not server_startup(servers, "memcached", libtest::default_port(), 1, argv))
+ if (server_startup(servers, "memcached", libtest::default_port(), 0, NULL) == false)
{
error= TEST_FAILURE;
}
void get_world(Framework *world)
{
- executable= "./clients/memdump";
world->collections= collection;
world->_create= world_create;
}
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif
-static std::string executable;
+static std::string executable("./clients/memerror");
static test_return_t help_TEST(void *)
{
void get_world(Framework *world)
{
- executable= "./clients/memerror";
world->collections= collection;
world->_create= world_create;
}
return NULL;
}
- const char *argv[1]= { "memexist" };
- if (not server_startup(servers, "memcached", libtest::default_port(), 1, argv))
+ if (server_startup(servers, "memcached", libtest::default_port(), 0, NULL) == false)
{
error= TEST_FAILURE;
}
return NULL;
}
- const char *argv[1]= { "memflush" };
- if (not server_startup(servers, "memcached", libtest::default_port(), 1, argv))
+ if (server_startup(servers, "memcached", libtest::default_port(), 0, NULL) == 0)
{
error= TEST_FAILURE;
}
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif
-static std::string executable;
+static std::string executable("./clients/memrm");
static test_return_t quiet_test(void *)
{
return NULL;
}
- const char *argv[1]= { "memrm" };
- if (not server_startup(servers, "memcached", libtest::default_port(), 1, argv))
+ if (server_startup(servers, "memcached", libtest::default_port(), 0, NULL) == false)
{
error= TEST_FAILURE;
}
void get_world(Framework *world)
{
- executable= "./clients/memrm";
world->collections= collection;
world->_create= world_create;
}
return NULL;
}
- const char *argv[1]= { "memstat" };
- if (server_startup(servers, "memcached", libtest::default_port(), 1, argv) == false)
+ if (server_startup(servers, "memcached", libtest::default_port(), 0, NULL) == false)
{
error= TEST_FAILURE;
}
return NULL;
}
- const char *argv[1]= { "memtouch" };
- if (not server_startup(servers, "memcached", libtest::default_port(), 1, argv))
+ if (server_startup(servers, "memcached", libtest::default_port(), 0, NULL) == false)
{
error= TEST_FAILURE;
}