diff options
author | Vlad Yaroslavlev <vladon@vladon.com> | 2022-02-10 16:46:25 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:25 +0300 |
commit | 344ea37b4a345701ab0e67de2266a1c1bd7baf2d (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /library/cpp/protobuf | |
parent | 706b83ed7de5a473436620367af31fc0ceecde07 (diff) | |
download | ydb-344ea37b4a345701ab0e67de2266a1c1bd7baf2d.tar.gz |
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/protobuf')
-rw-r--r-- | library/cpp/protobuf/json/json2proto.cpp | 6 | ||||
-rw-r--r-- | library/cpp/protobuf/json/proto2json_printer.h | 2 | ||||
-rw-r--r-- | library/cpp/protobuf/json/ut/inline_ut.cpp | 2 | ||||
-rw-r--r-- | library/cpp/protobuf/json/ut/json.h | 2 | ||||
-rw-r--r-- | library/cpp/protobuf/json/ut/json2proto_ut.cpp | 2 | ||||
-rw-r--r-- | library/cpp/protobuf/json/ut/proto.h | 2 | ||||
-rw-r--r-- | library/cpp/protobuf/json/ut/proto2json_ut.cpp | 2 | ||||
-rw-r--r-- | library/cpp/protobuf/json/ut/repeated_fields.incl | 8 | ||||
-rw-r--r-- | library/cpp/protobuf/json/ut/string_transform_ut.cpp | 18 | ||||
-rw-r--r-- | library/cpp/protobuf/json/ut/test.proto | 2 | ||||
-rw-r--r-- | library/cpp/protobuf/util/is_equal_ut.cpp | 4 | ||||
-rw-r--r-- | library/cpp/protobuf/util/pb_io.cpp | 20 | ||||
-rw-r--r-- | library/cpp/protobuf/util/pb_io.h | 16 | ||||
-rw-r--r-- | library/cpp/protobuf/util/pb_io_ut.cpp | 40 | ||||
-rw-r--r-- | library/cpp/protobuf/util/simple_reflection_ut.cpp | 8 | ||||
-rw-r--r-- | library/cpp/protobuf/util/walk_ut.cpp | 4 |
16 files changed, 69 insertions, 69 deletions
diff --git a/library/cpp/protobuf/json/json2proto.cpp b/library/cpp/protobuf/json/json2proto.cpp index 9cd9007f15..640c10f5a5 100644 --- a/library/cpp/protobuf/json/json2proto.cpp +++ b/library/cpp/protobuf/json/json2proto.cpp @@ -34,7 +34,7 @@ break; \ } -static TString GetFieldName(const google::protobuf::FieldDescriptor& field, +static TString GetFieldName(const google::protobuf::FieldDescriptor& field, const NProtobufJson::TJson2ProtoConfig& config) { if (config.NameGenerator) { return config.NameGenerator(field); @@ -50,7 +50,7 @@ static TString GetFieldName(const google::protobuf::FieldDescriptor& field, return name; } - TString name = field.name(); + TString name = field.name(); switch (config.FieldNameMode) { case NProtobufJson::TJson2ProtoConfig::FieldNameOriginalCase: break; @@ -318,7 +318,7 @@ Json2RepeatedField(const NJson::TJsonValue& json, const NProtobufJson::TJson2ProtoConfig& config) { using namespace google::protobuf; - TString name = GetFieldName(field, config); + TString name = GetFieldName(field, config); if (!json.Has(name)) return; diff --git a/library/cpp/protobuf/json/proto2json_printer.h b/library/cpp/protobuf/json/proto2json_printer.h index 9057ac574c..9dc5aa86c6 100644 --- a/library/cpp/protobuf/json/proto2json_printer.h +++ b/library/cpp/protobuf/json/proto2json_printer.h @@ -7,7 +7,7 @@ #include <google/protobuf/message.h> #include <util/generic/strbuf.h> -#include <util/generic/string.h> +#include <util/generic/string.h> namespace NProtobufJson { struct TProto2JsonConfig; diff --git a/library/cpp/protobuf/json/ut/inline_ut.cpp b/library/cpp/protobuf/json/ut/inline_ut.cpp index 2f2efacf45..c29ad32e7d 100644 --- a/library/cpp/protobuf/json/ut/inline_ut.cpp +++ b/library/cpp/protobuf/json/ut/inline_ut.cpp @@ -5,7 +5,7 @@ #include <library/cpp/protobuf/json/proto2json.h> #include <library/cpp/testing/unittest/registar.h> -#include <util/generic/string.h> +#include <util/generic/string.h> using namespace NProtobufJson; diff --git a/library/cpp/protobuf/json/ut/json.h b/library/cpp/protobuf/json/ut/json.h index b36d848b58..c1f108e6e4 100644 --- a/library/cpp/protobuf/json/ut/json.h +++ b/library/cpp/protobuf/json/ut/json.h @@ -7,7 +7,7 @@ #include <cstdarg> #include <util/generic/hash_set.h> -#include <util/generic/string.h> +#include <util/generic/string.h> #include <util/system/defaults.h> diff --git a/library/cpp/protobuf/json/ut/json2proto_ut.cpp b/library/cpp/protobuf/json/ut/json2proto_ut.cpp index ce9d28222a..0dfe57bc7a 100644 --- a/library/cpp/protobuf/json/ut/json2proto_ut.cpp +++ b/library/cpp/protobuf/json/ut/json2proto_ut.cpp @@ -13,7 +13,7 @@ #include <library/cpp/testing/unittest/registar.h> #include <util/generic/hash_set.h> -#include <util/generic/string.h> +#include <util/generic/string.h> #include <util/generic/ylimits.h> #include <util/stream/str.h> #include <util/string/cast.h> diff --git a/library/cpp/protobuf/json/ut/proto.h b/library/cpp/protobuf/json/ut/proto.h index 53454cd950..8183bfc8e1 100644 --- a/library/cpp/protobuf/json/ut/proto.h +++ b/library/cpp/protobuf/json/ut/proto.h @@ -1,7 +1,7 @@ #pragma once #include <util/generic/hash_set.h> -#include <util/generic/string.h> +#include <util/generic/string.h> #include <util/system/defaults.h> diff --git a/library/cpp/protobuf/json/ut/proto2json_ut.cpp b/library/cpp/protobuf/json/ut/proto2json_ut.cpp index ed5a414b20..07e52d7f2f 100644 --- a/library/cpp/protobuf/json/ut/proto2json_ut.cpp +++ b/library/cpp/protobuf/json/ut/proto2json_ut.cpp @@ -12,7 +12,7 @@ #include <library/cpp/testing/unittest/registar.h> #include <util/generic/hash_set.h> -#include <util/generic/string.h> +#include <util/generic/string.h> #include <util/generic/ylimits.h> #include <util/stream/str.h> diff --git a/library/cpp/protobuf/json/ut/repeated_fields.incl b/library/cpp/protobuf/json/ut/repeated_fields.incl index 332482450f..e9548917d8 100644 --- a/library/cpp/protobuf/json/ut/repeated_fields.incl +++ b/library/cpp/protobuf/json/ut/repeated_fields.incl @@ -12,10 +12,10 @@ DEFINE_REPEATED_FIELD(FI64, ui64, 0ull, 1ull, Max<ui64>()) DEFINE_REPEATED_FIELD(SFI32, i32, Min<i32>(), -1, 0, 1, Max<i32>()) DEFINE_REPEATED_FIELD(SFI64, i64, Min<i64>(), -1ll, 0ll, 1ll, Max<i64>()) DEFINE_REPEATED_FIELD(Bool, bool, false, true) -DEFINE_REPEATED_FIELD(String, TString, "", "Lorem ipsum", "123123") -DEFINE_REPEATED_FIELD(Bytes, TString, "", "מחשב", "\x1") +DEFINE_REPEATED_FIELD(String, TString, "", "Lorem ipsum", "123123") +DEFINE_REPEATED_FIELD(Bytes, TString, "", "מחשב", "\x1") DEFINE_REPEATED_FIELD(Enum, EEnum, E_1, E_2, E_3) DEFINE_REPEATED_FIELD(Float, float, 0.0f, 1.0f, 1.123f) DEFINE_REPEATED_FIELD(Double, double, 0.0, 1.0, 1.123456789012) -DEFINE_REPEATED_FIELD(OneString, TString, "", "Lorem ipsum dolor", "1231231") -DEFINE_REPEATED_FIELD(OneTwoString, TString, "", "Lorem ipsum dolor sit", "12312312") +DEFINE_REPEATED_FIELD(OneString, TString, "", "Lorem ipsum dolor", "1231231") +DEFINE_REPEATED_FIELD(OneTwoString, TString, "", "Lorem ipsum dolor sit", "12312312") diff --git a/library/cpp/protobuf/json/ut/string_transform_ut.cpp b/library/cpp/protobuf/json/ut/string_transform_ut.cpp index f5a0011b77..a31dabcb0f 100644 --- a/library/cpp/protobuf/json/ut/string_transform_ut.cpp +++ b/library/cpp/protobuf/json/ut/string_transform_ut.cpp @@ -6,7 +6,7 @@ Y_UNIT_TEST_SUITE(TDoubleEscapeTransform) { Y_UNIT_TEST(TestEmptyString) { const NProtobufJson::IStringTransform& transform = NProtobufJson::TDoubleEscapeTransform(); - TString s; + TString s; s = ""; transform.Transform(s); UNIT_ASSERT_EQUAL(s, ""); @@ -14,7 +14,7 @@ Y_UNIT_TEST_SUITE(TDoubleEscapeTransform) { Y_UNIT_TEST(TestAlphabeticString) { const NProtobufJson::IStringTransform& transform = NProtobufJson::TDoubleEscapeTransform(); - TString s; + TString s; s = "abacaba"; transform.Transform(s); UNIT_ASSERT_EQUAL(s, "abacaba"); @@ -22,7 +22,7 @@ Y_UNIT_TEST_SUITE(TDoubleEscapeTransform) { Y_UNIT_TEST(TestRussianSymbols) { const NProtobufJson::IStringTransform& transform = NProtobufJson::TDoubleEscapeTransform(); - TString s; + TString s; s = "тест"; transform.Transform(s); UNIT_ASSERT_EQUAL(s, "\\\\321\\\\202\\\\320\\\\265\\\\321\\\\201\\\\321\\\\202"); @@ -30,7 +30,7 @@ Y_UNIT_TEST_SUITE(TDoubleEscapeTransform) { Y_UNIT_TEST(TestEscapeSpecialSymbols) { const NProtobufJson::IStringTransform& transform = NProtobufJson::TDoubleEscapeTransform(); - TString s; + TString s; s = "aba\\ca\"ba"; transform.Transform(s); Cerr << "###" << s << Endl; @@ -41,7 +41,7 @@ Y_UNIT_TEST_SUITE(TDoubleEscapeTransform) { Y_UNIT_TEST_SUITE(TDoubleUnescapeTransform) { Y_UNIT_TEST(TestEmptyString) { const NProtobufJson::IStringTransform& transform = NProtobufJson::TDoubleUnescapeTransform(); - TString s; + TString s; s = ""; transform.Transform(s); UNIT_ASSERT_EQUAL("", s); @@ -49,7 +49,7 @@ Y_UNIT_TEST_SUITE(TDoubleUnescapeTransform) { Y_UNIT_TEST(TestAlphabeticString) { const NProtobufJson::IStringTransform& transform = NProtobufJson::TDoubleUnescapeTransform(); - TString s; + TString s; s = "abacaba"; transform.Transform(s); Cerr << "###" << s << Endl; @@ -58,7 +58,7 @@ Y_UNIT_TEST_SUITE(TDoubleUnescapeTransform) { Y_UNIT_TEST(TestRussianSymbols) { const NProtobufJson::IStringTransform& transform = NProtobufJson::TDoubleUnescapeTransform(); - TString s; + TString s; s = "\\\\321\\\\202\\\\320\\\\265\\\\321\\\\201\\\\321\\\\202"; transform.Transform(s); UNIT_ASSERT_EQUAL("тест", s); @@ -66,7 +66,7 @@ Y_UNIT_TEST_SUITE(TDoubleUnescapeTransform) { Y_UNIT_TEST(TestEscapeSpecialSymbols) { const NProtobufJson::IStringTransform& transform = NProtobufJson::TDoubleUnescapeTransform(); - TString s; + TString s; s = "aba\\\\\\\\ca\\\\\\\"ba"; transform.Transform(s); UNIT_ASSERT_EQUAL("aba\\ca\"ba", s); @@ -74,7 +74,7 @@ Y_UNIT_TEST_SUITE(TDoubleUnescapeTransform) { Y_UNIT_TEST(TestEscapeSpecialSymbolsDifficultCases) { const NProtobufJson::IStringTransform& transform = NProtobufJson::TDoubleUnescapeTransform(); - TString s; + TString s; s = "\\\\\\\\\\\\\\\\"; transform.Transform(s); UNIT_ASSERT_EQUAL("\\\\", s); diff --git a/library/cpp/protobuf/json/ut/test.proto b/library/cpp/protobuf/json/ut/test.proto index 32ff53cd0b..0fa996fd41 100644 --- a/library/cpp/protobuf/json/ut/test.proto +++ b/library/cpp/protobuf/json/ut/test.proto @@ -131,7 +131,7 @@ message TCompositeRepeated { repeated TFlatOptional Part = 1; }; -message TMapType { +message TMapType { map<string, string> Items = 1; }; diff --git a/library/cpp/protobuf/util/is_equal_ut.cpp b/library/cpp/protobuf/util/is_equal_ut.cpp index b3388783c4..3ca4c90dd5 100644 --- a/library/cpp/protobuf/util/is_equal_ut.cpp +++ b/library/cpp/protobuf/util/is_equal_ut.cpp @@ -24,7 +24,7 @@ Y_UNIT_TEST_SUITE(ProtobufIsEqual) { a.SetName("aaa"); b.SetName("bbb"); - TString path; + TString path; bool equal = NProtoBuf::IsEqual(a, b, &path); UNIT_ASSERT(!equal); @@ -40,7 +40,7 @@ Y_UNIT_TEST_SUITE(ProtobufIsEqual) { a.MutableInner()->SetBrbrbr("aaa"); b.MutableInner()->SetBrbrbr("bbb"); - TString path; + TString path; bool equal = NProtoBuf::IsEqual(a, b, &path); UNIT_ASSERT(!equal); diff --git a/library/cpp/protobuf/util/pb_io.cpp b/library/cpp/protobuf/util/pb_io.cpp index 0a01549d79..6270ee0624 100644 --- a/library/cpp/protobuf/util/pb_io.cpp +++ b/library/cpp/protobuf/util/pb_io.cpp @@ -7,7 +7,7 @@ #include <google/protobuf/messagext.h> #include <google/protobuf/text_format.h> -#include <util/generic/string.h> +#include <util/generic/string.h> #include <util/stream/file.h> #include <util/stream/str.h> #include <util/string/cast.h> @@ -101,10 +101,10 @@ void SerializeToTextFormat(const NProtoBuf::Message& m, IOutputStream& out) { } } -void SerializeToTextFormat(const NProtoBuf::Message& m, const TString& fileName) { - /* TUnbufferedFileOutput is unbuffered, but TCopyingOutputStreamAdaptor adds +void SerializeToTextFormat(const NProtoBuf::Message& m, const TString& fileName) { + /* TUnbufferedFileOutput is unbuffered, but TCopyingOutputStreamAdaptor adds * a buffer on top of it. */ - TUnbufferedFileOutput stream(fileName); + TUnbufferedFileOutput stream(fileName); SerializeToTextFormat(m, stream); } @@ -150,15 +150,15 @@ void ParseFromTextFormat(IInputStream& in, NProtoBuf::Message& m, } } -void ParseFromTextFormat(const TString& fileName, NProtoBuf::Message& m, +void ParseFromTextFormat(const TString& fileName, NProtoBuf::Message& m, const EParseFromTextFormatOptions options) { - /* TUnbufferedFileInput is unbuffered, but TCopyingInputStreamAdaptor adds + /* TUnbufferedFileInput is unbuffered, but TCopyingInputStreamAdaptor adds * a buffer on top of it. */ - TUnbufferedFileInput stream(fileName); + TUnbufferedFileInput stream(fileName); ParseFromTextFormat(stream, m, options); } -bool TryParseFromTextFormat(const TString& fileName, NProtoBuf::Message& m, +bool TryParseFromTextFormat(const TString& fileName, NProtoBuf::Message& m, const EParseFromTextFormatOptions options) { try { ParseFromTextFormat(fileName, m, options); @@ -192,9 +192,9 @@ void MergeFromTextFormat(IInputStream& in, NProtoBuf::Message& m, void MergeFromTextFormat(const TString& fileName, NProtoBuf::Message& m, const EParseFromTextFormatOptions options) { - /* TUnbufferedFileInput is unbuffered, but TCopyingInputStreamAdaptor adds + /* TUnbufferedFileInput is unbuffered, but TCopyingInputStreamAdaptor adds * a buffer on top of it. */ - TUnbufferedFileInput stream(fileName); + TUnbufferedFileInput stream(fileName); MergeFromTextFormat(stream, m, options); } diff --git a/library/cpp/protobuf/util/pb_io.h b/library/cpp/protobuf/util/pb_io.h index 3a5e16ad67..493c84cb5f 100644 --- a/library/cpp/protobuf/util/pb_io.h +++ b/library/cpp/protobuf/util/pb_io.h @@ -32,11 +32,11 @@ namespace NProtoBuf { /* Serialize message into string and apply base64 URL encoding. */ - TString SerializeToBase64String(const Message& m); - void SerializeToBase64String(const Message& m, TString& dataBase64); - bool TrySerializeToBase64String(const Message& m, TString& dataBase64); + TString SerializeToBase64String(const Message& m); + void SerializeToBase64String(const Message& m, TString& dataBase64); + bool TrySerializeToBase64String(const Message& m, TString& dataBase64); - const TString ShortUtf8DebugString(const Message& message); + const TString ShortUtf8DebugString(const Message& message); bool MergePartialFromString(NProtoBuf::Message& m, const TStringBuf serializedProtoMessage); bool MergeFromString(NProtoBuf::Message& m, const TStringBuf serializedProtoMessage); @@ -45,7 +45,7 @@ namespace NProtoBuf { int operator&(NProtoBuf::Message& m, IBinSaver& f); // Write a textual representation of the given message to the given file. -void SerializeToTextFormat(const NProtoBuf::Message& m, const TString& fileName); +void SerializeToTextFormat(const NProtoBuf::Message& m, const TString& fileName); void SerializeToTextFormat(const NProtoBuf::Message& m, IOutputStream& out); // Write a textual representation of the given message to the given output stream @@ -64,7 +64,7 @@ enum class EParseFromTextFormatOption : ui64 { Y_DECLARE_FLAGS(EParseFromTextFormatOptions, EParseFromTextFormatOption); // Parse a text-format protocol message from the given file into message object. -void ParseFromTextFormat(const TString& fileName, NProtoBuf::Message& m, +void ParseFromTextFormat(const TString& fileName, NProtoBuf::Message& m, const EParseFromTextFormatOptions options = {}); // NOTE: will read `in` till the end. void ParseFromTextFormat(IInputStream& in, NProtoBuf::Message& m, @@ -74,7 +74,7 @@ void ParseFromTextFormat(IInputStream& in, NProtoBuf::Message& m, * * @see `ParseFromTextFormat` */ -bool TryParseFromTextFormat(const TString& fileName, NProtoBuf::Message& m, +bool TryParseFromTextFormat(const TString& fileName, NProtoBuf::Message& m, const EParseFromTextFormatOptions options = {}); // NOTE: will read `in` till the end. bool TryParseFromTextFormat(IInputStream& in, NProtoBuf::Message& m, @@ -82,7 +82,7 @@ bool TryParseFromTextFormat(IInputStream& in, NProtoBuf::Message& m, // @see `ParseFromTextFormat` template <typename T> -static T ParseFromTextFormat(const TString& fileName, +static T ParseFromTextFormat(const TString& fileName, const EParseFromTextFormatOptions options = {}) { T message; ParseFromTextFormat(fileName, message, options); diff --git a/library/cpp/protobuf/util/pb_io_ut.cpp b/library/cpp/protobuf/util/pb_io_ut.cpp index de62b0b0a1..875d6dc602 100644 --- a/library/cpp/protobuf/util/pb_io_ut.cpp +++ b/library/cpp/protobuf/util/pb_io_ut.cpp @@ -23,7 +23,7 @@ static NProtobufUtilUt::TTextEnumTest GetCorrectEnumMessage() { return m; } -static const TString CORRECT_MESSAGE = +static const TString CORRECT_MESSAGE = R"(Foo: 42 )"; static const TString CORRECT_ENUM_NAME_MESSAGE = @@ -33,7 +33,7 @@ static const TString CORRECT_ENUM_ID_MESSAGE = R"(Slot: 1 )"; -static const TString INCORRECT_MESSAGE = +static const TString INCORRECT_MESSAGE = R"(Bar: 1 )"; static const TString INCORRECT_ENUM_NAME_MESSAGE = @@ -43,11 +43,11 @@ static const TString INCORRECT_ENUM_ID_MESSAGE = R"(Slot: 3 )"; -static const TString CORRECT_BASE64_MESSAGE = "CCo,"; +static const TString CORRECT_BASE64_MESSAGE = "CCo,"; static const TString CORRECT_UNEVEN_BASE64_MESSAGE = "CCo"; -static const TString INCORRECT_BASE64_MESSAGE = "CC"; +static const TString INCORRECT_BASE64_MESSAGE = "CC"; Y_UNIT_TEST_SUITE(TTestProtoBufIO) { Y_UNIT_TEST(TestBase64) { @@ -81,8 +81,8 @@ Y_UNIT_TEST_SUITE(TTestProtoBufIO) { const TFsPath correctFileName = TFsPath{tempDir()} / "correct.pb.txt"; const TFsPath incorrectFileName = TFsPath{tempDir()} / "incorrect.pb.txt"; - TFileOutput{correctFileName}.Write(CORRECT_MESSAGE); - TFileOutput{incorrectFileName}.Write(INCORRECT_MESSAGE); + TFileOutput{correctFileName}.Write(CORRECT_MESSAGE); + TFileOutput{incorrectFileName}.Write(INCORRECT_MESSAGE); { NProtobufUtilUt::TTextTest message; @@ -138,8 +138,8 @@ Y_UNIT_TEST_SUITE(TTestProtoBufIO) { } { NProtobufUtilUt::TTextTest m; - const auto f = [&correctFileName](NProtobufUtilUt::TTextTest& mm) { - mm = ParseFromTextFormat<NProtobufUtilUt::TTextTest>(correctFileName); + const auto f = [&correctFileName](NProtobufUtilUt::TTextTest& mm) { + mm = ParseFromTextFormat<NProtobufUtilUt::TTextTest>(correctFileName); }; UNIT_ASSERT_NO_EXCEPTION(f(m)); UNIT_ASSERT(NProtoBuf::IsEqual(GetCorrectMessage(), m)); @@ -150,8 +150,8 @@ Y_UNIT_TEST_SUITE(TTestProtoBufIO) { { NProtobufUtilUt::TTextTest m; TStringInput in{CORRECT_MESSAGE}; - const auto f = [&in](NProtobufUtilUt::TTextTest& mm) { - mm = ParseFromTextFormat<NProtobufUtilUt::TTextTest>(in); + const auto f = [&in](NProtobufUtilUt::TTextTest& mm) { + mm = ParseFromTextFormat<NProtobufUtilUt::TTextTest>(in); }; UNIT_ASSERT_NO_EXCEPTION(f(m)); UNIT_ASSERT(NProtoBuf::IsEqual(GetCorrectMessage(), m)); @@ -161,10 +161,10 @@ Y_UNIT_TEST_SUITE(TTestProtoBufIO) { UNIT_ASSERT_EXCEPTION(ParseFromTextFormat<NProtobufUtilUt::TTextTest>(in), yexception); } { - const TFsPath correctFileName2 = TFsPath{tempDir()} / "serialized.pb.txt"; + const TFsPath correctFileName2 = TFsPath{tempDir()} / "serialized.pb.txt"; const auto original = GetCorrectMessage(); - UNIT_ASSERT_NO_EXCEPTION(SerializeToTextFormat(original, correctFileName2)); - const auto serializedStr = TUnbufferedFileInput{correctFileName2}.ReadAll(); + UNIT_ASSERT_NO_EXCEPTION(SerializeToTextFormat(original, correctFileName2)); + const auto serializedStr = TUnbufferedFileInput{correctFileName2}.ReadAll(); UNIT_ASSERT_VALUES_EQUAL(serializedStr, CORRECT_MESSAGE); } { @@ -175,8 +175,8 @@ Y_UNIT_TEST_SUITE(TTestProtoBufIO) { } { NProtobufUtilUt::TTextTest m; - const auto f = [&correctFileName](NProtobufUtilUt::TTextTest& mm) { - mm = ParseFromTextFormat<NProtobufUtilUt::TTextTest>( + const auto f = [&correctFileName](NProtobufUtilUt::TTextTest& mm) { + mm = ParseFromTextFormat<NProtobufUtilUt::TTextTest>( correctFileName, EParseFromTextFormatOption::AllowUnknownField); }; @@ -186,8 +186,8 @@ Y_UNIT_TEST_SUITE(TTestProtoBufIO) { { const NProtobufUtilUt::TTextTest empty; NProtobufUtilUt::TTextTest m; - const auto f = [&incorrectFileName](NProtobufUtilUt::TTextTest& mm) { - mm = ParseFromTextFormat<NProtobufUtilUt::TTextTest>( + const auto f = [&incorrectFileName](NProtobufUtilUt::TTextTest& mm) { + mm = ParseFromTextFormat<NProtobufUtilUt::TTextTest>( incorrectFileName, EParseFromTextFormatOption::AllowUnknownField); }; @@ -258,8 +258,8 @@ Y_UNIT_TEST_SUITE(TTestProtoBufIO) { const TFsPath correctFileName = TFsPath{tempDir()} / "correct.pb.txt"; const TFsPath incorrectFileName = TFsPath{tempDir()} / "incorrect.pb.txt"; - TFileOutput{correctFileName}.Write(CORRECT_MESSAGE); - TFileOutput{incorrectFileName}.Write(INCORRECT_MESSAGE); + TFileOutput{correctFileName}.Write(CORRECT_MESSAGE); + TFileOutput{incorrectFileName}.Write(INCORRECT_MESSAGE); { NProtobufUtilUt::TTextTest message; @@ -341,7 +341,7 @@ Y_UNIT_TEST_SUITE(TTestProtoBufIO) { const TFsPath correctFileName2 = TFsPath{tempDir()} / "serialized.pb.txt"; const auto original = GetCorrectMessage(); UNIT_ASSERT_NO_EXCEPTION(SerializeToTextFormat(original, correctFileName2)); - const auto serializedStr = TUnbufferedFileInput{correctFileName2}.ReadAll(); + const auto serializedStr = TUnbufferedFileInput{correctFileName2}.ReadAll(); UNIT_ASSERT_VALUES_EQUAL(serializedStr, CORRECT_MESSAGE); } { diff --git a/library/cpp/protobuf/util/simple_reflection_ut.cpp b/library/cpp/protobuf/util/simple_reflection_ut.cpp index 28a1d3d360..169d4703c9 100644 --- a/library/cpp/protobuf/util/simple_reflection_ut.cpp +++ b/library/cpp/protobuf/util/simple_reflection_ut.cpp @@ -157,7 +157,7 @@ Y_UNIT_TEST_SUITE(ProtobufSimpleReflection) { TMaybe<TConstField> field = TConstField::ByPath(msg, "OneStr"); UNIT_ASSERT(field); UNIT_ASSERT(field->HasValue()); - UNIT_ASSERT_VALUES_EQUAL("1", (field->Get<TString>())); + UNIT_ASSERT_VALUES_EQUAL("1", (field->Get<TString>())); } { @@ -218,7 +218,7 @@ Y_UNIT_TEST_SUITE(ProtobufSimpleReflection) { TMaybe<TMutableField> field = TMutableField::ByPath(msg, "OneStr"); UNIT_ASSERT(field); UNIT_ASSERT(!field->HasValue()); - field->Set(TString("zz")); + field->Set(TString("zz")); UNIT_ASSERT(field->HasValue()); UNIT_ASSERT_VALUES_EQUAL("zz", msg.GetOneStr()); } @@ -227,7 +227,7 @@ Y_UNIT_TEST_SUITE(ProtobufSimpleReflection) { TMaybe<TMutableField> field = TMutableField::ByPath(msg, "OneStr"); UNIT_ASSERT(field); UNIT_ASSERT(field->HasValue()); - field->Set(TString("dd")); + field->Set(TString("dd")); UNIT_ASSERT(field->HasValue()); UNIT_ASSERT_VALUES_EQUAL("dd", msg.GetOneStr()); } @@ -268,7 +268,7 @@ Y_UNIT_TEST_SUITE(ProtobufSimpleReflection) { { TMaybe<TMutableField> field = TMutableField::ByPath(msg, "RepMsg/RepInt", true); TMaybe<TMutableField> fieldCopy = TMutableField::ByPath(msg, "RepMsg/RepInt", true); - Y_UNUSED(fieldCopy); + Y_UNUSED(fieldCopy); UNIT_ASSERT(field); UNIT_ASSERT(!field->HasValue()); UNIT_ASSERT_VALUES_EQUAL(1, msg.RepMsgSize()); diff --git a/library/cpp/protobuf/util/walk_ut.cpp b/library/cpp/protobuf/util/walk_ut.cpp index 134c0a49f7..2ea6071b17 100644 --- a/library/cpp/protobuf/util/walk_ut.cpp +++ b/library/cpp/protobuf/util/walk_ut.cpp @@ -37,8 +37,8 @@ Y_UNIT_TEST_SUITE(ProtobufWalk) { TMutableField f(msg, fd); if (f.IsString()) { for (size_t i = 0; i < f.Size(); ++i) - if (f.Get<TString>(i).StartsWith('1')) - f.Set(f.Get<TString>(i) + f.Get<TString>(i), i); + if (f.Get<TString>(i).StartsWith('1')) + f.Set(f.Get<TString>(i) + f.Get<TString>(i), i); } return true; } |