| 638 | // tests serialization of class with three public string members |
| 639 | template <class TDerived, class TInterface = TDerived> |
| 640 | void TestInheritClassImpl() { |
| 641 | TBufferStream s; |
| 642 | { |
| 643 | TDerived v1; |
| 644 | v1.Str1 = "One"; |
| 645 | v1.Str2 = "Two"; |
| 646 | v1.Str3 = "Three"; |
| 647 | ::Save(&s, static_cast<const TInterface&>(v1)); |
| 648 | } |
| 649 | { |
| 650 | TDerived v2; |
| 651 | ::Load(&s, static_cast<TInterface&>(v2)); |
| 652 | UNIT_ASSERT_VALUES_EQUAL_C(v2.Str1, "One", TypeName<TDerived>() << " via " << TypeName<TInterface>()); |
| 653 | UNIT_ASSERT_VALUES_EQUAL_C(v2.Str2, "Two", TypeName<TDerived>() << " via " << TypeName<TInterface>()); |
| 654 | UNIT_ASSERT_VALUES_EQUAL_C(v2.Str3, "Three", TypeName<TDerived>() << " via " << TypeName<TInterface>()); |
| 655 | } |
| 656 | } |
| 657 | |
| 658 | void TestInheritNonVirtualClass() { |
| 659 | struct TBaseNonVirtual { |