summaryrefslogtreecommitdiffstats
path: root/util/ysaveload_ut.cpp
diff options
context:
space:
mode:
authorishfb <[email protected]>2022-02-10 16:48:07 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 16:48:07 +0300
commit0170772a2dbf133f32e17ca137ff64790d43831f (patch)
tree68ce3ab477bcb9e09abf2b0a6e7b34287c53f0df /util/ysaveload_ut.cpp
parentdf6128370874866447314ec18d8e67fc7bde40b4 (diff)
Restoring authorship annotation for <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'util/ysaveload_ut.cpp')
-rw-r--r--util/ysaveload_ut.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/util/ysaveload_ut.cpp b/util/ysaveload_ut.cpp
index 723c68f391e..97ca40b916e 100644
--- a/util/ysaveload_ut.cpp
+++ b/util/ysaveload_ut.cpp
@@ -15,7 +15,7 @@
#include <util/generic/buffer.h>
#include <util/generic/hash_set.h>
#include <util/generic/maybe.h>
-#include <util/generic/variant.h>
+#include <util/generic/variant.h>
static inline char* AllocateFromPool(TMemoryPool& pool, size_t len) {
return (char*)pool.Allocate(len);
@@ -28,7 +28,7 @@ class TSaveLoadTest: public TTestBase {
UNIT_TEST(TestNewNewStyle)
UNIT_TEST(TestList)
UNIT_TEST(TestTuple)
- UNIT_TEST(TestVariant)
+ UNIT_TEST(TestVariant)
UNIT_TEST(TestInheritNonVirtualClass)
UNIT_TEST(TestInheritVirtualClass)
UNIT_TEST_SUITE_END();
@@ -406,30 +406,30 @@ private:
UNIT_ASSERT_VALUES_EQUAL(std::get<2>(toLoad), std::get<2>(toSave));
}
- template <class TVariant, class T>
- void TestVariantImpl(TVariant& v, const T& expected) {
- v = expected;
-
- TBufferStream s;
- ::Save(&s, v);
- ::Load(&s, v);
+ template <class TVariant, class T>
+ void TestVariantImpl(TVariant& v, const T& expected) {
+ v = expected;
+
+ TBufferStream s;
+ ::Save(&s, v);
+ ::Load(&s, v);
UNIT_ASSERT_VALUES_EQUAL(std::get<T>(v), expected);
- }
-
- void TestVariant() {
+ }
+
+ void TestVariant() {
std::variant<int, bool, TString, TVector<char>> v(1);
- TestVariantImpl(v, 42);
- TestVariantImpl(v, true);
- TestVariantImpl(v, TString("foo"));
+ TestVariantImpl(v, 42);
+ TestVariantImpl(v, true);
+ TestVariantImpl(v, TString("foo"));
TestVariantImpl(v, TVector<char>{'b', 'a', 'r'});
-
- v = TString("baz");
- TBufferStream s;
- ::Save(&s, v);
-
+
+ v = TString("baz");
+ TBufferStream s;
+ ::Save(&s, v);
+
std::variant<char, bool> v2 = false;
- UNIT_ASSERT_EXCEPTION(::Load(&s, v2), TLoadEOF);
- }
+ UNIT_ASSERT_EXCEPTION(::Load(&s, v2), TLoadEOF);
+ }
// tests serialization of class with three public string members
template <class TDerived, class TInterface = TDerived>