Add more complete base64 testing for C++ JSON protocol.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665559 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/test/JSONProtoTest.cpp b/test/JSONProtoTest.cpp
index 077d2c4..30d712f 100644
--- a/test/JSONProtoTest.cpp
+++ b/test/JSONProtoTest.cpp
@@ -104,6 +104,10 @@
assert(hm == hm2);
+ hm2.big[0].a_bite = 0xFF;
+
+ assert(hm != hm2);
+
Doubles dub;
dub.nan = HUGE_VAL/HUGE_VAL;
dub.inf = HUGE_VAL;
@@ -115,5 +119,22 @@
dub.negzero = -0.0;
cout << facebook::thrift::ThriftJSONString(dub) << endl << endl;
+ cout << "Testing base" << endl;
+
+ Base64 base;
+ base.a = 123;
+ base.b1 = "1";
+ base.b2 = "12";
+ base.b3 = "123";
+ base.b4 = "1234";
+ base.b5 = "12345";
+ base.b6 = "123456";
+
+ base.write(proto.get());
+ Base64 base2;
+ base2.read(proto.get());
+
+ assert(base == base2);
+
return 0;
}