- std::cerr << std::endl << "Failed to parse(" << memcached_strerror(NULL, rc) << "): " << random_options << std::endl;
- memcached_error_print(memc_ptr);
+ switch (errno)
+ {
+ case EINVAL:
+#if 0 // Testing framework is not smart enough for this just yet.
+ {
+ // We will try to find the specific error
+ char buffer[2048];
+ memcached_return_t rc= libmemcached_check_configuration(random_options.c_str(), random_options.size(), buffer, sizeof(buffer));
+ test_true_got(rc != MEMCACHED_SUCCESS, "memcached_create_with_options() failed whiled libmemcached_check_configuration() was successful");
+ std::cerr << "Error occured on " << random_options.c_str() << " : " << buffer << std::endl;
+ return TEST_FAILURE;
+ }
+#endif
+ break;
+ case ENOMEM:
+ std::cerr << "Failed to allocate memory for memcached_create_with_options()" << std::endl;
+ memcached_free(memc_ptr);
+ return TEST_FAILURE;
+ default:
+ std::cerr << "Unknown error from memcached_create_with_options?!!" << std::endl;
+ memcached_free(memc_ptr);
+ return TEST_FAILURE;
+ }