| 69 | class ShapeTest : public ::testing::TestWithParam<ShapePair> {}; |
| 70 | |
| 71 | TEST_P(ShapeTest, Agrees) { |
| 72 | const ShapePair& param = GetParam(); |
| 73 | |
| 74 | switch (param.agreement) { |
| 75 | case Agreement::kBroadcast: { |
| 76 | EXPECT_TRUE(ShapesAgreeUpToBroadcasting(param.left, param.right)); |
| 77 | break; |
| 78 | } |
| 79 | case Agreement::kExtend: { |
| 80 | EXPECT_TRUE(ShapesAgreeUpToExtending(param.left, param.right)); |
| 81 | // Anything that extends should also broadcast. |
| 82 | EXPECT_TRUE(ShapesAgreeUpToBroadcasting(param.left, param.right)); |
| 83 | break; |
| 84 | } |
| 85 | case Agreement::kBroadcastNotExtend: { |
| 86 | // Verify that it strictly broadcasts but does not extend. |
| 87 | EXPECT_TRUE(ShapesAgreeUpToBroadcasting(param.left, param.right)); |
| 88 | EXPECT_FALSE(ShapesAgreeUpToExtending(param.left, param.right)); |
| 89 | break; |
| 90 | } |
| 91 | case Agreement::kNeither: { |
| 92 | EXPECT_FALSE(ShapesAgreeUpToExtending(param.left, param.right)); |
| 93 | EXPECT_FALSE(ShapesAgreeUpToBroadcasting(param.left, param.right)); |
| 94 | break; |
| 95 | } |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | INSTANTIATE_TEST_SUITE_P(AgreeBroadcast, ShapeTest, |
| 100 | ::testing::ValuesIn(CreateShapePairs())); |
nothing calls this directly
no test coverage detected