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

Method TestVariant

util/ysaveload_ut.cpp:603–616  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

601 }
602
603 void TestVariant() {
604 std::variant<int, bool, TString, TVector<char>> v(1);
605 TestVariantImpl(v, 42);
606 TestVariantImpl(v, true);
607 TestVariantImpl(v, TString("foo"));
608 TestVariantImpl(v, TVector<char>{'b', 'a', 'r'});
609
610 v = TString("baz");
611 TBufferStream s;
612 ::Save(&s, v);
613
614 std::variant<char, bool> v2 = false;
615 UNIT_ASSERT_EXCEPTION(::Load(&s, v2), TLoadEOF);
616 }
617
618 template <class T>
619 void TestOptionalImpl(const std::optional<T>& v) {

Callers

nothing calls this directly

Calls 2

SaveFunction · 0.70
LoadFunction · 0.70

Tested by

no test coverage detected