diff options
author | Adam Cozzette <acozzette@google.com> | 2017-04-27 14:55:53 -0700 |
---|---|---|
committer | Adam Cozzette <acozzette@google.com> | 2017-04-27 14:55:53 -0700 |
commit | 9053033a5076f82cf18b823c31f352e95e5bfd8d (patch) | |
tree | 1d2a2611f56e786d7c3e40b8fd1b2e3d9aff9025 /conformance/conformance_test.cc | |
parent | 067b1eec3bf852abaad0844999461baff8a5fdc8 (diff) | |
parent | a6189acd18b00611c1dc7042299ad75486f08a1a (diff) | |
download | protobuf-9053033a5076f82cf18b823c31f352e95e5bfd8d.tar.gz protobuf-9053033a5076f82cf18b823c31f352e95e5bfd8d.tar.bz2 protobuf-9053033a5076f82cf18b823c31f352e95e5bfd8d.zip |
Merge remote-tracking branch 'remotes/google/3.3.x' into merge-3.3-to-master
Diffstat (limited to 'conformance/conformance_test.cc')
-rw-r--r-- | conformance/conformance_test.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/conformance/conformance_test.cc b/conformance/conformance_test.cc index 1e5387a5..0dd7787c 100644 --- a/conformance/conformance_test.cc +++ b/conformance/conformance_test.cc @@ -708,6 +708,21 @@ bool ConformanceTestSuite::CheckSetEmpty(const set<string>& set_to_check, } } +void ConformanceTestSuite::TestIllegalTags() { + // field num 0 is illegal + string nullfield[] = { + "\1DEADBEEF", + "\2\1\1", + "\3\4", + "\5DEAD" + }; + for (int i = 0; i < 4; i++) { + string name = "IllegalZeroFieldNum_Case_0"; + name.back() += i; + ExpectParseFailureForProto(nullfield[i], name, REQUIRED); + } +} + bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner, std::string* output) { runner_ = runner; @@ -728,6 +743,8 @@ bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner, TestPrematureEOFForType(static_cast<FieldDescriptor::Type>(i)); } + TestIllegalTags(); + int64 kInt64Min = -9223372036854775808ULL; int64 kInt64Max = 9223372036854775807ULL; uint64 kUint64Max = 18446744073709551615ULL; |