#include <libtest/test.hpp>
+#if defined(LIBTEST_WITH_LIBMEMCACHED_SUPPORT) && LIBTEST_WITH_LIBMEMCACHED_SUPPORT
+#include <libmemcached/memcached.h>
+#endif
+
+#if defined(LIBTEST_WITH_LIBGEARMAN_SUPPORT) && LIBTEST_WITH_LIBGEARMAN_SUPPORT
+#include <libgearman/gearman.h>
+#endif
+
#include <cstdlib>
#include <unistd.h>
return TEST_SUCCESS;
}
+static test_return_t test_success_equals_one_test(void *)
+{
+ test_skip(HAVE_LIBMEMCACHED, true);
+ test_zero(MEMCACHED_SUCCESS);
+ return TEST_SUCCESS;
+}
+
static test_return_t test_success_test(void *)
{
return TEST_SUCCESS;
return TEST_SUCCESS;
}
+static test_return_t _compare_test_return_t_test(void *)
+{
+ test_compare(TEST_SUCCESS, TEST_SUCCESS);
+
+ return TEST_SUCCESS;
+}
+
+static test_return_t _compare_memcached_return_t_test(void *)
+{
+ test_skip(HAVE_LIBMEMCACHED, true);
+ test_compare(MEMCACHED_SUCCESS, MEMCACHED_SUCCESS);
+
+ return TEST_SUCCESS;
+}
+
+static test_return_t _compare_gearman_return_t_test(void *)
+{
+ test_skip(HAVE_LIBGEARMAN, true);
+
+ return TEST_SUCCESS;
+}
+
static test_return_t gearmand_cycle_test(void *object)
{
server_startup_st *servers= (server_startup_st*)object;
};
test_st tests_log[] ={
- {"TEST_SUCCESS", 0, test_success_test },
- {"TEST_FAILURE", 0, test_failure_test },
+ {"TEST_SUCCESS", false, test_success_test },
+ {"TEST_FAILURE", false, test_failure_test },
+ {"TEST_SUCCESS == 0", false, test_success_equals_one_test },
{0, 0, 0}
};
{0, 0, 0}
};
+test_st comparison_tests[] ={
+ {"_compare(test_return_t)", 0, _compare_test_return_t_test },
+ {"_compare(memcached_return_t)", 0, _compare_memcached_return_t_test },
+ {"_compare(gearman_return_t)", 0, _compare_gearman_return_t_test },
+ {0, 0, 0}
+};
+
collection_st collection[] ={
{"environment", 0, 0, environment_tests},
{"return values", 0, 0, tests_log},
{"local", 0, 0, local_log},
{"directories", 0, 0, directories_tests},
+ {"comparison", 0, 0, comparison_tests},
{"gearmand", 0, 0, gearmand_tests},
{"memcached", 0, 0, memcached_tests},
{0, 0, 0, 0}