THRIFT-3483 Incorrect empty binary handling introduced by THRIFT-3359
Client: C++, Node.js
Patch: Nobuaki Sukegawa

This closes #737
diff --git a/test/cpp/src/TestClient.cpp b/test/cpp/src/TestClient.cpp
index a6773d4..0ad789d 100644
--- a/test/cpp/src/TestClient.cpp
+++ b/test/cpp/src/TestClient.cpp
@@ -463,6 +463,20 @@
     /**
      * BINARY TEST
      */
+    printf("testBinary(empty)\n");
+    try {
+      string bin_result;
+      testClient.testBinary(bin_result, string());
+      if (!bin_result.empty()) {
+        printf("*** FAILED ***\n");
+        printf("invalid length: %lu\n", static_cast<long unsigned int>(bin_result.size()));
+        return_code |= ERR_BASETYPES;
+      }
+    } catch (exception& ex) {
+      printf("}\n*** FAILED ***\n");
+      printf("%s\n", ex.what());
+      return_code |= ERR_BASETYPES;
+    }
     printf("testBinary([-128..127]) = {");
     const char bin_data[256]
         = {-128, -127, -126, -125, -124, -123, -122, -121, -120, -119, -118, -117, -116, -115, -114,