MCPcopy Create free account
hub / github.com/catboost/catboost / TestInheritClassImpl

Method TestInheritClassImpl

util/ysaveload_ut.cpp:640–656  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 2

SaveFunction · 0.70
LoadFunction · 0.70

Tested by

no test coverage detected