aboutsummaryrefslogtreecommitdiffhomepage
path: root/conformance/conformance_test.h
diff options
context:
space:
mode:
Diffstat (limited to 'conformance/conformance_test.h')
-rw-r--r--conformance/conformance_test.h45
1 files changed, 34 insertions, 11 deletions
diff --git a/conformance/conformance_test.h b/conformance/conformance_test.h
index 08f16b8f..d1a822eb 100644
--- a/conformance/conformance_test.h
+++ b/conformance/conformance_test.h
@@ -49,9 +49,14 @@
namespace conformance {
class ConformanceRequest;
class ConformanceResponse;
-class TestAllTypes;
} // namespace conformance
+namespace protobuf_test_messages {
+namespace proto3 {
+class TestAllTypesProto3;
+} // namespace proto3
+} // namespace protobuf_test_messages
+
namespace google {
namespace protobuf {
@@ -160,19 +165,26 @@ 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,
const string& equivalent_text_format);
- void RunValidJsonTestWithProtobufInput(const string& test_name,
- ConformanceLevel level,
- const conformance::TestAllTypes& input,
- const string& equivalent_text_format);
- void RunValidProtobufTest(const string& test_name,
- ConformanceLevel level,
- const conformance::TestAllTypes& input,
- const string& equivalent_text_format);
+ void RunValidJsonTestWithProtobufInput(
+ const string& test_name,
+ ConformanceLevel level,
+ 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,
+ bool isProto3);
+ void RunValidProtobufTestWithMessage(
+ const string& test_name, ConformanceLevel level,
+ const Message *input,
+ const string& equivalent_text_format,
+ bool isProto3);
typedef std::function<bool(const Json::Value&)> Validator;
void RunValidJsonTestWithValidator(const string& test_name,
@@ -185,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);
@@ -192,7 +208,14 @@ class ConformanceTestSuite {
const std::string& test_name,
ConformanceLevel level);
void TestPrematureEOFForType(google::protobuf::FieldDescriptor::Type type);
- bool CheckSetEmpty(const set<string>& set_to_check,
+ 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);
+ bool CheckSetEmpty(const std::set<string>& set_to_check,
const std::string& write_to_file, const std::string& msg);
ConformanceTestRunner* runner_;
int successes_;