diff options
| author | nae202 <[email protected]> | 2025-09-23 07:48:35 +0300 | 
|---|---|---|
| committer | nae202 <[email protected]> | 2025-09-23 08:03:21 +0300 | 
| commit | 63774bc851bb76e24f369ef4e0328e5f05edbb4b (patch) | |
| tree | d3226ed9a5f200097949f6001a7e3183aff7adfa /library/cpp/json/ordered_maps/ut | |
| parent | f4cbf746a0b6649479cfb305eceababced0ac10a (diff) | |
Style fix
commit_hash:d506e2a0f2770f3662449a3711e976499eb9ccbb
Diffstat (limited to 'library/cpp/json/ordered_maps/ut')
6 files changed, 34 insertions, 38 deletions
| diff --git a/library/cpp/json/ordered_maps/ut/json_ordered_ut.cpp b/library/cpp/json/ordered_maps/ut/json_ordered_ut.cpp index 93d81485660..0312f0b6960 100644 --- a/library/cpp/json/ordered_maps/ut/json_ordered_ut.cpp +++ b/library/cpp/json/ordered_maps/ut/json_ordered_ut.cpp @@ -265,4 +265,4 @@ Y_UNIT_TEST_SUITE(JsonWriter) {              UNIT_ASSERT_STRINGS_EQUAL(buf.Str(), R"({"\u003C\u003E&":"Ololo","<>&":"Ololo2"})");          }      } -} +} // Y_UNIT_TEST_SUITE(JsonWriter) diff --git a/library/cpp/json/ordered_maps/ut/json_reader_fast_ordered_ut.cpp b/library/cpp/json/ordered_maps/ut/json_reader_fast_ordered_ut.cpp index de9702f8775..8dc7f1e26d0 100644 --- a/library/cpp/json/ordered_maps/ut/json_reader_fast_ordered_ut.cpp +++ b/library/cpp/json/ordered_maps/ut/json_reader_fast_ordered_ut.cpp @@ -86,7 +86,7 @@ namespace NJson::NOrderedJson {          using TEvents = TVector<TEvent>; -        struct TTestHandler : TJsonCallbacks { +        struct TTestHandler: TJsonCallbacks {              TEvents Events;              bool OnOpenMap() override { @@ -167,8 +167,8 @@ namespace NJson::NOrderedJson {                  }              }          }; -    } -} +    } // namespace NTest +} // namespace NJson::NOrderedJson  class TFastJsonTest: public TTestBase {      UNIT_TEST_SUITE(TFastJsonTest) @@ -263,14 +263,14 @@ public:          DoTestParse<true>("{}", 2, E_DICT_OPEN, E_DICT_CLOSE);          DoTestParse<true>("{ a : x, b : [ c, d, ] }", 9, E_DICT_OPEN, E_KEY, "a", E_STR, "x", E_KEY, "b", E_ARR_OPEN, E_STR, "c", E_STR, "d", E_ARR_CLOSE, E_DICT_CLOSE);          DoTestParse<false>("{ a : x, b : [ c, d,, ] }", 8, E_DICT_OPEN, E_KEY, "a", E_STR, "x", E_KEY, "b", E_ARR_OPEN, E_STR, "c", E_STR, "d", E_ERROR, "invalid syntax at token: ','"); -        //        DoTestParse<false>("{ a : x : y }", 4, E_DICT_OPEN -        //                    , E_KEY, "a", E_STR, "x" -        //                    , E_ERROR -        //                    , ":"); -        //        DoTestParse<false>("{queries:{ref:[]},{nonref:[]}}", 8, E_DICT_OPEN -        //                           , E_KEY, "queries", E_DICT_OPEN -        //                               , E_KEY, "ref", E_ARR_OPEN, E_ARR_CLOSE -        //                               , E_DICT_CLOSE, E_ERROR, ""); +        // DoTestParse<false>("{ a : x : y }", 4, E_DICT_OPEN +        //             , E_KEY, "a", E_STR, "x" +        //             , E_ERROR +        //             , ":"); +        // DoTestParse<false>("{queries:{ref:[]},{nonref:[]}}", 8, E_DICT_OPEN +        //                    , E_KEY, "queries", E_DICT_OPEN +        //                        , E_KEY, "ref", E_ARR_OPEN, E_ARR_CLOSE +        //                        , E_DICT_CLOSE, E_ERROR, "");          DoTestParse<true>("'100x00'", 1, E_STR, "100x00");          DoTestParse<true>("-1", 1, E_INT, -1);          DoTestParse<true>("-9223372036854775808", 1, E_LONG_LONG, (long long)Min<i64>()); diff --git a/library/cpp/json/ordered_maps/ut/json_reader_nan_ordered_ut.cpp b/library/cpp/json/ordered_maps/ut/json_reader_nan_ordered_ut.cpp index 71c3cc2e7a6..3bec567509e 100644 --- a/library/cpp/json/ordered_maps/ut/json_reader_nan_ordered_ut.cpp +++ b/library/cpp/json/ordered_maps/ut/json_reader_nan_ordered_ut.cpp @@ -5,9 +5,9 @@ using namespace NJson::NOrderedJson;  namespace { -constexpr TStringBuf JSON_NAN_TEST = "{ \"Value1\": 0.0, \"Value2\": 1, \"Value3\": NaN }"; +    constexpr TStringBuf JSON_NAN_TEST = "{ \"Value1\": 0.0, \"Value2\": 1, \"Value3\": NaN }"; -} +} // namespace  Y_UNIT_TEST_SUITE(TJsonReaderNanTest) {      Y_UNIT_TEST(WithoutNanTest) { @@ -15,7 +15,6 @@ Y_UNIT_TEST_SUITE(TJsonReaderNanTest) {          TJsonValue out;          // This read will fail          UNIT_ASSERT(!ReadJsonTree(JSON_NAN_TEST, &cfg, &out, /* throwOnError */ false)); -      }      Y_UNIT_TEST(WithNanTest) {          TJsonReaderConfig cfg; @@ -25,5 +24,4 @@ Y_UNIT_TEST_SUITE(TJsonReaderNanTest) {          // This read will ok          UNIT_ASSERT(ReadJsonTree(JSON_NAN_TEST, &cfg, &out, /* throwOnError */ false));      } -} - +} // Y_UNIT_TEST_SUITE(TJsonReaderNanTest) diff --git a/library/cpp/json/ordered_maps/ut/json_reader_ordered_ut.cpp b/library/cpp/json/ordered_maps/ut/json_reader_ordered_ut.cpp index bd317cf7a6f..5c4c2ce36ad 100644 --- a/library/cpp/json/ordered_maps/ut/json_reader_ordered_ut.cpp +++ b/library/cpp/json/ordered_maps/ut/json_reader_ordered_ut.cpp @@ -374,7 +374,7 @@ Y_UNIT_TEST_SUITE(TJsonReaderTest) {              UNIT_ASSERT_EQUAL(value["test"].GetDouble(), 0.0);              UNIT_ASSERT_EQUAL(value["test"].GetDoubleRobust(), static_cast<double>(Max<ui64>()));          } // Max<ui64>() -    }     // TJsonDoubleTest +    } // TJsonDoubleTest      Y_UNIT_TEST(TJsonInvalidTest) {          { @@ -473,12 +473,10 @@ Y_UNIT_TEST_SUITE(TJsonReaderTest) {              UNIT_ASSERT(!ReadJsonTree(&jsonStream, &config, &v));          }      } -} - +} // Y_UNIT_TEST_SUITE(TJsonReaderTest)  static const TString YANDEX_STREAMING_JSON("{\"a\":1}//d{\"b\":2}"); -  Y_UNIT_TEST_SUITE(TCompareReadJsonFast) {      Y_UNIT_TEST(NoEndl) {          NJson::NOrderedJson::TJsonValue parsed; @@ -504,4 +502,4 @@ Y_UNIT_TEST_SUITE(TCompareReadJsonFast) {          bool fast_success = NJson::NOrderedJson::ReadJsonFastTree(streamingJson, &parsed, false);          UNIT_ASSERT(success != fast_success);      } -} +} // Y_UNIT_TEST_SUITE(TCompareReadJsonFast) diff --git a/library/cpp/json/ordered_maps/ut/json_value_ordered_ut.cpp b/library/cpp/json/ordered_maps/ut/json_value_ordered_ut.cpp index d9c798410bc..20428da5c4a 100644 --- a/library/cpp/json/ordered_maps/ut/json_value_ordered_ut.cpp +++ b/library/cpp/json/ordered_maps/ut/json_value_ordered_ut.cpp @@ -8,10 +8,10 @@ using namespace NJson::NOrderedJson;  Y_UNIT_TEST_SUITE(TJsonValueTest) {      Y_UNIT_TEST(Equal) { -         UNIT_ASSERT(1 == TJsonValue(1)); -         UNIT_ASSERT(TJsonValue(1) == 1); -         UNIT_ASSERT(2 != TJsonValue(1)); -         UNIT_ASSERT(TJsonValue(1) != 2); +        UNIT_ASSERT(1 == TJsonValue(1)); +        UNIT_ASSERT(TJsonValue(1) == 1); +        UNIT_ASSERT(2 != TJsonValue(1)); +        UNIT_ASSERT(TJsonValue(1) != 2);      }      Y_UNIT_TEST(UndefTest) { @@ -175,14 +175,17 @@ Y_UNIT_TEST_SUITE(TJsonValueTest) {              const int NUM_KEYS = 1000;              TJsonValue lhs; -            for (int i = 0; i < NUM_KEYS; ++i) +            for (int i = 0; i < NUM_KEYS; ++i) {                  lhs.InsertValue(ToString(i), i); +            }              TJsonValue rhs; -            for (int i = 0; i < NUM_KEYS; i += 2) +            for (int i = 0; i < NUM_KEYS; i += 2) {                  rhs.InsertValue(ToString(i), i); -            for (int i = 1; i < NUM_KEYS; i += 2) +            } +            for (int i = 1; i < NUM_KEYS; i += 2) {                  rhs.InsertValue(ToString(i), i); +            }              UNIT_ASSERT(lhs == rhs);              UNIT_ASSERT(rhs == lhs); @@ -728,8 +731,7 @@ Y_UNIT_TEST_SUITE(TJsonValueTest) {              NJson::TJsonValue(NJson::JSON_ARRAY),              NJson::TJsonValue(NJson::JSON_MAP),              nonEmptyArray, -            nonEmptyMap -        }; +            nonEmptyMap};          for (const auto& val : values) {              TJsonValue ordered(val); @@ -877,8 +879,7 @@ Y_UNIT_TEST_SUITE(TJsonValueTest) {              TJsonValue(3.14),              TJsonValue("test string"),              TJsonValue(JSON_ARRAY), -            TJsonValue(JSON_MAP) -        }; +            TJsonValue(JSON_MAP)};          for (auto& original : values) {              TStringStream ss; @@ -891,8 +892,7 @@ Y_UNIT_TEST_SUITE(TJsonValueTest) {                  original.IsBoolean() || original.IsInteger() ||                  original.IsUInteger() || original.IsDouble() ||                  original.IsString() || original.IsNull() || -                !original.IsDefined() -            ) { +                !original.IsDefined()) {                  UNIT_ASSERT(loaded == original);              } else if (original.IsMap()) {                  UNIT_ASSERT(loaded.IsMap()); @@ -944,4 +944,4 @@ Y_UNIT_TEST_SUITE(TJsonValueTest) {              UNIT_ASSERT_VALUES_EQUAL(it->second.GetIntegerRobust(), i);          }      } -} // TJsonValueTest +} // Y_UNIT_TEST_SUITE(TJsonValueTest) diff --git a/library/cpp/json/ordered_maps/ut/json_writer_ordered_ut.cpp b/library/cpp/json/ordered_maps/ut/json_writer_ordered_ut.cpp index 1e6213668fc..70cde050d61 100644 --- a/library/cpp/json/ordered_maps/ut/json_writer_ordered_ut.cpp +++ b/library/cpp/json/ordered_maps/ut/json_writer_ordered_ut.cpp @@ -120,7 +120,7 @@ Y_UNIT_TEST_SUITE(TJsonWriterTest) {              WriteJson(&out, &v);              UNIT_ASSERT_VALUES_EQUAL(out.Str(), expected);          } // 18446744073709551615 -    }     // SimpleUnsignedIntegerWriteTest +    } // SimpleUnsignedIntegerWriteTest      Y_UNIT_TEST(WriteOptionalTest) {          { @@ -225,4 +225,4 @@ Y_UNIT_TEST_SUITE(TJsonWriterTest) {              UNIT_ASSERT_VALUES_EQUAL(actual, expected);          }      } -} +} // Y_UNIT_TEST_SUITE(TJsonWriterTest) | 
