From eec827df1b4b951f5a7fbcdd4b6e509d0002e1fd Mon Sep 17 00:00:00 2001 From: Adam Cozzette Date: Thu, 29 Aug 2024 15:23:48 -0700 Subject: [PATCH] Fix any_test.cc on 32-bit Windows This test case attempts to pack an Any with a message over 2 GiB in size, but the allocation is failing in our 32-bit Windows test. This change should fix the problem by skipping the test case on 32-bit platforms. PiperOrigin-RevId: 669082000 --- src/google/protobuf/any_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/google/protobuf/any_test.cc b/src/google/protobuf/any_test.cc index 7561b02d9352..3b041716788d 100644 --- a/src/google/protobuf/any_test.cc +++ b/src/google/protobuf/any_test.cc @@ -45,7 +45,7 @@ TEST(AnyTest, TestPackAndUnpack) { } TEST(AnyTest, TestPackFromSerializationExceedsSizeLimit) { - if (std::string().max_size() < INT_MAX) { + if (sizeof(size_t) == 4) { GTEST_SKIP() << "This toolchain can't allocate that much memory."; } protobuf_unittest::TestAny submessage;