diff options
Diffstat (limited to 'lib/cpp/test/SpecializationTest.cpp')
-rw-r--r-- | lib/cpp/test/SpecializationTest.cpp | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/lib/cpp/test/SpecializationTest.cpp b/lib/cpp/test/SpecializationTest.cpp index 0bef12ad1..856bdac9f 100644 --- a/lib/cpp/test/SpecializationTest.cpp +++ b/lib/cpp/test/SpecializationTest.cpp @@ -12,20 +12,20 @@ using namespace apache::thrift::transport; using namespace apache::thrift::protocol; typedef TBinaryProtocolT<TMemoryBuffer> MyProtocol; -//typedef TBinaryProtocolT<TTransport> MyProtocol; +// typedef TBinaryProtocolT<TTransport> MyProtocol; int main() { OneOfEach ooe; - ooe.im_true = true; - ooe.im_false = false; - ooe.a_bite = 0x7f; + ooe.im_true = true; + ooe.im_false = false; + ooe.a_bite = 0x7f; ooe.integer16 = 27000; - ooe.integer32 = 1<<24; + ooe.integer32 = 1 << 24; ooe.integer64 = (uint64_t)6000 * 1000 * 1000; ooe.double_precision = M_PI; - ooe.some_characters = "JSON THIS! \"\1"; - ooe.zomg_unicode = "\xd7\n\a\t"; + ooe.some_characters = "JSON THIS! \"\1"; + ooe.zomg_unicode = "\xd7\n\a\t"; ooe.base64 = "\1\2\3\255"; Nesting n; @@ -33,12 +33,12 @@ int main() { n.my_ooe.integer16 = 16; n.my_ooe.integer32 = 32; n.my_ooe.integer64 = 64; - n.my_ooe.double_precision = (std::sqrt(5.0)+1)/2; - n.my_ooe.some_characters = ":R (me going \"rrrr\")"; + n.my_ooe.double_precision = (std::sqrt(5.0) + 1) / 2; + n.my_ooe.some_characters = ":R (me going \"rrrr\")"; n.my_ooe.zomg_unicode = "\xd3\x80\xe2\x85\xae\xce\x9d\x20" "\xd0\x9d\xce\xbf\xe2\x85\xbf\xd0\xbe\xc9\xa1\xd0\xb3\xd0\xb0\xcf\x81\xe2\x84\x8e" "\x20\xce\x91\x74\x74\xce\xb1\xe2\x85\xbd\xce\xba\xc7\x83\xe2\x80\xbc"; - n.my_bonk.type = 31337; + n.my_bonk.type = 31337; n.my_bonk.message = "I am a bonk... xor!"; HolyMoley hm; @@ -62,21 +62,21 @@ int main() { std::vector<Bonk> stage2; hm.bonks["nothing"] = stage2; - stage2.resize(stage2.size()+1); + stage2.resize(stage2.size() + 1); stage2.back().type = 1; stage2.back().message = "Wait."; - stage2.resize(stage2.size()+1); + stage2.resize(stage2.size() + 1); stage2.back().type = 2; stage2.back().message = "What?"; hm.bonks["something"] = stage2; stage2.clear(); - stage2.resize(stage2.size()+1); + stage2.resize(stage2.size() + 1); stage2.back().type = 3; stage2.back().message = "quoth"; - stage2.resize(stage2.size()+1); + stage2.resize(stage2.size() + 1); stage2.back().type = 4; stage2.back().message = "the raven"; - stage2.resize(stage2.size()+1); + stage2.resize(stage2.size() + 1); stage2.back().type = 5; stage2.back().message = "nevermore"; hm.bonks["poe"] = stage2; @@ -92,7 +92,6 @@ int main() { assert(ooe == ooe2); - cout << "Testing hm" << endl; hm.write(proto.get()); |