MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / TEST_P

Function TEST_P

internal/message_equality_test.cc:102–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100}
101
102TEST_P(UnaryMessageEqualsTest, Equals) {
103 const auto* pool = GetTestingDescriptorPool();
104 auto* factory = GetTestingMessageFactory();
105 const auto& test_case = GetParam();
106 for (const auto& lhs : test_case.ops) {
107 for (const auto& rhs : test_case.ops) {
108 if (!test_case.equal && &lhs == &rhs) {
109 continue;
110 }
111 EXPECT_THAT(MessageEquals(*lhs, *rhs, pool, factory),
112 IsOkAndHolds(test_case.equal))
113 << lhs->ShortDebugString() << " " << rhs->ShortDebugString();
114 EXPECT_THAT(MessageEquals(*rhs, *lhs, pool, factory),
115 IsOkAndHolds(test_case.equal))
116 << lhs->ShortDebugString() << " " << rhs->ShortDebugString();
117 // Test any.
118 auto lhs_any = PackMessage(*lhs);
119 auto rhs_any = PackMessage(*rhs);
120 EXPECT_THAT(MessageEquals(*lhs_any, *rhs, pool, factory),
121 IsOkAndHolds(test_case.equal))
122 << lhs_any->ShortDebugString() << " " << rhs->ShortDebugString();
123 EXPECT_THAT(MessageEquals(*lhs, *rhs_any, pool, factory),
124 IsOkAndHolds(test_case.equal))
125 << lhs->ShortDebugString() << " " << rhs_any->ShortDebugString();
126 EXPECT_THAT(MessageEquals(*lhs_any, *rhs_any, pool, factory),
127 IsOkAndHolds(test_case.equal))
128 << lhs_any->ShortDebugString() << " " << rhs_any->ShortDebugString();
129 }
130 }
131}
132
133INSTANTIATE_TEST_SUITE_P(
134 UnaryMessageEqualsTest, UnaryMessageEqualsTest,

Callers

nothing calls this directly

Calls 9

MessageEqualsFunction · 0.85
PackMessageFunction · 0.85
MessageFieldEqualsFunction · 0.85
typeMethod · 0.80
FindFieldByNameMethod · 0.45
nameMethod · 0.45
GetMessageMethod · 0.45
GetReflectionMethod · 0.45

Tested by

no test coverage detected