Browse Source

Improve performance of sqlite module by not requiring it to build strings
each time.

This also updates the test framework to handle some additional problems (and
we now restart the sqlite server with greater frequency to make sure that
each test is run in a vacuum).

Brian Aker 14 years ago
parent
commit
4e96964378
10 changed files with 316 additions and 84 deletions
  1. 23 13
      libgearman-server/plugins/queue/sqlite/queue.cc
  2. 5 0
      libgearman/worker.c
  3. 27 31
      libtest/server.cc
  4. 1 1
      libtest/server.h
  5. 20 25
      libtest/test.cc
  6. 29 10
      libtest/test.h
  7. 164 0
      tests/basic.cc
  8. 45 0
      tests/basic.h
  9. 1 2
      tests/burnin.cc
  10. 1 2
      tests/client_test.cc

+ 23 - 13
libgearman-server/plugins/queue/sqlite/queue.cc

@@ -51,7 +51,20 @@ public:
   std::string table;
   sqlite3 *db;
   int in_trans;
+
+  const std::string &insert_query() const
+  {
+    return _insert_query;
+  }
+
+  const std::string &delete_query() const
+  {
+    return _delete_query;
+  }
+
 private:
+  std::string _insert_query;
+  std::string _delete_query;
 };
 
 Sqlite::Sqlite() :
@@ -71,6 +84,14 @@ Sqlite::~Sqlite()
 
 gearmand_error_t Sqlite::initialize()
 {
+  _insert_query+= "INSERT OR REPLACE INTO ";
+  _insert_query+= table;
+  _insert_query+= " (priority,unique_key,function_name,data) VALUES (?,?,?,?)";
+
+  _delete_query+= "DELETE FROM ";
+  _delete_query+= table;
+  _delete_query+= " WHERE unique_key=? and function_name=?";
+
   return _initialize(&Gearmand()->server, this);
 }
 
