diff options
author | yazevnul <yazevnul@yandex-team.ru> | 2022-02-10 16:46:46 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:46 +0300 |
commit | 8cbc307de0221f84c80c42dcbe07d40727537e2c (patch) | |
tree | 625d5a673015d1df891e051033e9fcde5c7be4e5 /library/cpp/yson_pull/ut | |
parent | 30d1ef3941e0dc835be7609de5ebee66958f215a (diff) | |
download | ydb-8cbc307de0221f84c80c42dcbe07d40727537e2c.tar.gz |
Restoring authorship annotation for <yazevnul@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/yson_pull/ut')
-rw-r--r-- | library/cpp/yson_pull/ut/cescape_ut.cpp | 14 | ||||
-rw-r--r-- | library/cpp/yson_pull/ut/loop_ut.cpp | 36 | ||||
-rw-r--r-- | library/cpp/yson_pull/ut/reader_ut.cpp | 30 | ||||
-rw-r--r-- | library/cpp/yson_pull/ut/writer_ut.cpp | 28 |
4 files changed, 54 insertions, 54 deletions
diff --git a/library/cpp/yson_pull/ut/cescape_ut.cpp b/library/cpp/yson_pull/ut/cescape_ut.cpp index 6628ba1d15..8e1547cdac 100644 --- a/library/cpp/yson_pull/ut/cescape_ut.cpp +++ b/library/cpp/yson_pull/ut/cescape_ut.cpp @@ -39,20 +39,20 @@ namespace { } // anonymous namespace -Y_UNIT_TEST_SUITE(CEscape) { - Y_UNIT_TEST(ExhaustiveOneChar) { +Y_UNIT_TEST_SUITE(CEscape) { + Y_UNIT_TEST(ExhaustiveOneChar) { test_exhaustive<1>(); } - Y_UNIT_TEST(ExhaustiveTwoChars) { + Y_UNIT_TEST(ExhaustiveTwoChars) { test_exhaustive<2>(); } - Y_UNIT_TEST(ExhaustiveThreeChars) { + Y_UNIT_TEST(ExhaustiveThreeChars) { test_exhaustive<3>(); } - Y_UNIT_TEST(SpecialEscapeEncode) { + Y_UNIT_TEST(SpecialEscapeEncode) { //UNIT_ASSERT_VALUES_EQUAL(R"(\b)", NCEscape::encode("\b")); //UNIT_ASSERT_VALUES_EQUAL(R"(\f)", NCEscape::encode("\f")); UNIT_ASSERT_VALUES_EQUAL(R"(\n)", NCEscape::encode("\n")); @@ -60,7 +60,7 @@ Y_UNIT_TEST_SUITE(CEscape) { UNIT_ASSERT_VALUES_EQUAL(R"(\t)", NCEscape::encode("\t")); } - Y_UNIT_TEST(SpecialEscapeDecode) { + Y_UNIT_TEST(SpecialEscapeDecode) { UNIT_ASSERT_VALUES_EQUAL("\b", NCEscape::decode(R"(\b)")); UNIT_ASSERT_VALUES_EQUAL("\f", NCEscape::decode(R"(\f)")); UNIT_ASSERT_VALUES_EQUAL("\n", NCEscape::decode(R"(\n)")); @@ -68,4 +68,4 @@ Y_UNIT_TEST_SUITE(CEscape) { UNIT_ASSERT_VALUES_EQUAL("\t", NCEscape::decode(R"(\t)")); } -} // Y_UNIT_TEST_SUITE(CEscape) +} // Y_UNIT_TEST_SUITE(CEscape) diff --git a/library/cpp/yson_pull/ut/loop_ut.cpp b/library/cpp/yson_pull/ut/loop_ut.cpp index 8c7b11dd1c..8ca651dc30 100644 --- a/library/cpp/yson_pull/ut/loop_ut.cpp +++ b/library/cpp/yson_pull/ut/loop_ut.cpp @@ -202,7 +202,7 @@ namespace { class sys_error {}; - IOutputStream& operator<<(IOutputStream& stream, const sys_error&) { + IOutputStream& operator<<(IOutputStream& stream, const sys_error&) { stream << strerror(errno); return stream; } @@ -317,66 +317,66 @@ namespace { } // anonymous namespace -Y_UNIT_TEST_SUITE(Loop) { - Y_UNIT_TEST(memory_pretty_text) { +Y_UNIT_TEST_SUITE(Loop) { + Y_UNIT_TEST(memory_pretty_text) { test_memory(pretty_text, 100); } - Y_UNIT_TEST(memory_text) { + Y_UNIT_TEST(memory_text) { test_memory(text, 100); } - Y_UNIT_TEST(memory_binary) { + Y_UNIT_TEST(memory_binary) { test_memory(binary, 100); } #ifdef _unix_ - Y_UNIT_TEST(posix_fd_pretty_text_buffered) { + Y_UNIT_TEST(posix_fd_pretty_text_buffered) { test_posix_fd(pretty_text, 100, 1024, 1024); } - Y_UNIT_TEST(posix_fd_pretty_text_unbuffered) { + Y_UNIT_TEST(posix_fd_pretty_text_unbuffered) { test_posix_fd(pretty_text, 100, 1, 0); } - Y_UNIT_TEST(posix_fd_text_buffered) { + Y_UNIT_TEST(posix_fd_text_buffered) { test_posix_fd(text, 100, 1024, 1024); } - Y_UNIT_TEST(posix_fd_text_unbuffered) { + Y_UNIT_TEST(posix_fd_text_unbuffered) { test_posix_fd(text, 100, 1, 0); } - Y_UNIT_TEST(posix_fd_binary_buffered) { + Y_UNIT_TEST(posix_fd_binary_buffered) { test_posix_fd(binary, 100, 1024, 1024); } - Y_UNIT_TEST(posix_fd_binary_unbuffered) { + Y_UNIT_TEST(posix_fd_binary_unbuffered) { test_posix_fd(binary, 100, 1, 0); } - Y_UNIT_TEST(stdio_file_pretty_text_buffered) { + Y_UNIT_TEST(stdio_file_pretty_text_buffered) { test_stdio_file(pretty_text, 100, 1024, 1024); } - Y_UNIT_TEST(stdio_file_pretty_text_unbuffered) { + Y_UNIT_TEST(stdio_file_pretty_text_unbuffered) { test_stdio_file(pretty_text, 100, 1, 0); } - Y_UNIT_TEST(stdio_file_text_buffered) { + Y_UNIT_TEST(stdio_file_text_buffered) { test_stdio_file(text, 100, 1024, 1024); } - Y_UNIT_TEST(stdio_file_text_unbuffered) { + Y_UNIT_TEST(stdio_file_text_unbuffered) { test_stdio_file(text, 100, 1, 0); } - Y_UNIT_TEST(stdio_file_binary_buffered) { + Y_UNIT_TEST(stdio_file_binary_buffered) { test_stdio_file(binary, 100, 1024, 1024); } - Y_UNIT_TEST(stdio_file_binary_unbuffered) { + Y_UNIT_TEST(stdio_file_binary_unbuffered) { test_stdio_file(binary, 100, 1, 0); } #endif -} // Y_UNIT_TEST_SUITE(Loop) +} // Y_UNIT_TEST_SUITE(Loop) diff --git a/library/cpp/yson_pull/ut/reader_ut.cpp b/library/cpp/yson_pull/ut/reader_ut.cpp index 1184265ddb..21fb5e01a4 100644 --- a/library/cpp/yson_pull/ut/reader_ut.cpp +++ b/library/cpp/yson_pull/ut/reader_ut.cpp @@ -73,12 +73,12 @@ namespace { } // anonymous namespace -Y_UNIT_TEST_SUITE(Reader) { - Y_UNIT_TEST(ScalarEntity) { +Y_UNIT_TEST_SUITE(Reader) { + Y_UNIT_TEST(ScalarEntity) { test_scalar(TStringBuf("#"), NYsonPull::TScalar{}); } - Y_UNIT_TEST(ScalarBoolean) { + Y_UNIT_TEST(ScalarBoolean) { test_scalar(TStringBuf("%true"), true); test_scalar(TStringBuf("%false"), false); @@ -93,7 +93,7 @@ Y_UNIT_TEST_SUITE(Reader) { REJECT("%hithere"); } - Y_UNIT_TEST(ScalarInt64) { + Y_UNIT_TEST(ScalarInt64) { test_scalar(TStringBuf("1"), i64{1}); test_scalar(TStringBuf("+1"), i64{1}); test_scalar(TStringBuf("100000"), i64{100000}); @@ -112,7 +112,7 @@ Y_UNIT_TEST_SUITE(Reader) { REJECT("1+0"); } - Y_UNIT_TEST(SclarUInt64) { + Y_UNIT_TEST(SclarUInt64) { test_scalar(TStringBuf("1u"), ui64{1}); test_scalar(TStringBuf("+1u"), ui64{1}); test_scalar(TStringBuf("100000u"), ui64{100000}); @@ -129,7 +129,7 @@ Y_UNIT_TEST_SUITE(Reader) { // TODO: binary } - Y_UNIT_TEST(ScalarFloat64) { + Y_UNIT_TEST(ScalarFloat64) { test_scalar(TStringBuf("0.0"), double{0.0}); test_scalar(TStringBuf("+0.0"), double{0.0}); test_scalar(TStringBuf("+.0"), double{0.0}); @@ -193,7 +193,7 @@ Y_UNIT_TEST_SUITE(Reader) { REJECT("%-in"); } - Y_UNIT_TEST(ScalarString) { + Y_UNIT_TEST(ScalarString) { test_scalar(TStringBuf(R"(foobar)"), TStringBuf("foobar")); test_scalar(TStringBuf(R"(foobar11)"), TStringBuf("foobar11")); test_scalar(TStringBuf(R"("foobar")"), TStringBuf("foobar")); @@ -206,7 +206,7 @@ Y_UNIT_TEST_SUITE(Reader) { REJECT("\x01\x0d" "foobar"sv); // negative length } - Y_UNIT_TEST(EmptyList) { + Y_UNIT_TEST(EmptyList) { auto reader = memory_reader("[]", NYsonPull::EStreamType::Node); UNIT_ASSERT_VALUES_EQUAL(NYsonPull::EEventType::BeginStream, reader.NextEvent().Type()); @@ -218,7 +218,7 @@ Y_UNIT_TEST_SUITE(Reader) { REJECT("]"); } - Y_UNIT_TEST(EmptyMap) { + Y_UNIT_TEST(EmptyMap) { auto reader = memory_reader("{}", NYsonPull::EStreamType::Node); UNIT_ASSERT_VALUES_EQUAL(NYsonPull::EEventType::BeginStream, reader.NextEvent().Type()); @@ -230,7 +230,7 @@ Y_UNIT_TEST_SUITE(Reader) { REJECT("}"); } - Y_UNIT_TEST(Sample) { + Y_UNIT_TEST(Sample) { auto reader = memory_reader( R"({"11"=11;"nothing"=#;"zero"=0.;"foo"="bar";"list"=[1;2;3]})", NYsonPull::EStreamType::Node); @@ -309,7 +309,7 @@ Y_UNIT_TEST_SUITE(Reader) { UNIT_ASSERT_VALUES_EQUAL(NYsonPull::EEventType::EndStream, reader.NextEvent().Type()); } - Y_UNIT_TEST(Accept) { + Y_UNIT_TEST(Accept) { ACCEPT("[]"); ACCEPT("{}"); ACCEPT("<>[]"); @@ -330,7 +330,7 @@ Y_UNIT_TEST_SUITE(Reader) { ACCEPT("{foo=<foo=foo>[foo;foo]}"); } - Y_UNIT_TEST(Reject) { + Y_UNIT_TEST(Reject) { REJECT("["); REJECT("{"); REJECT("<"); @@ -352,7 +352,7 @@ Y_UNIT_TEST_SUITE(Reader) { REJECT("@"); } - Y_UNIT_TEST(ReadPastEnd) { + Y_UNIT_TEST(ReadPastEnd) { auto reader = memory_reader("#", NYsonPull::EStreamType::Node); UNIT_ASSERT_VALUES_EQUAL(NYsonPull::EEventType::BeginStream, reader.NextEvent().Type()); UNIT_ASSERT_VALUES_EQUAL(NYsonPull::EEventType::Scalar, reader.NextEvent().Type()); @@ -369,7 +369,7 @@ Y_UNIT_TEST_SUITE(Reader) { UNIT_ASSERT_EXCEPTION(reader.NextEvent(), NYsonPull::NException::TBadInput); } - Y_UNIT_TEST(StreamType) { + Y_UNIT_TEST(StreamType) { REJECT2("", NYsonPull::EStreamType::Node); ACCEPT2("", NYsonPull::EStreamType::ListFragment); ACCEPT2("", NYsonPull::EStreamType::MapFragment); @@ -407,4 +407,4 @@ Y_UNIT_TEST_SUITE(Reader) { ACCEPT2("a=[1]; b=foobar", NYsonPull::EStreamType::MapFragment); } -} // Y_UNIT_TEST_SUITE(Reader) +} // Y_UNIT_TEST_SUITE(Reader) diff --git a/library/cpp/yson_pull/ut/writer_ut.cpp b/library/cpp/yson_pull/ut/writer_ut.cpp index 5c304bad0f..79e19930df 100644 --- a/library/cpp/yson_pull/ut/writer_ut.cpp +++ b/library/cpp/yson_pull/ut/writer_ut.cpp @@ -44,14 +44,14 @@ namespace { // =================== Text format ===================== -Y_UNIT_TEST_SUITE(Writer) { - Y_UNIT_TEST(TextEntity) { +Y_UNIT_TEST_SUITE(Writer) { + Y_UNIT_TEST(TextEntity) { UNIT_ASSERT_VALUES_EQUAL( "#", to_yson_text_string(NYsonPull::TScalar{})); } - Y_UNIT_TEST(TextBoolean) { + Y_UNIT_TEST(TextBoolean) { UNIT_ASSERT_VALUES_EQUAL( "%false", to_yson_text_string(NYsonPull::TScalar{false})); @@ -60,7 +60,7 @@ Y_UNIT_TEST_SUITE(Writer) { to_yson_text_string(NYsonPull::TScalar{true})); } - Y_UNIT_TEST(TextInt64) { + Y_UNIT_TEST(TextInt64) { UNIT_ASSERT_VALUES_EQUAL( "0", to_yson_text_string(NYsonPull::TScalar{i64{0}})); @@ -97,7 +97,7 @@ Y_UNIT_TEST_SUITE(Writer) { to_yson_text_string(NYsonPull::TScalar{i64{INT64_MIN}})); } - Y_UNIT_TEST(TextUInt64) { + Y_UNIT_TEST(TextUInt64) { UNIT_ASSERT_VALUES_EQUAL( "0u", to_yson_text_string(NYsonPull::TScalar{ui64{0}})); @@ -121,7 +121,7 @@ Y_UNIT_TEST_SUITE(Writer) { to_yson_text_string(NYsonPull::TScalar{ui64{UINT64_MAX}})); } - Y_UNIT_TEST(TextFloat64) { + Y_UNIT_TEST(TextFloat64) { UNIT_ASSERT_VALUES_EQUAL( "%inf", to_yson_text_string(NYsonPull::TScalar{std::numeric_limits<double>::infinity()})); @@ -133,7 +133,7 @@ Y_UNIT_TEST_SUITE(Writer) { to_yson_text_string(NYsonPull::TScalar{std::numeric_limits<double>::quiet_NaN()})); } - Y_UNIT_TEST(TextString) { + Y_UNIT_TEST(TextString) { UNIT_ASSERT_VALUES_EQUAL( R"("")", to_yson_text_string(NYsonPull::TScalar{""})); @@ -147,13 +147,13 @@ Y_UNIT_TEST_SUITE(Writer) { // =================== Binary format ===================== - Y_UNIT_TEST(BinaryEntity) { + Y_UNIT_TEST(BinaryEntity) { UNIT_ASSERT_VALUES_EQUAL( "#", to_yson_binary_string(NYsonPull::TScalar{})); } - Y_UNIT_TEST(BinaryBoolean) { + Y_UNIT_TEST(BinaryBoolean) { UNIT_ASSERT_VALUES_EQUAL( TStringBuf("\x4"), to_yson_binary_string(NYsonPull::TScalar{false})); @@ -162,7 +162,7 @@ Y_UNIT_TEST_SUITE(Writer) { to_yson_binary_string(NYsonPull::TScalar{true})); } - Y_UNIT_TEST(BinaryInt64) { + Y_UNIT_TEST(BinaryInt64) { UNIT_ASSERT_VALUES_EQUAL( TStringBuf("\x2\0"sv), to_yson_binary_string(NYsonPull::TScalar{i64{0}})); @@ -199,7 +199,7 @@ Y_UNIT_TEST_SUITE(Writer) { to_yson_binary_string(NYsonPull::TScalar{i64{INT64_MIN}})); } - Y_UNIT_TEST(BinaryUInt64) { + Y_UNIT_TEST(BinaryUInt64) { UNIT_ASSERT_VALUES_EQUAL( TStringBuf("\x6\0"sv), to_yson_binary_string(NYsonPull::TScalar{ui64{0}})); @@ -223,7 +223,7 @@ Y_UNIT_TEST_SUITE(Writer) { to_yson_binary_string(NYsonPull::TScalar{ui64{UINT64_MAX}})); } - Y_UNIT_TEST(BinaryFloat64) { + Y_UNIT_TEST(BinaryFloat64) { UNIT_ASSERT_VALUES_EQUAL( TStringBuf("\x03\x00\x00\x00\x00\x00\x00\xf0\x7f"sv), to_yson_binary_string(NYsonPull::TScalar{std::numeric_limits<double>::infinity()})); @@ -241,7 +241,7 @@ Y_UNIT_TEST_SUITE(Writer) { to_yson_binary_string(NYsonPull::TScalar{double{-1.1}})); } - Y_UNIT_TEST(BinaryString) { + Y_UNIT_TEST(BinaryString) { UNIT_ASSERT_VALUES_EQUAL( TStringBuf("\x1\0"sv), to_yson_binary_string(NYsonPull::TScalar{""})); @@ -253,4 +253,4 @@ Y_UNIT_TEST_SUITE(Writer) { to_yson_binary_string(NYsonPull::TScalar{"hello\nworld"})); } -} // Y_UNIT_TEST_SUITE(Writer) +} // Y_UNIT_TEST_SUITE(Writer) |