aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/message_unittest.cc
diff options
context:
space:
mode:
authorJisi Liu <jisi.liu@gmail.com>2017-08-22 12:59:32 -0700
committerJisi Liu <jisi.liu@gmail.com>2017-08-22 12:59:32 -0700
commit6609e521245ab788bbd9b773a9f668bfc15f6c29 (patch)
treef7ce68369e0f11d25bb90ff08fd1b372e6e46e1d /src/google/protobuf/message_unittest.cc
parente416f5d2d3fd9f0ce505ae25732eada12d636a12 (diff)
downloadprotobuf-6609e521245ab788bbd9b773a9f668bfc15f6c29.tar.gz
protobuf-6609e521245ab788bbd9b773a9f668bfc15f6c29.tar.bz2
protobuf-6609e521245ab788bbd9b773a9f668bfc15f6c29.zip
Disable death tests on windows
Also remove cord related code
Diffstat (limited to 'src/google/protobuf/message_unittest.cc')
-rw-r--r--src/google/protobuf/message_unittest.cc38
1 files changed, 0 insertions, 38 deletions
diff --git a/src/google/protobuf/message_unittest.cc b/src/google/protobuf/message_unittest.cc
index fe456677..06a7f65c 100644
--- a/src/google/protobuf/message_unittest.cc
+++ b/src/google/protobuf/message_unittest.cc
@@ -257,44 +257,6 @@ TEST(MessageTest, CheckInitialized) {
"fields: a, b, c");
}
-TEST(MessageTest, CheckOverflow) {
- unittest::TestAllTypes message;
- // Create a message with size just over 2GB. This triggers integer overflow
- // when computing message size.
- const string data(1024, 'x');
- Cord one_megabyte;
- for (int i = 0; i < 1024; i++) {
- one_megabyte.Append(data);
- }
-
- for (int i = 0; i < 2 * 1024 + 1; ++i) {
- message.add_repeated_cord()->CopyFrom(one_megabyte);
- }
-
- Cord serialized;
- EXPECT_FALSE(message.AppendToCord(&serialized));
-}
-
-TEST(MessageTest, CheckBigOverflow) {
- // Checking for 4GB buffers on 32 bit systems is problematic.
- if (sizeof(void*) < 8) return;
- unittest::TestAllTypes message;
- // Create a message with size just over 4GB. We should be able to detect this
- // too, even though it will make a plain "int" wrap back to a positive number.
- const string data(1024, 'x');
- Cord one_megabyte;
- for (int i = 0; i < 1024; i++) {
- one_megabyte.Append(data);
- }
-
- for (int i = 0; i < 4 * 1024 + 1; ++i) {
- message.add_repeated_cord()->CopyFrom(one_megabyte);
- }
-
- Cord serialized;
- EXPECT_FALSE(message.AppendToCord(&serialized));
-}
-
#endif // PROTOBUF_HAS_DEATH_TEST
namespace {