diff options
author | familom <familom@yandex-team.ru> | 2022-02-10 16:49:49 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:49 +0300 |
commit | f281aaf77179d27d6208b873e95ae6cd45765a63 (patch) | |
tree | b4229c6ece98c855bd9821ef0b656042c29a8953 /library/cpp/protobuf/json/ut/json.h | |
parent | 53d07fb9e28d179add32cd299c9341bf8a231a31 (diff) | |
download | ydb-f281aaf77179d27d6208b873e95ae6cd45765a63.tar.gz |
Restoring authorship annotation for <familom@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/protobuf/json/ut/json.h')
-rw-r--r-- | library/cpp/protobuf/json/ut/json.h | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/library/cpp/protobuf/json/ut/json.h b/library/cpp/protobuf/json/ut/json.h index c1f108e6e4..4f942f347b 100644 --- a/library/cpp/protobuf/json/ut/json.h +++ b/library/cpp/protobuf/json/ut/json.h @@ -1,34 +1,34 @@ -#pragma once - +#pragma once + #include <library/cpp/protobuf/json/ut/test.pb.h> - + #include <library/cpp/json/json_value.h> - -#include <cstdarg> - -#include <util/generic/hash_set.h> + +#include <cstdarg> + +#include <util/generic/hash_set.h> #include <util/generic/string.h> - -#include <util/system/defaults.h> - -namespace NProtobufJsonTest { + +#include <util/system/defaults.h> + +namespace NProtobufJsonTest { inline NJson::TJsonValue CreateFlatJson(const THashSet<TString>& skippedKeys = THashSet<TString>()) { NJson::TJsonValue json; - + #define DEFINE_FIELD(name, value) \ if (skippedKeys.find(#name) == skippedKeys.end()) \ - json.InsertValue(#name, value); -#include "fields.incl" -#undef DEFINE_FIELD - + json.InsertValue(#name, value); +#include "fields.incl" +#undef DEFINE_FIELD + return json; } - + inline NJson::TJsonValue CreateRepeatedFlatJson(const THashSet<TString>& skippedKeys = THashSet<TString>()) { NJson::TJsonValue json; - + #define DEFINE_REPEATED_FIELD(name, type, ...) \ if (skippedKeys.find(#name) == skippedKeys.end()) { \ type values[] = {__VA_ARGS__}; \ @@ -37,22 +37,22 @@ namespace NProtobufJsonTest { array.AppendValue(values[i]); \ } \ json.InsertValue(#name, array); \ - } -#include "repeated_fields.incl" -#undef DEFINE_REPEATED_FIELD - + } +#include "repeated_fields.incl" +#undef DEFINE_REPEATED_FIELD + return json; } - + inline NJson::TJsonValue CreateCompositeJson(const THashSet<TString>& skippedKeys = THashSet<TString>()) { const NJson::TJsonValue& part = CreateFlatJson(skippedKeys); NJson::TJsonValue json; json.InsertValue("Part", part); - + return json; } - + #define UNIT_ASSERT_JSONS_EQUAL(lhs, rhs) \ if (lhs != rhs) { \ UNIT_ASSERT_STRINGS_EQUAL(lhs.GetStringRobust(), rhs.GetStringRobust()); \ |