thrift/lib/cpp/test
Jens Geyer ae0b22cc29 THRIFT-2513 clean up enum value assignment
Patch: Dave Watson

This closes #88

Summary:
Clean up how enum values are handled if an integer value is not
explicitly specified in the thrift file.

For example, the following used to be a compile error, but
works now:

  enum MyEnum {
	SOMEVALUE
  }
  struct MyStruct {
	1: MyEnum e = SOMEVALUE
  }

This change also cleans up some of the error handling with out-of-range
values.  Previously thrift simply issued a warning for enum values that
didn't fit in an i32, but serialized them as i32 anyway.  Now
out-of-range enum values result in a compile failure.

Test Plan:
Included a new unit test to verify the assignment of enum values.  I
also verified that g++ makes the same enum value assignments when
compiling these enums as C++ code.
2014-09-04 23:40:14 +02:00
..
concurrency THRIFT-2089 Compiler ignores duplicate typenames 2013-07-15 22:41:34 +02:00
link THRIFT-2520 cpp:cob_style generates incorrect .tcc file 2014-06-15 21:51:32 +02:00
processor Thrift-1607:Incorrect file modes for several source files 2012-05-17 05:41:09 +00:00
AllProtocolTests.cpp THRIFT-1552 Include paths for c/c++ should be prefixed with 'thrift/' 2012-04-13 09:12:31 +00:00
AllProtocolTests.tcc Thrift-2029:Port C++ tests to Windows 2014-01-07 21:42:01 -05:00
Base64Test.cpp THRIFT-1612 Base64 encoding is broken 2012-05-27 18:05:16 +00:00
Benchmark.cpp THRIFT-2352 msvc failed to compile thrift tests 2014-02-09 11:31:02 +01:00
DebugProtoTest_extras.cpp THRIFT-916 compile with -Wall -Wextra without warning on Debian Lenny 2010-11-17 22:11:26 +00:00
DebugProtoTest.cpp Thrift-2029:Port C++ tests to Windows 2014-01-07 21:42:01 -05:00
DenseProtoTest.cpp THRIFT-1552 Include paths for c/c++ should be prefixed with 'thrift/' 2012-04-13 09:12:31 +00:00
EnumTest.cpp THRIFT-2513 clean up enum value assignment 2014-09-04 23:40:14 +02:00
GenericHelpers.h THRIFT-1552 Include paths for c/c++ should be prefixed with 'thrift/' 2012-04-13 09:12:31 +00:00
JSONProtoTest.cpp THRIFT-2352 msvc failed to compile thrift tests 2014-02-09 11:31:02 +01:00
Makefile.am THRIFT-2513 clean up enum value assignment 2014-09-04 23:40:14 +02:00
OpenSSLManualInitTest.cpp Add unit test for OpenSSL manual initialization 2014-07-26 22:13:55 +02:00
OptionalRequiredTest.cpp Thrift-2029:Port C++ tests to Windows 2014-01-07 21:42:01 -05:00
RecursiveTest.cpp THRIFT-2471 Make cpp.ref annotation language agnostic 2014-05-02 21:31:55 +02:00
RWMutexStarveTest.cpp THRIFT-1552 Include paths for c/c++ should be prefixed with 'thrift/' 2012-04-13 09:12:31 +00:00
SpecializationTest.cpp Thrift-2029:Port C++ tests to Windows 2014-01-07 21:42:01 -05:00
TBufferBaseTest.cpp Thrift-2029:Port C++ tests to Windows 2014-01-07 21:42:01 -05:00
TFDTransportTest.cpp THRIFT-2577 C++ TFileTransport missuse of closesocket on windows platform 2014-06-24 16:08:22 +02:00
TFileTransportTest.cpp THRIFT-2316 cpp: TFileTransportTest is to restrictive 2014-01-15 10:13:18 +01:00
ThriftTest_extras.cpp THRIFT-1552 Include paths for c/c++ should be prefixed with 'thrift/' 2012-04-13 09:12:31 +00:00
TMemoryBufferTest.cpp Thrift-2029:Port C++ tests to Windows 2014-01-07 21:42:01 -05:00
ToStringTest.cpp THRIFT-2067 C++: all generated objects provide ostream operator<< 2014-09-03 23:41:32 +02:00
TPipedTransportTest.cpp THRIFT-1552 Include paths for c/c++ should be prefixed with 'thrift/' 2012-04-13 09:12:31 +00:00
TransportTest.cpp Thrift-2029:Port C++ tests to Windows 2014-01-07 21:42:01 -05:00
UnitTestMain.cpp THRIFT-953: Fix compilation of TransportTest.cpp on Mac (actual tests still fail) and fix boost m4 macros for Mac. 2010-11-04 18:51:42 +00:00
ZlibTest.cpp Thrift-2029:Port C++ tests to Windows 2014-01-07 21:42:01 -05:00