#include <typeinfo>
#include <libtest/strerror.h>
+
+#if defined(HAVE_LIBMEMCACHED) && HAVE_LIBMEMCACHED
#include <libmemcached/memcached.h>
+#endif
+
+#if defined(HAVE_LIBGEARMAN) && HAVE_LIBGEARMAN
+#include <libgearman/gearman.h>
+#endif
namespace libtest {
{
if (__expected != __actual)
{
- if (typeid(__expected) == typeid(memcached_return_t))
+ if (typeid(__expected) == typeid(test_return_t))
+ {
+ libtest::stream::make_cerr(file, line, func) << "Expected \""
+ << test_strerror(test_return_t(__expected))
+ << "\" got \""
+ << test_strerror(test_return_t(__actual)) << "\"";
+ }
+#if defined(HAVE_LIBMEMCACHED) && HAVE_LIBMEMCACHED
+ else if (typeid(__expected) == typeid(memcached_return_t))
{
libtest::stream::make_cerr(file, line, func) << "Expected \""
<< memcached_strerror(NULL, memcached_return_t(__expected))
<< "\" got \""
<< memcached_strerror(NULL, memcached_return_t(__actual)) << "\"";
}
- else if (typeid(__expected) == typeid(test_return_t))
+#endif
+#if defined(HAVE_LIBGEARMAN) && HAVE_LIBGEARMAN
+ else if (typeid(__expected) == typeid(gearman_return_t))
{
libtest::stream::make_cerr(file, line, func) << "Expected \""
- << test_strerror(test_return_t(__expected))
+ << gearman_strerror(gearman_return_t(__expected))
<< "\" got \""
- << test_strerror(test_return_t(__actual)) << "\"";
+ << gearman_strerror(gearman_return_t(__actual)) << "\"";
}
+#endif
else
{
libtest::stream::make_cerr(file, line, func) << "Expected \"" << __expected << "\" got \"" << __actual << "\"";