@@ -414,12 +435,7 @@ static gearmand_error_t _sqlite_add(gearman_server_st *server, void *context,
   if (_sqlite_lock(server, queue) !=  SQLITE_OK)
     return GEARMAN_QUEUE_ERROR;
 
-  std::string query;
-  query+= "INSERT OR REPLACE INTO ";
-  query+= queue->table;
-  query+= " (priority,unique_key,function_name,data) VALUES (?,?,?,?)";
-
-  if (_sqlite_query(server, queue, query.c_str(), query.size(), &sth) != SQLITE_OK)
+  if (_sqlite_query(server, queue, queue->insert_query().c_str(), queue->insert_query().size(), &sth) != SQLITE_OK)
     return GEARMAN_QUEUE_ERROR;
 
   if (sqlite3_bind_int(sth,  1, priority) != SQLITE_OK)
@@ -521,13 +537,7 @@ static gearmand_error_t _sqlite_done(gearman_server_st *server, void *context,
   if (_sqlite_lock(server, queue) !=  SQLITE_OK)
     return GEARMAN_QUEUE_ERROR;
 
-
-  std::string query;
-  query+= "DELETE FROM ";
-  query+= queue->table;
-  query+= " WHERE unique_key=? and function_name=?";
-
-  if (_sqlite_query(server, queue, query.c_str(), query.size(), &sth) != SQLITE_OK)
+  if (_sqlite_query(server, queue, queue->delete_query().c_str(), queue->delete_query().size(), &sth) != SQLITE_OK)
     return GEARMAN_QUEUE_ERROR;
 
   sqlite3_bind_text(sth, 1, (const char *)unique, (int)unique_size, SQLITE_TRANSIENT);

+ 5 - 0
libgearman/worker.c

@@ -153,6 +153,11 @@ gearman_worker_st *gearman_worker_clone(gearman_worker_st *worker,
 
 void gearman_worker_free(gearman_worker_st *worker)
 {
+  if (! worker)
+    return;
+
+  gearman_worker_unregister_all(worker);
+
   if (worker->options.packet_init)
   {
     gearman_packet_free(&(worker->grab_job));

+ 27 - 31
libtest/server.cc

@@ -14,6 +14,7 @@
 #endif
 
 #include <assert.h>
+#include <iostream>
 #include <errno.h>
 #include <signal.h>
 #include <cstdio>
@@ -45,7 +46,7 @@ static bool wait_and_check_startup(const char *hostname, in_port_t port)
   if ((rc= gearman_client_add_server(client, hostname, port)) == GEARMAN_SUCCESS)
   {
     const char *value= "This is my echo test";
-    size_t value_length= strlen(value);
+    size_t value_length= sizeof("This is my echo test") -1;
 
     int counter= 5; // sleep cycles
     while (--counter)
@@ -65,7 +66,7 @@ static bool wait_and_check_startup(const char *hostname, in_port_t port)
   
   if (rc != GEARMAN_SUCCESS)
   {
-    fprintf(stderr, "wait_and_check_startup(%s)", gearman_client_error(client));
+    std::cerr << "wait_and_check_startup(" <<  gearman_client_error(client) << ")" << std::endl;
   }
   gearman_client_free(client);
 
@@ -73,28 +74,28 @@ static bool wait_and_check_startup(const char *hostname, in_port_t port)
 }
 
 
+#include <sstream>
+
 pid_t test_gearmand_start(in_port_t port, const char *queue_type,
-                          char *argv[], int argc)
+                          int argc, const char *argv[])
 {
   pid_t gearmand_pid= -1;
 
+  std::stringstream buffer;
+
   char file_buffer[1024];
   char log_buffer[1024];
-  char buffer[8196];
-  char *buffer_ptr= buffer;
 
   log_buffer[0]= 0;
   file_buffer[0]= 0;
 
   if (getenv("GEARMAN_MANUAL_GDB"))
   {
-    snprintf(buffer_ptr, sizeof(buffer), "libtool --mode=execute gdb gearmand/gearmand");
-    buffer_ptr+= strlen(buffer_ptr);
+    buffer << "libtool --mode=execute gdb gearmand/gearmand";
   }
   else if (getenv("GEARMAN_VALGRIND"))
   {
-    snprintf(buffer_ptr, sizeof(buffer), "libtool --mode=execute valgrind --log-file=tests/var/tmp/valgrind.out --leak-check=full  --show-reachable=yes ");
-    buffer_ptr+= strlen(buffer_ptr);
+    buffer << "libtool --mode=execute valgrind --log-file=tests/var/tmp/valgrind.out --leak-check=full  --show-reachable=yes ";
   }
 
   if (getenv("GEARMAN_MANUAL_GDB"))
@@ -105,8 +106,7 @@ pid_t test_gearmand_start(in_port_t port, const char *queue_type,
       perror("mkstemp");
       return -1;
     }
-    snprintf(buffer_ptr, sizeof(buffer), "\nrun --pid-file=%s -vvvvvv --port=%u", file_buffer, (uint32_t)port);
-    buffer_ptr+= strlen(buffer_ptr);
+    buffer << std::endl << "run --pid-file=" << file_buffer << " -vvvvvv --port=" << port;
   }
   else if (getenv("GEARMAN_LOG"))
   {
@@ -122,8 +122,7 @@ pid_t test_gearmand_start(in_port_t port, const char *queue_type,
       perror("mkstemp");
       return -1;
     }
-    snprintf(buffer_ptr, sizeof(buffer), "./gearmand/gearmand --pid-file=%s --daemon --port=%u -vvvvvv --log-file=%s", file_buffer, (uint32_t)port, log_buffer);
-    buffer_ptr+= strlen(buffer_ptr);
+    buffer << "./gearmand/gearmand --pid-file=" << file_buffer << " --daemon --port=" << port << " -vvvvvv --log-file=" << log_buffer;
   }
   else
   {
@@ -133,36 +132,32 @@ pid_t test_gearmand_start(in_port_t port, const char *queue_type,
       perror("mkstemp");
       return -1;
     }
-    snprintf(buffer_ptr, sizeof(buffer), "./gearmand/gearmand --pid-file=%s --daemon --port=%u", file_buffer, (uint32_t)port);
-    buffer_ptr+= strlen(buffer_ptr);
+    buffer << "./gearmand/gearmand --pid-file=" << file_buffer << " --daemon --port=" << port;
   }
 
   if (queue_type)
   {
-    snprintf(buffer_ptr, sizeof(buffer), " --queue-type=%s ", queue_type);
-    buffer_ptr+= strlen(buffer_ptr);
+    buffer << " --queue-type=" << queue_type << " ";
   }
 
   if (getuid() == 0 || geteuid() == 0)
   {
-    snprintf(buffer_ptr, sizeof(buffer), " -u root ");
-    buffer_ptr+= strlen(buffer_ptr);
+    buffer << " -u root ";
   }
 
   for (int x= 1 ; x < argc ; x++)
   {
-    snprintf(buffer_ptr, sizeof(buffer), " %s ", argv[x]);
+    buffer << " " << argv[x] << " ";
   }
 
-  fprintf(stderr, "%s\n", buffer);
   if (getenv("GEARMAN_MANUAL_GDB"))
   {
-    fprintf(stderr, "Pausing for startup, hit return when ready.\n");
+    std::cerr << "Pausing for startup, hit return when ready." << std::endl;
     getchar();
   }
   else
   {
-    int err= system(buffer);
+    int err= system(buffer.str().c_str());
     assert(err != -1);
   }
 
@@ -184,25 +179,26 @@ pid_t test_gearmand_start(in_port_t port, const char *queue_type,
       continue;
     }
 
-    char *found= fgets(buffer, sizeof(buffer), file);
-    if (!found)
+    char fgets_buffer[1024];
+    char *found= fgets(fgets_buffer, sizeof(fgets_buffer), file);
+    if (! found)
     {
       return -1;
     }
-    gearmand_pid= atoi(buffer);
+    gearmand_pid= atoi(fgets_buffer);
     fclose(file);
   }
 
   if (gearmand_pid == -1)
   {
-    fprintf(stderr, "Could not attach to gearman server, could server already be running on port %u\n", (uint32_t)port);
+    std::cerr << "Could not attach to gearman server, could server already be running on port " << port << std::endl;
     return -1;
   }
 
   if (! wait_and_check_startup(NULL, port))
   {
     test_gearmand_stop(gearmand_pid);
-    fprintf(stderr, "Failed wait_and_check_startup()\n");
+    std::cerr << "Failed wait_and_check_startup()" << std::endl;
     return -1;
   }
 
@@ -219,11 +215,11 @@ void test_gearmand_stop(pid_t gearmand_pid)
     {
     case EPERM:
       perror(__func__);
-      fprintf(stderr, "%s -> Does someone else have a gearmand server running locally?\n", __func__);
+      std::cerr << __func__ << " -> Does someone else have a gearmand server running locally?" << std::endl;
       return;
     case ESRCH:
       perror(__func__);
-      fprintf(stderr, "Process %d not found.\n", (int)gearmand_pid);
+      std::cerr << "Process " << (int)gearmand_pid << "not found." << std::endl;
       return;
     default:
     case EINVAL:
@@ -237,7 +233,7 @@ void test_gearmand_stop(pid_t gearmand_pid)
 
   if (WCOREDUMP(status))
   {
-    fprintf(stderr, "A core dump was created from the server\n");
+    std::cerr << "A core dump was created from the server." << std::endl;
   }
 
   if (WIFEXITED(status))

+ 1 - 1
libtest/server.h

@@ -20,7 +20,7 @@ extern "C" {
 
 LIBTEST_API
 pid_t test_gearmand_start(in_port_t port, const char *queue_type,
-                          char *argv[], int argc);
+                          int argc, const char *argv[]);
 
 LIBTEST_API
 void test_gearmand_stop(pid_t gearmand_pid);

+ 20 - 25
libtest/test.cc

@@ -7,9 +7,10 @@
  * the COPYING file in the parent directory for full text.
  */
 
-/*
-  Sample test application.
-*/
+
+#include <config.h>
+
+#include <stdint.h>
 #include <assert.h>
 #include <stdlib.h>
 #include <string.h>
@@ -20,6 +21,7 @@
 #include <unistd.h>
 #include <time.h>
 #include <fnmatch.h>
+#include <iostream>
 
 #include "test.h"
 
@@ -27,10 +29,10 @@
 
 static void world_stats_print(world_stats_st *stats)
 {
-  fprintf(stderr, "Total\t\t\t\t%u\n", stats->total);
-  fprintf(stderr, "\tFailed\t\t\t%u\n", stats->failed);
-  fprintf(stderr, "\tSkipped\t\t\t%u\n", stats->skipped);
-  fprintf(stderr, "\tSucceeded\t\t%u\n", stats->success);
+   std::cerr << "Total\t\t\t\t" << stats->total << std::endl;
+   std::cerr << "\tFailed\t\t\t" << stats->failed << std::endl;
+   std::cerr << "\tSkipped\t\t\t" << stats->skipped << std::endl;
+   std::cerr << "\tSucceeded\t\t" << stats->success << std::endl;
 }
 
 static long int timedif(struct timeval a, struct timeval b)
@@ -57,7 +59,7 @@ const char *test_strerror(test_return_t code)
     return "skipped";
   case TEST_MAXIMUM_RETURN:
   default:
-    fprintf(stderr, "Unknown return value\n");
+     std::cerr << "Unknown return value." << std::endl;
     abort();
   }
 }
@@ -74,10 +76,7 @@ void create_core(void)
     }
     else
     {
-      while (waitpid(pid, NULL, 0) != pid)
-      {
-        ;
-      }
+      while (waitpid(pid, NULL, 0) != pid) {};
     }
   }
 }
