THRIFT-2199:Remove dense protocol
Client: C++ library and compiler
Patch: Randy Abernethy
diff --git a/lib/cpp/test/CMakeLists.txt b/lib/cpp/test/CMakeLists.txt
index 80c6852..9913f6c 100644
--- a/lib/cpp/test/CMakeLists.txt
+++ b/lib/cpp/test/CMakeLists.txt
@@ -325,7 +325,7 @@
 
 
 add_custom_command(OUTPUT gen-cpp/DebugProtoTest_types.cpp gen-cpp/DebugProtoTest_types.h gen-cpp/EmptyService.cpp  gen-cpp/EmptyService.h
-    COMMAND thrift-compiler --gen cpp:dense ${PROJECT_SOURCE_DIR}/test/DebugProtoTest.thrift
+    COMMAND thrift-compiler --gen cpp ${PROJECT_SOURCE_DIR}/test/DebugProtoTest.thrift
 )
 
 add_custom_command(OUTPUT gen-cpp/EnumTest_types.cpp gen-cpp/EnumTest_types.h
@@ -337,7 +337,7 @@
 )
 
 add_custom_command(OUTPUT gen-cpp/OptionalRequiredTest_types.cpp gen-cpp/OptionalRequiredTest_types.h
-    COMMAND thrift-compiler --gen cpp:dense ${PROJECT_SOURCE_DIR}/test/OptionalRequiredTest.thrift
+    COMMAND thrift-compiler --gen cpp ${PROJECT_SOURCE_DIR}/test/OptionalRequiredTest.thrift
 )
 
 add_custom_command(OUTPUT gen-cpp/Recursive_types.cpp gen-cpp/Recursive_types.h
@@ -345,11 +345,11 @@
 )
 
 add_custom_command(OUTPUT gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp
-    COMMAND thrift-compiler --gen cpp:dense ${PROJECT_SOURCE_DIR}/test/StressTest.thrift
+    COMMAND thrift-compiler --gen cpp ${PROJECT_SOURCE_DIR}/test/StressTest.thrift
 )
 
 add_custom_command(OUTPUT gen-cpp/SecondService.cpp gen-cpp/ThriftTest_constants.cpp gen-cpp/ThriftTest.cpp gen-cpp/ThriftTest_types.cpp gen-cpp/ThriftTest_types.h
-    COMMAND thrift-compiler --gen cpp:dense ${PROJECT_SOURCE_DIR}/test/ThriftTest.thrift
+    COMMAND thrift-compiler --gen cpp ${PROJECT_SOURCE_DIR}/test/ThriftTest.thrift
 )
 
 add_custom_command(OUTPUT gen-cpp/ChildService.cpp gen-cpp/ChildService.h gen-cpp/ParentService.cpp gen-cpp/ParentService.h gen-cpp/proc_types.cpp gen-cpp/proc_types.h
diff --git a/lib/cpp/test/DenseProtoTest.cpp b/lib/cpp/test/DenseProtoTest.cpp
deleted file mode 100644
index 0beaa38..0000000
--- a/lib/cpp/test/DenseProtoTest.cpp
+++ /dev/null
@@ -1,485 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/*
-../compiler/cpp/thrift --gen cpp:dense DebugProtoTest.thrift
-../compiler/cpp/thrift --gen cpp:dense OptionalRequiredTest.thrift
-g++ -Wall -g -I../lib/cpp/src -I/usr/local/include/boost-1_33_1 \
-  gen-cpp/OptionalRequiredTest_types.cpp \
-  gen-cpp/DebugProtoTest_types.cpp \
-  DenseProtoTest.cpp ../lib/cpp/.libs/libthrift.a -o DenseProtoTest
-./DenseProtoTest
-*/
-
-// I do this to reach into the guts of TDenseProtocol.  Sorry.
-#define private public
-#define inline
-
-#undef NDEBUG
-#include <cstdlib>
-#include <cassert>
-#include <cmath>
-#include <string>
-#include "gen-cpp/DebugProtoTest_types.h"
-#include "gen-cpp/OptionalRequiredTest_types.h"
-#include <thrift/protocol/TDenseProtocol.h>
-#include <thrift/transport/TBufferTransports.h>
-
-#define BOOST_TEST_MODULE DenseProtoTest
-#include <boost/test/unit_test.hpp>
-
-using std::string;
-using boost::shared_ptr;
-using namespace thrift::test;
-using namespace thrift::test::debug;
-using namespace apache::thrift::transport;
-using namespace apache::thrift::protocol;
-
-// Can't use memcmp here.  GCC is too smart.
-bool my_memeq(const char* str1, const char* str2, int len) {
-  for (int i = 0; i < len; i++) {
-    if (str1[i] != str2[i]) {
-      return false;
-    }
-  }
-  return true;
-}
-
-BOOST_AUTO_TEST_CASE(test_dense_proto_1) {
-  OneOfEach ooe;
-  ooe.im_true = true;
-  ooe.im_false = false;
-  ooe.a_bite = 0xd6;
-  ooe.integer16 = 27000;
-  ooe.integer32 = 1 << 24;
-  ooe.integer64 = (uint64_t)6000 * 1000 * 1000;
-  ooe.double_precision = M_PI;
-  ooe.some_characters = "Debug THIS!";
-  ooe.zomg_unicode = "\xd7\n\a\t";
-
-  // cout << apache::thrift::ThriftDebugString(ooe) << endl << endl;
-
-  Nesting n;
-  n.my_ooe = ooe;
-  n.my_ooe.integer16 = 16;
-  n.my_ooe.integer32 = 32;
-  n.my_ooe.integer64 = 64;
-  n.my_ooe.double_precision = (std::sqrt(5) + 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.message = "I am a bonk... xor!";
-
-  // cout << apache::thrift::ThriftDebugString(n) << endl << endl;
-
-  HolyMoley hm;
-
-  hm.big.push_back(ooe);
-  hm.big.push_back(n.my_ooe);
-  hm.big[0].a_bite = 0x22;
-  hm.big[1].a_bite = 0x33;
-
-  std::vector<std::string> stage1;
-  stage1.push_back("and a one");
-  stage1.push_back("and a two");
-  hm.contain.insert(stage1);
-  stage1.clear();
-  stage1.push_back("then a one, two");
-  stage1.push_back("three!");
-  stage1.push_back("FOUR!!");
-  hm.contain.insert(stage1);
-  stage1.clear();
-  hm.contain.insert(stage1);
-
-  std::vector<Bonk> stage2;
-  hm.bonks["nothing"] = stage2;
-  stage2.resize(stage2.size() + 1);
-  stage2.back().type = 1;
-  stage2.back().message = "Wait.";
-  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.back().type = 3;
-  stage2.back().message = "quoth";
-  stage2.resize(stage2.size() + 1);
-  stage2.back().type = 4;
-  stage2.back().message = "the raven";
-  stage2.resize(stage2.size() + 1);
-  stage2.back().type = 5;
-  stage2.back().message = "nevermore";
-  hm.bonks["poe"] = stage2;
-
-  // cout << apache::thrift::ThriftDebugString(hm) << endl << endl;
-
-  shared_ptr<TMemoryBuffer> buffer(new TMemoryBuffer());
-  shared_ptr<TDenseProtocol> proto(new TDenseProtocol(buffer));
-  proto->setTypeSpec(HolyMoley::local_reflection);
-
-  hm.write(proto.get());
-  HolyMoley hm2;
-  hm2.read(proto.get());
-
-  BOOST_CHECK(hm == hm2);
-}
-
-/*
- * Following Testcases are currently disabled, because vlqWrite and vlqRead are
- * private members.
- */
-#if 0
-#define checkout(i, c)                                                          \
-  {                                                                             \
-    uint64_t vlq;                                                               \
-    buffer->resetBuffer();                                                      \
-    proto->vlqWrite(i);                                                         \
-    proto->getTransport()->flush();                                             \
-    BOOST_CHECK(my_memeq(buffer->getBufferAsString().data(), c, sizeof(c) - 1));\
-    proto->vlqRead(vlq);                                                        \
-    assert(vlq == i);                                                           \
-  }
-
-BOOST_AUTO_TEST_CASE(test_dense_proto_2) {
-  // Let's test out the variable-length ints, shall we?
-  shared_ptr<TMemoryBuffer> buffer(new TMemoryBuffer());
-  shared_ptr<TDenseProtocol> proto(new TDenseProtocol(buffer));
-
-  proto->setTypeSpec(HolyMoley::local_reflection);
-
-  checkout(0x00000000, "\x00");
-  checkout(0x00000040, "\x40");
-  checkout(0x0000007F, "\x7F");
-  checkout(0x00000080, "\x81\x00");
-  checkout(0x00002000, "\xC0\x00");
-  checkout(0x00003FFF, "\xFF\x7F");
-  checkout(0x00004000, "\x81\x80\x00");
-  checkout(0x00100000, "\xC0\x80\x00");
-  checkout(0x001FFFFF, "\xFF\xFF\x7F");
-  checkout(0x00200000, "\x81\x80\x80\x00");
-  checkout(0x08000000, "\xC0\x80\x80\x00");
-  checkout(0x0FFFFFFF, "\xFF\xFF\xFF\x7F");
-  checkout(0x10000000, "\x81\x80\x80\x80\x00");
-  checkout(0x20000000, "\x82\x80\x80\x80\x00");
-  checkout(0x1FFFFFFF, "\x81\xFF\xFF\xFF\x7F");
-  checkout(0xFFFFFFFF, "\x8F\xFF\xFF\xFF\x7F");
-
-  checkout(0x0000000100000000ull, "\x90\x80\x80\x80\x00");
-  checkout(0x0000000200000000ull, "\xA0\x80\x80\x80\x00");
-  checkout(0x0000000300000000ull, "\xB0\x80\x80\x80\x00");
-  checkout(0x0000000700000000ull, "\xF0\x80\x80\x80\x00");
-  checkout(0x00000007F0000000ull, "\xFF\x80\x80\x80\x00");
-  checkout(0x00000007FFFFFFFFull, "\xFF\xFF\xFF\xFF\x7F");
-  checkout(0x0000000800000000ull, "\x81\x80\x80\x80\x80\x00");
-  checkout(0x1FFFFFFFFFFFFFFFull, "\x9F\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x7F");
-  checkout(0x7FFFFFFFFFFFFFFFull, "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x7F");
-  checkout(0xFFFFFFFFFFFFFFFFull, "\x81\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x7F");
-}
-
-BOOST_AUTO_TEST_CASE(test_dense_proto_3) {
-  // Test out the slow path with a TBufferedTransport.
-  shared_ptr<TMemoryBuffer> buffer(new TMemoryBuffer());
-  shared_ptr<TDenseProtocol> proto(new TDenseProtocol(buffer));
-  shared_ptr<TBufferedTransport> buff_trans(new TBufferedTransport(buffer, 3));
-
-  proto->setTypeSpec(HolyMoley::local_reflection);
-  proto.reset(new TDenseProtocol(buff_trans));
-
-  checkout(0x0000000100000000ull, "\x90\x80\x80\x80\x00");
-  checkout(0x0000000200000000ull, "\xA0\x80\x80\x80\x00");
-  checkout(0x0000000300000000ull, "\xB0\x80\x80\x80\x00");
-  checkout(0x0000000700000000ull, "\xF0\x80\x80\x80\x00");
-  checkout(0x00000007F0000000ull, "\xFF\x80\x80\x80\x00");
-  checkout(0x00000007FFFFFFFFull, "\xFF\xFF\xFF\xFF\x7F");
-  checkout(0x0000000800000000ull, "\x81\x80\x80\x80\x80\x00");
-  checkout(0x1FFFFFFFFFFFFFFFull, "\x9F\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x7F");
-  checkout(0x7FFFFFFFFFFFFFFFull, "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x7F");
-  checkout(0xFFFFFFFFFFFFFFFFull, "\x81\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x7F");
-}
-#endif
-
-// Test optional stuff.
-BOOST_AUTO_TEST_CASE(test_dense_proto_4_1) {
-  shared_ptr<TMemoryBuffer> buffer(new TMemoryBuffer());
-  shared_ptr<TDenseProtocol> proto(new TDenseProtocol(buffer));
-  proto.reset(new TDenseProtocol(buffer));
-  proto->setTypeSpec(ManyOpt::local_reflection);
-
-  ManyOpt mo1, mo2;
-  mo1.opt1 = 923759347;
-  mo1.opt2 = 392749274;
-  mo1.opt3 = 395739402;
-  mo1.def4 = 294730928;
-  mo1.opt5 = 394309218;
-  mo1.opt6 = 832194723;
-  mo1.__isset.opt1 = true;
-  mo1.__isset.opt2 = true;
-  mo1.__isset.opt3 = true;
-  mo1.__isset.def4 = true;
-  mo1.__isset.opt5 = true;
-  mo1.__isset.opt6 = true;
-
-  mo1.write(proto.get());
-  mo2.read(proto.get());
-
-  BOOST_CHECK(mo2.__isset.opt1 == true);
-  BOOST_CHECK(mo2.__isset.opt2 == true);
-  BOOST_CHECK(mo2.__isset.opt3 == true);
-  BOOST_CHECK(mo2.__isset.def4 == true);
-  BOOST_CHECK(mo2.__isset.opt5 == true);
-  BOOST_CHECK(mo2.__isset.opt6 == true);
-
-  BOOST_CHECK(mo1 == mo2);
-}
-
-BOOST_AUTO_TEST_CASE(test_dense_proto_4_2) {
-  shared_ptr<TMemoryBuffer> buffer(new TMemoryBuffer());
-  shared_ptr<TDenseProtocol> proto(new TDenseProtocol(buffer));
-  proto.reset(new TDenseProtocol(buffer));
-  proto->setTypeSpec(ManyOpt::local_reflection);
-
-  ManyOpt mo1, mo2;
-  mo1.opt1 = 923759347;
-  mo1.opt2 = 392749274;
-  mo1.opt3 = 395739402;
-  mo1.def4 = 294730928;
-  mo1.opt5 = 394309218;
-  mo1.opt6 = 832194723;
-  mo1.__isset.opt1 = false;
-  mo1.__isset.opt2 = true;
-  mo1.__isset.opt3 = false;
-  mo1.__isset.def4 = true;
-  mo1.__isset.opt5 = false;
-  mo1.__isset.opt6 = true;
-
-  mo1.write(proto.get());
-  mo2.read(proto.get());
-
-  BOOST_CHECK(mo2.__isset.opt1 == false);
-  BOOST_CHECK(mo2.__isset.opt2 == true);
-  BOOST_CHECK(mo2.__isset.opt3 == false);
-  BOOST_CHECK(mo2.__isset.def4 == true);
-  BOOST_CHECK(mo2.__isset.opt5 == false);
-  BOOST_CHECK(mo2.__isset.opt6 == true);
-
-  BOOST_CHECK(mo1 == mo2);
-}
-
-BOOST_AUTO_TEST_CASE(test_dense_proto_4_3) {
-  shared_ptr<TMemoryBuffer> buffer(new TMemoryBuffer());
-  shared_ptr<TDenseProtocol> proto(new TDenseProtocol(buffer));
-  proto.reset(new TDenseProtocol(buffer));
-  proto->setTypeSpec(ManyOpt::local_reflection);
-
-  ManyOpt mo1, mo2;
-  mo1.opt1 = 923759347;
-  mo1.opt2 = 392749274;
-  mo1.opt3 = 395739402;
-  mo1.def4 = 294730928;
-  mo1.opt5 = 394309218;
-  mo1.opt6 = 832194723;
-  mo1.__isset.opt1 = true;
-  mo1.__isset.opt2 = false;
-  mo1.__isset.opt3 = true;
-  mo1.__isset.def4 = true;
-  mo1.__isset.opt5 = true;
-  mo1.__isset.opt6 = false;
-
-  mo1.write(proto.get());
-  mo2.read(proto.get());
-
-  BOOST_CHECK(mo2.__isset.opt1 == true);
-  BOOST_CHECK(mo2.__isset.opt2 == false);
-  BOOST_CHECK(mo2.__isset.opt3 == true);
-  BOOST_CHECK(mo2.__isset.def4 == true);
-  BOOST_CHECK(mo2.__isset.opt5 == true);
-  BOOST_CHECK(mo2.__isset.opt6 == false);
-
-  BOOST_CHECK(mo1 == mo2);
-}
-
-BOOST_AUTO_TEST_CASE(test_dense_proto_4_4) {
-  shared_ptr<TMemoryBuffer> buffer(new TMemoryBuffer());
-  shared_ptr<TDenseProtocol> proto(new TDenseProtocol(buffer));
-  proto.reset(new TDenseProtocol(buffer));
-  proto->setTypeSpec(ManyOpt::local_reflection);
-
-  ManyOpt mo1, mo2;
-  mo1.opt1 = 923759347;
-  mo1.opt2 = 392749274;
-  mo1.opt3 = 395739402;
-  mo1.def4 = 294730928;
-  mo1.opt5 = 394309218;
-  mo1.opt6 = 832194723;
-  mo1.__isset.opt1 = false;
-  mo1.__isset.opt2 = false;
-  mo1.__isset.opt3 = true;
-  mo1.__isset.def4 = true;
-  mo1.__isset.opt5 = false;
-  mo1.__isset.opt6 = false;
-
-  mo1.write(proto.get());
-  mo2.read(proto.get());
-
-  BOOST_CHECK(mo2.__isset.opt1 == false);
-  BOOST_CHECK(mo2.__isset.opt2 == false);
-  BOOST_CHECK(mo2.__isset.opt3 == true);
-  BOOST_CHECK(mo2.__isset.def4 == true);
-  BOOST_CHECK(mo2.__isset.opt5 == false);
-  BOOST_CHECK(mo2.__isset.opt6 == false);
-
-  BOOST_CHECK(mo1 == mo2);
-}
-
-BOOST_AUTO_TEST_CASE(test_dense_proto_4_5) {
-  shared_ptr<TMemoryBuffer> buffer(new TMemoryBuffer());
-  shared_ptr<TDenseProtocol> proto(new TDenseProtocol(buffer));
-  proto.reset(new TDenseProtocol(buffer));
-  proto->setTypeSpec(ManyOpt::local_reflection);
-
-  ManyOpt mo1, mo2;
-  mo1.opt1 = 923759347;
-  mo1.opt2 = 392749274;
-  mo1.opt3 = 395739402;
-  mo1.def4 = 294730928;
-  mo1.opt5 = 394309218;
-  mo1.opt6 = 832194723;
-  mo1.__isset.opt1 = false;
-  mo1.__isset.opt2 = false;
-  mo1.__isset.opt3 = false;
-  mo1.__isset.def4 = true;
-  mo1.__isset.opt5 = false;
-  mo1.__isset.opt6 = false;
-
-  mo1.write(proto.get());
-  mo2.read(proto.get());
-
-  BOOST_CHECK(mo2.__isset.opt1 == false);
-  BOOST_CHECK(mo2.__isset.opt2 == false);
-  BOOST_CHECK(mo2.__isset.opt3 == false);
-  BOOST_CHECK(mo2.__isset.def4 == true);
-  BOOST_CHECK(mo2.__isset.opt5 == false);
-  BOOST_CHECK(mo2.__isset.opt6 == false);
-
-  BOOST_CHECK(mo1 == mo2);
-}
-
-// Test fingerprint checking stuff.
-BOOST_AUTO_TEST_CASE(test_dense_proto_5_1) {
-  shared_ptr<TMemoryBuffer> buffer(new TMemoryBuffer());
-  shared_ptr<TDenseProtocol> proto(new TDenseProtocol(buffer));
-
-  // Default and required have the same fingerprint.
-  Tricky1 t1;
-  Tricky3 t3;
-  BOOST_CHECK(string(Tricky1::ascii_fingerprint) == Tricky3::ascii_fingerprint);
-  proto->setTypeSpec(Tricky1::local_reflection);
-  t1.im_default = 227;
-  t1.write(proto.get());
-  proto->setTypeSpec(Tricky3::local_reflection);
-  t3.read(proto.get());
-  BOOST_CHECK(t3.im_required == 227);
-}
-
-BOOST_AUTO_TEST_CASE(test_dense_proto_5_2) {
-  shared_ptr<TMemoryBuffer> buffer(new TMemoryBuffer());
-  shared_ptr<TDenseProtocol> proto(new TDenseProtocol(buffer));
-
-  // Optional changes things.
-  Tricky1 t1;
-  Tricky2 t2;
-  BOOST_CHECK(string(Tricky1::ascii_fingerprint) != Tricky2::ascii_fingerprint);
-  proto->setTypeSpec(Tricky1::local_reflection);
-  t1.im_default = 227;
-  t1.write(proto.get());
-  try {
-    proto->setTypeSpec(Tricky2::local_reflection);
-    t2.read(proto.get());
-    BOOST_CHECK(false);
-  } catch (TProtocolException& ex) {
-    buffer->resetBuffer();
-  }
-}
-
-BOOST_AUTO_TEST_CASE(test_dense_proto_5_3) {
-  shared_ptr<TMemoryBuffer> buffer(new TMemoryBuffer());
-  shared_ptr<TDenseProtocol> proto(new TDenseProtocol(buffer));
-
-  // Holy cow.  We can use the Tricky1 typespec with the Tricky2 structure.
-  Tricky1 t1;
-  Tricky2 t2;
-  proto->setTypeSpec(Tricky1::local_reflection);
-  t1.im_default = 227;
-  t1.write(proto.get());
-  t2.read(proto.get());
-  BOOST_CHECK(t2.__isset.im_optional == true);
-  BOOST_CHECK(t2.im_optional == 227);
-}
-
-BOOST_AUTO_TEST_CASE(test_dense_proto_5_4) {
-  shared_ptr<TMemoryBuffer> buffer(new TMemoryBuffer());
-  shared_ptr<TDenseProtocol> proto(new TDenseProtocol(buffer));
-
-  // And totally off the wall.
-  Tricky1 t1;
-  OneOfEach ooe2;
-  BOOST_CHECK(string(Tricky1::ascii_fingerprint) != OneOfEach::ascii_fingerprint);
-  proto->setTypeSpec(Tricky1::local_reflection);
-  t1.im_default = 227;
-  t1.write(proto.get());
-  try {
-    proto->setTypeSpec(OneOfEach::local_reflection);
-    ooe2.read(proto.get());
-    BOOST_CHECK(false);
-  } catch (TProtocolException& ex) {
-    buffer->resetBuffer();
-  }
-}
-
-BOOST_AUTO_TEST_CASE(test_dense_proto_6) {
-  // Okay, this is really off the wall.
-  // Just don't crash.
-  shared_ptr<TMemoryBuffer> buffer(new TMemoryBuffer());
-  shared_ptr<TDenseProtocol> proto(new TDenseProtocol(buffer));
-
-  BOOST_TEST_MESSAGE("Starting fuzz test.  This takes a while.");
-  std::srand(12345);
-  for (int i = 0; i < 2000; i++) {
-    if (i % 100 == 0) {
-      BOOST_TEST_MESSAGE("Do " << i / 100 << "/" << 2000 / 100);
-    }
-    buffer->resetBuffer();
-    // Make sure the fingerprint prefix is right.
-    buffer->write(Nesting::binary_fingerprint, 4);
-    for (int j = 0; j < 1024 * 1024; j++) {
-      uint8_t r = std::rand();
-      buffer->write(&r, 1);
-    }
-    Nesting n;
-    proto->setTypeSpec(OneOfEach::local_reflection);
-    try {
-      n.read(proto.get());
-    } catch (TProtocolException& ex) {
-    } catch (TTransportException& ex) {
-    }
-  }
-}
diff --git a/lib/cpp/test/Makefile.am b/lib/cpp/test/Makefile.am
index 70efa6b..dadbe38 100755
--- a/lib/cpp/test/Makefile.am
+++ b/lib/cpp/test/Makefile.am
@@ -89,8 +89,7 @@
 	TFileTransportTest \
 	link_test \
 	OpenSSLManualInitTest \
-	EnumTest \
-	DenseProtoTest
+	EnumTest
 
 if AMX_HAVE_LIBEVENT
 noinst_PROGRAMS += \
@@ -276,16 +275,6 @@
 	$(BOOST_TEST_LDADD)
 
 #
-# DenseProtoTest
-#
-DenseProtoTest_SOURCES = \
-	DenseProtoTest.cpp
-
-DenseProtoTest_LDADD = \
-	libtestgencpp.la \
-	$(BOOST_TEST_LDADD)
-
-#
 # SpecializationTest
 #
 SpecializationTest_SOURCES = \
@@ -337,7 +326,7 @@
 THRIFT = $(top_builddir)/compiler/cpp/thrift
 
 gen-cpp/DebugProtoTest_types.cpp gen-cpp/DebugProtoTest_types.h gen-cpp/EmptyService.cpp gen-cpp/EmptyService.h: $(top_srcdir)/test/DebugProtoTest.thrift
-	$(THRIFT) --gen cpp:dense $<
+	$(THRIFT) --gen cpp $<
 
 gen-cpp/EnumTest_types.cpp gen-cpp/EnumTest_types.h: $(top_srcdir)/test/EnumTest.thrift
 	$(THRIFT) --gen cpp $<
@@ -346,16 +335,16 @@
 	$(THRIFT) --gen cpp $<
 
 gen-cpp/OptionalRequiredTest_types.cpp gen-cpp/OptionalRequiredTest_types.h: $(top_srcdir)/test/OptionalRequiredTest.thrift
-	$(THRIFT) --gen cpp:dense $<
+	$(THRIFT) --gen cpp $<
 
 gen-cpp/Recursive_types.cpp gen-cpp/Recursive_types.h: $(top_srcdir)/test/Recursive.thrift
 	$(THRIFT) --gen cpp $<
 
 gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp: $(top_srcdir)/test/StressTest.thrift
-	$(THRIFT) --gen cpp:dense $<
+	$(THRIFT) --gen cpp $<
 
 gen-cpp/SecondService.cpp gen-cpp/ThriftTest_constants.cpp gen-cpp/ThriftTest.cpp gen-cpp/ThriftTest_types.cpp gen-cpp/ThriftTest_types.h: $(top_srcdir)/test/ThriftTest.thrift
-	$(THRIFT) --gen cpp:dense $<
+	$(THRIFT) --gen cpp $<
 
 gen-cpp/ChildService.cpp gen-cpp/ChildService.h gen-cpp/ParentService.cpp gen-cpp/ParentService.h gen-cpp/proc_types.cpp gen-cpp/proc_types.h: processor/proc.thrift
 	$(THRIFT) --gen cpp:templates,cob_style $<