aboutsummaryrefslogtreecommitdiff
path: root/conformance/conformance_test.h
diff options
context:
space:
mode:
authorYilun Chong <yilunchong@google.com>2017-06-26 17:46:34 -0700
committerYilun Chong <yilunchong@google.com>2017-06-26 17:46:34 -0700
commit2ad74e1606728564cc777aa4917d7e2299317eda (patch)
tree9fcffc5af50f168b3fce9e769a1d98dceda6d932 /conformance/conformance_test.h
parent4e67590e1b42897b674d6bfdae3b7c8f1d4cf5e5 (diff)
downloadprotobuf-2ad74e1606728564cc777aa4917d7e2299317eda.tar.gz
protobuf-2ad74e1606728564cc777aa4917d7e2299317eda.tar.bz2
protobuf-2ad74e1606728564cc777aa4917d7e2299317eda.zip
add support for proto2
Diffstat (limited to 'conformance/conformance_test.h')
-rw-r--r--conformance/conformance_test.h21
1 files changed, 14 insertions, 7 deletions
diff --git a/conformance/conformance_test.h b/conformance/conformance_test.h
index 4e40a6ac..6bfcd72f 100644
--- a/conformance/conformance_test.h
+++ b/conformance/conformance_test.h
@@ -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,
@@ -174,14 +175,17 @@ class ConformanceTestSuite {
const string& test_name,
ConformanceLevel level,
const protobuf_test_messages::proto3::TestAllTypes& input,
- const string& equivalent_text_format);
+ const string& equivalent_text_format,
+ bool isProto3);
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 string& equivalent_text_format,
+ bool isProto3);
typedef std::function<bool(const Json::Value&)> Validator;
void RunValidJsonTestWithValidator(const string& test_name,
@@ -196,15 +200,18 @@ class ConformanceTestSuite {
const string& text_format);
void ExpectParseFailureForProto(const std::string& proto,
const std::string& test_name,
- ConformanceLevel level);
+ ConformanceLevel level,
+ bool isProto3);
void ExpectHardParseFailureForProto(const std::string& proto,
const std::string& test_name,
- ConformanceLevel level);
+ ConformanceLevel level,
+ bool isProto3);
void TestPrematureEOFForType(google::protobuf::FieldDescriptor::Type type);
void TestIllegalTags();
void TestValidDataForType(
google::protobuf::FieldDescriptor::Type,
- std::vector<std::pair<std::string, std::string>> values);
+ std::vector<std::pair<std::string, std::string>> values,
+ bool isProto3);
bool CheckSetEmpty(const set<string>& set_to_check,
const std::string& write_to_file, const std::string& msg);
ConformanceTestRunner* runner_;