THRIFT-1040 Can't end typedef lines with a semicolon
Client: Compiler (General)
Patch: Konrad Grochowski
diff --git a/lib/cpp/test/Makefile.am b/lib/cpp/test/Makefile.am
index b3f66bd..9c9b8d8 100755
--- a/lib/cpp/test/Makefile.am
+++ b/lib/cpp/test/Makefile.am
@@ -20,16 +20,17 @@
noinst_LTLIBRARIES = libtestgencpp.la libprocessortest.la
nodist_libtestgencpp_la_SOURCES = \
gen-cpp/DebugProtoTest_types.cpp \
+ gen-cpp/DebugProtoTest_types.h \
gen-cpp/EnumTest_types.cpp \
gen-cpp/EnumTest_types.h \
gen-cpp/OptionalRequiredTest_types.cpp \
- gen-cpp/DebugProtoTest_types.cpp \
- gen-cpp/ThriftTest_types.cpp \
- gen-cpp/DebugProtoTest_types.h \
gen-cpp/OptionalRequiredTest_types.h \
gen-cpp/Recursive_types.cpp \
gen-cpp/Recursive_types.h \
+ gen-cpp/ThriftTest_types.cpp \
gen-cpp/ThriftTest_types.h \
+ gen-cpp/TypedefTest_types.cpp \
+ gen-cpp/TypedefTest_types.h \
ThriftTest_extras.cpp \
DebugProtoTest_extras.cpp
@@ -86,7 +87,8 @@
TMemoryBufferTest.cpp \
TBufferBaseTest.cpp \
Base64Test.cpp \
- ToStringTest.cpp
+ ToStringTest.cpp \
+ TypedefTest.cpp
if !WITH_BOOSTTHREADS
UnitTests_SOURCES += \
@@ -120,7 +122,7 @@
EnumTest_LDADD = \
libtestgencpp.la \
- -l:libboost_unit_test_framework.a
+ -l:libboost_unit_test_framework.a
TFileTransportTest_SOURCES = \
TFileTransportTest.cpp
@@ -246,6 +248,9 @@
gen-cpp/EnumTest_types.cpp gen-cpp/EnumTest_types.h: $(top_srcdir)/test/EnumTest.thrift
$(THRIFT) --gen cpp:pure_enums $<
+gen-cpp/TypedefTest_types.cpp gen-cpp/TypedefTest_types.h: $(top_srcdir)/test/TypedefTest.thrift
+ $(THRIFT) --gen cpp $<
+
gen-cpp/OptionalRequiredTest_types.cpp gen-cpp/OptionalRequiredTest_types.h: $(top_srcdir)/test/OptionalRequiredTest.thrift
$(THRIFT) --gen cpp:dense $<
diff --git a/lib/cpp/test/TypedefTest.cpp b/lib/cpp/test/TypedefTest.cpp
new file mode 100644
index 0000000..45eb1e7
--- /dev/null
+++ b/lib/cpp/test/TypedefTest.cpp
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ */
+
+#include <boost/type_traits/is_same.hpp>
+#include <boost/static_assert.hpp>
+
+#include "gen-cpp/TypedefTest_types.h"
+
+BOOST_STATIC_ASSERT(boost::is_same<int32_t, thrift::test::MyInt32>::value);
+BOOST_STATIC_ASSERT(boost::is_same<std::string, thrift::test::MyString>::value);
+BOOST_STATIC_ASSERT(boost::is_same<thrift::test::TypedefTestStruct, thrift::test::MyStruct>::value);