Commit 678c1c73 authored by Tom Hughes's avatar Tom Hughes Committed by Copybara-Service
Browse files

Fix compilation of googletest-printers-test.cc when using -Wundef

#3267

PiperOrigin-RevId: 514858420
Change-Id: Ic712aafad25f5e63ae48f647557de95cef890978
parent cf4f4400
...@@ -1796,7 +1796,8 @@ TEST(UniversalPrintTest, SmartPointers) { ...@@ -1796,7 +1796,8 @@ TEST(UniversalPrintTest, SmartPointers) {
std::shared_ptr<int> p3(new int(1979)); std::shared_ptr<int> p3(new int(1979));
EXPECT_EQ("(ptr = " + PrintPointer(p3.get()) + ", value = 1979)", EXPECT_EQ("(ptr = " + PrintPointer(p3.get()) + ", value = 1979)",
PrintToString(p3)); PrintToString(p3));
#if __cpp_lib_shared_ptr_arrays >= 201611L #if defined(__cpp_lib_shared_ptr_arrays) && \
(__cpp_lib_shared_ptr_arrays >= 201611L)
std::shared_ptr<int[]> p4(new int[2]); std::shared_ptr<int[]> p4(new int[2]);
EXPECT_EQ("(" + PrintPointer(p4.get()) + ")", PrintToString(p4)); EXPECT_EQ("(" + PrintPointer(p4.get()) + ")", PrintToString(p4));
#endif #endif
...@@ -1815,7 +1816,8 @@ TEST(UniversalPrintTest, SmartPointers) { ...@@ -1815,7 +1816,8 @@ TEST(UniversalPrintTest, SmartPointers) {
EXPECT_EQ("(nullptr)", PrintToString(std::shared_ptr<const int>())); EXPECT_EQ("(nullptr)", PrintToString(std::shared_ptr<const int>()));
EXPECT_EQ("(nullptr)", PrintToString(std::shared_ptr<volatile int>())); EXPECT_EQ("(nullptr)", PrintToString(std::shared_ptr<volatile int>()));
EXPECT_EQ("(nullptr)", PrintToString(std::shared_ptr<volatile const int>())); EXPECT_EQ("(nullptr)", PrintToString(std::shared_ptr<volatile const int>()));
#if __cpp_lib_shared_ptr_arrays >= 201611L #if defined(__cpp_lib_shared_ptr_arrays) && \
(__cpp_lib_shared_ptr_arrays >= 201611L)
EXPECT_EQ("(nullptr)", PrintToString(std::shared_ptr<int[]>())); EXPECT_EQ("(nullptr)", PrintToString(std::shared_ptr<int[]>()));
EXPECT_EQ("(nullptr)", PrintToString(std::shared_ptr<const int[]>())); EXPECT_EQ("(nullptr)", PrintToString(std::shared_ptr<const int[]>()));
EXPECT_EQ("(nullptr)", PrintToString(std::shared_ptr<volatile int[]>())); EXPECT_EQ("(nullptr)", PrintToString(std::shared_ptr<volatile int[]>()));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment