| 514 | |
| 515 | template <bool BIG> |
| 516 | void PodUpdateTest() { |
| 517 | struct Pod { |
| 518 | int x; |
| 519 | float y; |
| 520 | char big[BIG ? 256 : 0]; |
| 521 | |
| 522 | string TypeName() const { return "POD"; } |
| 523 | }; |
| 524 | |
| 525 | Variant x = Pod{10, 20.f}; |
| 526 | EXPECT_NE(x.get<Pod>(), nullptr); |
| 527 | EXPECT_EQ(x.TypeName(), "POD"); |
| 528 | EXPECT_EQ(x.DebugString(), "Variant<type: POD value: ?>"); |
| 529 | |
| 530 | x.get<Pod>()->x += x.get<Pod>()->y; |
| 531 | EXPECT_EQ(x.get<Pod>()->x, 30); |
| 532 | } |
| 533 | |
| 534 | TEST(VariantTest, PodUpdate) { PodUpdateTest<false>(); } |
| 535 |
nothing calls this directly
no test coverage detected