Googletest export

This change updates testing::internal::IsAProtocolMessage to return true not
just for full proto messages but also for lite ones (i.e. those inheriting
directly from MessageLite).

PiperOrigin-RevId: 304286535
This commit is contained in:
Abseil Team
2020-04-01 19:33:24 -04:00
committed by Andy Getz
parent 61f010d703
commit c344cb5a8d
2 changed files with 7 additions and 5 deletions

View File

@@ -7104,7 +7104,7 @@ class ConversionHelperDerived : public ConversionHelperBase {};
// Tests that IsAProtocolMessage<T>::value is a compile-time constant.
TEST(IsAProtocolMessageTest, ValueIsCompileTimeConstant) {
GTEST_COMPILE_ASSERT_(IsAProtocolMessage<::proto2::Message>::value,
GTEST_COMPILE_ASSERT_(IsAProtocolMessage<::proto2::MessageLite>::value,
const_true);
GTEST_COMPILE_ASSERT_(!IsAProtocolMessage<int>::value, const_false);
}
@@ -7112,7 +7112,7 @@ TEST(IsAProtocolMessageTest, ValueIsCompileTimeConstant) {
// Tests that IsAProtocolMessage<T>::value is true when T is
// proto2::Message or a sub-class of it.
TEST(IsAProtocolMessageTest, ValueIsTrueWhenTypeIsAProtocolMessage) {
EXPECT_TRUE(IsAProtocolMessage< ::proto2::Message>::value);
EXPECT_TRUE(IsAProtocolMessage<::proto2::MessageLite>::value);
}
// Tests that IsAProtocolMessage<T>::value is false when T is neither