test-memerror: tests/memerror
tests/memerror
+test-memtouch: tests/memtouch
+ tests/memtouch
+
valgrind-memerror: tests/memerror
@$(VALGRIND_COMMAND) tests/memerror
valgrind-memtouch: tests/memtouch
- @$(VALGRIND_COMMAND) tests/memerror
+ @$(VALGRIND_COMMAND) tests/memtouch
#include <libtest/test.hpp>
#include <libmemcached/memcached.h>
+#include <libmemcached/util.h>
using namespace libtest;
return TEST_SUCCESS;
}
+static test_return_t check_version(void*)
+{
+ char buffer[1024];
+ snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
+ memcached_st *memc= memcached(buffer, strlen(buffer));
+ test_true(memc);
+
+ test_return_t result= TEST_SUCCESS;
+ if (libmemcached_util_version_check(memc, 1, 4, 8) == false)
+ {
+ result= TEST_SKIPPED;
+ }
+ memcached_free(memc);
+
+ return result;
+}
+
test_st memexist_tests[] ={
{"--help", true, help_test },
{"exist(FOUND)", true, exist_test },
};
collection_st collection[] ={
- {"memexist", 0, 0, memexist_tests },
+ {"memexist", check_version, 0, memexist_tests },
{0, 0, 0, 0}
};
#include <libtest/test.hpp>
#include <libmemcached/memcached.h>
+#include <libmemcached/util.h>
using namespace libtest;
static test_return_t NOT_FOUND_test(void *)
{
char buffer[1024];
-
snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
memcached_st *memc= memcached(buffer, strlen(buffer));
test_true(memc);
return TEST_SUCCESS;
}
+static test_return_t check_version(void*)
+{
+ char buffer[1024];
+ snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
+ memcached_st *memc= memcached(buffer, strlen(buffer));
+ test_true(memc);
+
+ test_return_t result= TEST_SUCCESS;
+ if (libmemcached_util_version_check(memc, 1, 4, 8) == false)
+ {
+ result= TEST_SKIPPED;
+ }
+ memcached_free(memc);
+
+ return result;
+}
+
test_st memtouch_tests[] ={
{"--help", true, help_test },
{"touch(FOUND)", true, touch_test },
};
collection_st collection[] ={
- {"memtouch", 0, 0, memtouch_tests },
+ {"memtouch", check_version, 0, memtouch_tests },
{0, 0, 0, 0}
};