c++: fix return value type
[awesomized/libmemcached] / clients / memcapable.cc
index 3e9bfabfbf2e9b63136353376b7e7b9359cef4d8..c52b3c46b62ef484650dec7c52ef31a48bf4c570 100644 (file)
@@ -37,7 +37,7 @@
 #include <libmemcached-1.0/memcached.h>
 
 #include "libmemcached/socket.hpp"
-#include "libmemcached/memcached/protocol_binary.h"
+#include "libmemcachedprotocol-0.0/binary.h"
 #include "libmemcached/byteorder.h"
 #include "clients/utilities.h"
 
@@ -536,6 +536,7 @@ static enum test_return do_validate_response_header(response *rsp,
     case PROTOCOL_BINARY_CMD_REPLACEQ:
     case PROTOCOL_BINARY_CMD_SETQ:
       verify("Quiet command shouldn't return on success" == NULL);
+      /* fall through */
     default:
       break;
     }
@@ -1302,7 +1303,7 @@ static enum test_return test_ascii_verbosity(void)
   execute(receive_error_response());
 
   execute(send_string("verbosity noreply\r\n"));
-  execute(receive_error_response());
+  execute(test_ascii_version());
 
   execute(send_string("verbosity 0 noreply\r\n"));
   execute(test_ascii_version());
@@ -2148,7 +2149,7 @@ int main(int argc, char **argv)
     }
   }
 
-  if (hostname)
+  if (!hostname)
   {
     fprintf(stderr, "No hostname was provided.\n");
     return EXIT_FAILURE;
@@ -2159,7 +2160,7 @@ int main(int argc, char **argv)
   if (sock == INVALID_SOCKET)
   {
     fprintf(stderr, "Failed to connect to <%s:%s>: %s\n",
-            hostname, port, strerror(get_socket_errno()));
+            hostname?:"(null)", port?:"(null)", strerror(get_socket_errno()));
     return EXIT_FAILURE;
   }
 
@@ -2231,7 +2232,7 @@ int main(int argc, char **argv)
       closesocket(sock);
       if ((sock= connect_server(hostname, port)) == INVALID_SOCKET)
       {
-        fprintf(stderr, "Failed to connect to <%s:%s>: %s\n", hostname, port, strerror(get_socket_errno()));
+        fprintf(stderr, "Failed to connect to <%s:%s>: %s\n", hostname?:"(null)", port?:"(null)", strerror(get_socket_errno()));
         fprintf(stderr, "%d of %d tests failed\n", failed, total);
         return EXIT_FAILURE;
       }