@@ -86,13 +85,9 @@ void create_core(void)
 static test_return_t _runner_default(test_callback_fn func, void *p)
 {
   if (func)
-  {
     return func(p);
-  }
-  else
-  {
-    return TEST_SUCCESS;
-  }
+
+  return TEST_SUCCESS;
 }
 
 static world_runner_st defualt_runners= {
@@ -154,7 +149,7 @@ int main(int argc, char *argv[])
     if (collection_to_run && fnmatch(collection_to_run, next->name, 0))
       continue;
 
-    fprintf(stderr, "\n%s\n\n", next->name);
+     std::cerr << std::endl << next->name << std::endl << std::endl;
 
     for (x= 0; run->name; run++)
     {
@@ -164,7 +159,7 @@ int main(int argc, char *argv[])
       if (wildcard && fnmatch(wildcard, run->name, 0))
         continue;
 
-      fprintf(stderr, "\tTesting %s", run->name);
+       std::cerr << "\tTesting " << run->name;
 
       if (world.collection_startup)
       {
@@ -210,12 +205,12 @@ int main(int argc, char *argv[])
 error:
       stats.total++;
 
-      fprintf(stderr, "\t\t\t\t\t");
+       std::cerr << "\t\t\t\t\t";
 
       switch (return_code)
       {
       case TEST_SUCCESS:
-        fprintf(stderr, "%ld.%03ld ", load_time / 1000, load_time % 1000);
+         std::cerr << load_time / 1000 << "." << load_time % 1000;
         stats.success++;
         break;
       case TEST_FAILURE:
@@ -230,7 +225,7 @@ error:
         break;
       }
 
-      fprintf(stderr, "[ %s ]\n", test_strerror(return_code));
+       std::cerr << "[ " << test_strerror(return_code) << " ]" << std::endl;
 
       if (world.on_error)
       {
@@ -243,7 +238,7 @@ error:
     }
   }
 
-  fprintf(stderr, "\n\nAll tests completed successfully\n\n");
+   std::cerr << std::endl << std::endl <<  "All tests completed successfully." << std::endl << std::endl;
 
   if (world.destroy)
   {
@@ -252,7 +247,7 @@ error:
 
     if (error != TEST_SUCCESS)
     {
-      fprintf(stderr, "Failure during shutdown.\n");
+       std::cerr << "Failure during shutdown." << std::endl;
       stats.failed++; // We do this to make our exit code return EXIT_FAILURE
     }
   }

+ 29 - 10
libtest/test.h

@@ -17,18 +17,15 @@
 #include <stdint.h>
 #include <libtest/visibility.h>
 
+#pragma once
 
-typedef struct world_st world_st;
-typedef struct collection_st collection_st;
-typedef struct test_st test_st;
-
-typedef enum {
+enum test_return_t {
   TEST_SUCCESS= 0, /* Backwards compatibility */
   TEST_FAILURE,
   TEST_MEMORY_ALLOCATION_FAILURE,
   TEST_SKIPPED,
   TEST_MAXIMUM_RETURN /* Always add new error code before */
-} test_return_t;
+};
 
 typedef void *(*test_callback_create_fn)(test_return_t *error);
 typedef test_return_t (*test_callback_fn)(void *);
@@ -61,11 +58,11 @@ struct collection_st {
   Structure which houses the actual callers for the test cases contained in
   the collections.
 */
-typedef struct {
+struct world_runner_st {
   test_callback_runner_fn pre;
   test_callback_runner_fn run;
   test_callback_runner_fn post;
-} world_runner_st;
+};
 
 
 /**
@@ -104,6 +101,21 @@ struct world_st {
     a set of default implementations.
   */
   world_runner_st *runner;
+
+  world_st() :
+    collections(NULL),
+    create(NULL),
+    destroy(NULL),
+    collection_startup(NULL),
+    flush(NULL),
+    pre_run(NULL),
+    post_run(NULL),
+    on_error(NULL),
+    runner(NULL)
+  { }
+
+  virtual ~world_st()
+  { }
 };
 
 
@@ -111,12 +123,19 @@ struct world_st {
 /**
   @note world_stats_st is a simple structure for tracking test successes.
 */
-typedef struct {
+struct world_stats_st {
   uint32_t success;
   uint32_t skipped;
   uint32_t failed;
   uint32_t total;
-} world_stats_st;
+
+  world_stats_st() :
+    success(0),
+    skipped(0),
+    failed(0),
+    total(0)
+  { }
+};
 
 #ifdef	__cplusplus
 extern "C" {

+ 164 - 0
tests/basic.cc

@@ -0,0 +1,164 @@
+/*  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+ * 
+ *  Gearmand client and server library.
+ *
+ *  Copyright (C) 2011 Data Differential, http://datadifferential.com/
+ *  All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are
+ *  met:
+ *
+ *      * Redistributions of source code must retain the above copyright
+ *  notice, this list of conditions and the following disclaimer.
+ *
+ *      * Redistributions in binary form must reproduce the above
+ *  copyright notice, this list of conditions and the following disclaimer
+ *  in the documentation and/or other materials provided with the
+ *  distribution.
+ *
+ *      * The names of its contributors may not be used to endorse or
+ *  promote products derived from this software without specific prior
+ *  written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <config.h>
+#include <cstring>
+
+#include <libgearman/gearman.h>
+
+#include <tests/basic.h>
+#include <tests/context.h>
+
+#pragma GCC diagnostic ignored "-Wold-style-cast"
+
+/* Counter test for worker */
+static void *counter_function(gearman_job_st *job __attribute__((unused)),
+                              void *context, size_t *result_size,
+                              gearman_return_t *ret_ptr __attribute__((unused)))
+{
+  uint32_t *counter= (uint32_t *)context;
+
+  *result_size= 0;
+
+  *counter= *counter + 1;
+
+  return NULL;
+}
+
+test_return_t echo_test(void *object)
+{
+  gearman_client_st client, *client_ptr;
+  gearman_return_t rc;
+  const char *value= "This is my echo test";
+  size_t value_length= sizeof("This is my echo test") -1;
+
+  (void)object;
+
+  client_ptr= gearman_client_create(&client);
+  test_truth(client_ptr);
+
+  rc= gearman_client_echo(&client, (uint8_t *)value, value_length);
+
+  test_truth(rc == GEARMAN_SUCCESS);
+
+  gearman_client_free(&client);
+
+  return TEST_SUCCESS;
+}
+
+test_return_t queue_clean(void *object)
+{
+  Context *test= (Context *)object;
+  gearman_worker_st *worker= test->worker;
+  uint32_t counter= 0;
+  gearman_return_t rc;
+
+  gearman_worker_set_timeout(worker, 200);
+  rc= gearman_worker_add_function(worker, "queue_test", 5, counter_function, &counter);
+  test_truth(rc == GEARMAN_SUCCESS);
+
+  // Clean out any jobs that might still be in the queue from failed tests.
+  while (1)
+  {
+    rc= gearman_worker_work(worker);
+    if (rc != GEARMAN_SUCCESS)
+      break;
+  }
+
+  return TEST_SUCCESS;
+}
+
+test_return_t queue_add(void *object)
+{
+  Context *test= (Context *)object;
+  gearman_client_st client, *client_ptr;
+  char job_handle[GEARMAN_JOB_HANDLE_SIZE];
+  uint8_t *value= (uint8_t *)"background_test";
+  size_t value_length= strlen("background_test");
+  gearman_return_t rc;
+
+  test->run_worker= false;
+
+  client_ptr= gearman_client_create(&client);
+  test_truth(client_ptr);
+
+  rc= gearman_client_add_server(&client, NULL, test->port());
+  test_truth(rc == GEARMAN_SUCCESS);
+
+  rc= gearman_client_echo(&client, (uint8_t *)value, value_length);
+  test_truth(rc == GEARMAN_SUCCESS);
+
+  rc= gearman_client_do_background(&client, "queue_test", NULL, value,
+                                   value_length, job_handle);
+  test_truth(rc == GEARMAN_SUCCESS);
+
+  gearman_client_free(&client);
+
+  test->run_worker= true;
+
+  return TEST_SUCCESS;
+}
+
+#include <iostream>
+
+test_return_t queue_worker(void *object)
+{
+  Context *test= (Context *)object;
+  gearman_worker_st *worker= test->worker;
+  uint32_t counter= 0;
+  gearman_return_t rc;
+
+  if (! test->run_worker)
+    return TEST_FAILURE;
+
+  rc= gearman_worker_add_function(worker, "queue_test", 5, counter_function, &counter);
+  test_truth(rc == GEARMAN_SUCCESS);
+
+  gearman_worker_set_timeout(worker, 5);
+
+  std::cerr << "got here " << std::endl;
+  rc= gearman_worker_work(worker);
+  test_truth(rc == GEARMAN_SUCCESS or rc == GEARMAN_TIMEOUT);
+  std::cerr << "gearman_worker_work() " << std::endl;
+
+  if (rc == GEARMAN_SUCCESS)
+  {
+    test_truth (counter != 0);
+  }
+
+  return TEST_SUCCESS;
+}

+ 45 - 0
tests/basic.h

@@ -0,0 +1,45 @@
+/*  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+ * 
+ *  Gearmand client and server library.
+ *
+ *  Copyright (C) 2011 Data Differential, http://datadifferential.com/
+ *  All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are
+ *  met:
+ *
+ *      * Redistributions of source code must retain the above copyright
+ *  notice, this list of conditions and the following disclaimer.
+ *
+ *      * Redistributions in binary form must reproduce the above
+ *  copyright notice, this list of conditions and the following disclaimer
+ *  in the documentation and/or other materials provided with the
+ *  distribution.
+ *
+ *      * The names of its contributors may not be used to endorse or
+ *  promote products derived from this software without specific prior
+ *  written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#pragma once
+
+#include <libtest/test.h>
+
+test_return_t echo_test(void *object);
+test_return_t queue_clean(void *object);
+test_return_t queue_add(void *object);
+test_return_t queue_worker(void *object);

+ 1 - 2
tests/burnin.cc

@@ -188,8 +188,7 @@ void *world_create(test_return_t *error)
   /**
     We start up everything before we allocate so that we don't have to track memory in the forked process.
   */
-  gearmand_pid= test_gearmand_start(CLIENT_TEST_PORT, NULL,
-                                    (char **)argv, 1);
+  gearmand_pid= test_gearmand_start(CLIENT_TEST_PORT, NULL, 1, argv);
   
   if (gearmand_pid == -1)
   {

+ 1 - 2
tests/client_test.cc

@@ -772,8 +772,7 @@ void *world_create(test_return_t *error)
   /**
     We start up everything before we allocate so that we don't have to track memory in the forked process.
   */
-  gearmand_pid= test_gearmand_start(CLIENT_TEST_PORT, NULL,
-                                    (char **)argv, 1);
+  gearmand_pid= test_gearmand_start(CLIENT_TEST_PORT, NULL, 1, argv);
   
   if (gearmand_pid == -1)
   {

Some files were not shown because too many files changed in this diff