diff options
author | Adam Cozzette <acozzette@gmail.com> | 2017-05-01 10:58:38 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-01 10:58:38 -0700 |
commit | 2f4489a3e504e0a4aaffee69b551c6acc9e08374 (patch) | |
tree | 4cd6e883d0d92f39ebbaa0f6b4bf0f321a165df0 /conformance/conformance_test.cc | |
parent | 286f0598422a70639e587b5329bd3037f5ee76b0 (diff) | |
parent | 9053033a5076f82cf18b823c31f352e95e5bfd8d (diff) | |
download | protobuf-2f4489a3e504e0a4aaffee69b551c6acc9e08374.tar.gz protobuf-2f4489a3e504e0a4aaffee69b551c6acc9e08374.tar.bz2 protobuf-2f4489a3e504e0a4aaffee69b551c6acc9e08374.zip |
Merge pull request #3024 from acozzette/merge-3.3-to-master
Merged 3.3.x branch 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; |