diff options
author | temporal <temporal@630680e5-0e50-0410-840e-4b1c322b438d> | 2008-07-23 01:19:07 +0000 |
---|---|---|
committer | temporal <temporal@630680e5-0e50-0410-840e-4b1c322b438d> | 2008-07-23 01:19:07 +0000 |
commit | f206351d1469970230caa5f61eaa54797194bee1 (patch) | |
tree | 3b1b9ea37171fdb231bca2fe6c74492eeea2abd7 /src/google/protobuf/io/tokenizer_unittest.cc | |
parent | cc930432c2823c3d82e0b8dd2ae4f446c82f4fce (diff) | |
download | protobuf-f206351d1469970230caa5f61eaa54797194bee1.tar.gz protobuf-f206351d1469970230caa5f61eaa54797194bee1.tar.bz2 protobuf-f206351d1469970230caa5f61eaa54797194bee1.zip |
Sync code with Google-internal branch. Changes:
Protoc (parser)
- Improved error message when an enum value's name conflicts with another
symbol defined in the enum type's scope, e.g. if two enum types declared
in the same scope have values with the same name. This is disallowed for
compatibility with C++, but this wasn't clear from the error.
C++
- Restored the set_foo(const char*) accessor for "bytes" type because some
code inside Google depends on it. However, set_foo(const char*, int) is
still there (and actually is changed to take const void*).
- Fixed TokenizerTest when compiling with -DNDEBUG on Linux.
- Other irrelevant tweaks.
Java
- Fixed UnknownFieldSet's parsing of varints larger than 32 bits.
- Fixed TextFormat's parsing of "inf" and "nan".
- Fixed TextFormat's parsing of comments.
Python
- Fixed text_format_test on Windows where floating-point exponents sometimes
contain extra zeros.
Diffstat (limited to 'src/google/protobuf/io/tokenizer_unittest.cc')
-rw-r--r-- | src/google/protobuf/io/tokenizer_unittest.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/google/protobuf/io/tokenizer_unittest.cc b/src/google/protobuf/io/tokenizer_unittest.cc index e2cede7e..2171fcc3 100644 --- a/src/google/protobuf/io/tokenizer_unittest.cc +++ b/src/google/protobuf/io/tokenizer_unittest.cc @@ -477,22 +477,22 @@ TEST_F(TokenizerTest, ParseInteger) { // Test invalid integers that may still be tokenized as integers. EXPECT_EQ(0, ParseInteger("0x")); + uint64 i; #ifdef GTEST_HAS_DEATH_TEST // death tests do not work on Windows yet // Test invalid integers that will never be tokenized as integers. - EXPECT_DEBUG_DEATH(ParseInteger("zxy"), + EXPECT_DEBUG_DEATH(Tokenizer::ParseInteger("zxy", kuint64max, &i), "passed text that could not have been tokenized as an integer"); - EXPECT_DEBUG_DEATH(ParseInteger("1.2"), + EXPECT_DEBUG_DEATH(Tokenizer::ParseInteger("1.2", kuint64max, &i), "passed text that could not have been tokenized as an integer"); - EXPECT_DEBUG_DEATH(ParseInteger("08"), + EXPECT_DEBUG_DEATH(Tokenizer::ParseInteger("08", kuint64max, &i), "passed text that could not have been tokenized as an integer"); - EXPECT_DEBUG_DEATH(ParseInteger("0xg"), + EXPECT_DEBUG_DEATH(Tokenizer::ParseInteger("0xg", kuint64max, &i), "passed text that could not have been tokenized as an integer"); - EXPECT_DEBUG_DEATH(ParseInteger("-1"), + EXPECT_DEBUG_DEATH(Tokenizer::ParseInteger("-1", kuint64max, &i), "passed text that could not have been tokenized as an integer"); #endif // GTEST_HAS_DEATH_TEST // Test overflows. - uint64 i; EXPECT_TRUE (Tokenizer::ParseInteger("0", 0, &i)); EXPECT_FALSE(Tokenizer::ParseInteger("1", 0, &i)); EXPECT_TRUE (Tokenizer::ParseInteger("1", 1, &i)); |