diff options
author | Yilun Chong <chongyilun250@sina.com> | 2017-07-24 14:50:52 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-24 14:50:52 -0700 |
commit | a713b73076f1d90bdc39ea8805b50421a59d7986 (patch) | |
tree | cea38fdfe5c1d93b6291e96332961b2c3bf5439f /conformance/conformance_test.h | |
parent | f15185d370a5789c65105f77ba806c9faa563325 (diff) | |
parent | bceb830c396e3370d4cc15e0d4f96ed1819dcca9 (diff) | |
download | protobuf-a713b73076f1d90bdc39ea8805b50421a59d7986.tar.gz protobuf-a713b73076f1d90bdc39ea8805b50421a59d7986.tar.bz2 protobuf-a713b73076f1d90bdc39ea8805b50421a59d7986.zip |
Merge pull request #3281 from BSBandme/ConformanceTestYilunChong
Proto2 test message support to conformance test
Diffstat (limited to 'conformance/conformance_test.h')
-rw-r--r-- | conformance/conformance_test.h | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/conformance/conformance_test.h b/conformance/conformance_test.h index 581c7472..d1a822eb 100644 --- a/conformance/conformance_test.h +++ b/conformance/conformance_test.h @@ -53,7 +53,7 @@ class ConformanceResponse; namespace protobuf_test_messages { namespace proto3 { -class TestAllTypes; +class TestAllTypesProto3; } // namespace proto3 } // namespace protobuf_test_messages @@ -165,7 +165,8 @@ class ConformanceTestSuite { const string& input, conformance::WireFormat input_format, const string& equivalent_text_format, - conformance::WireFormat requested_output); + conformance::WireFormat requested_output, + bool isProto3); void RunValidJsonTest(const string& test_name, ConformanceLevel level, const string& input_json, @@ -173,15 +174,17 @@ class ConformanceTestSuite { void RunValidJsonTestWithProtobufInput( const string& test_name, ConformanceLevel level, - const protobuf_test_messages::proto3::TestAllTypes& input, + const protobuf_test_messages::proto3::TestAllTypesProto3& input, const string& equivalent_text_format); void RunValidProtobufTest(const string& test_name, ConformanceLevel level, const string& input_protobuf, - const string& equivalent_text_format); + const string& equivalent_text_format, + bool isProto3); void RunValidProtobufTestWithMessage( const string& test_name, ConformanceLevel level, - const protobuf_test_messages::proto3::TestAllTypes& input, - const string& equivalent_text_format); + const Message *input, + const string& equivalent_text_format, + bool isProto3); typedef std::function<bool(const Json::Value&)> Validator; void RunValidJsonTestWithValidator(const string& test_name, @@ -194,6 +197,10 @@ class ConformanceTestSuite { void ExpectSerializeFailureForJson(const string& test_name, ConformanceLevel level, const string& text_format); + void ExpectParseFailureForProtoWithProtoVersion (const string& proto, + const string& test_name, + ConformanceLevel level, + bool isProto3); void ExpectParseFailureForProto(const std::string& proto, const std::string& test_name, ConformanceLevel level); @@ -202,6 +209,9 @@ class ConformanceTestSuite { ConformanceLevel level); void TestPrematureEOFForType(google::protobuf::FieldDescriptor::Type type); void TestIllegalTags(); + template <class MessageType> + void TestOneofMessage (MessageType &message, + bool isProto3); void TestValidDataForType( google::protobuf::FieldDescriptor::Type, std::vector<std::pair<std::string, std::string>> values); |