Skip to content

Commit 0783ec6

Browse files
committed
Fixed tests
1 parent 66b1259 commit 0783ec6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+145
-1915
lines changed

library/cpp/coroutine/engine/stack/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ add_ydb_test(NAME coroutine-engine-stack-ut GTEST
77
ut/stack_utils_ut.cpp
88
LINK_LIBRARIES
99
coroutine-engine
10-
cpp-testing-gtest_main
10+
GTest::gtest_main
1111
LABELS
1212
unit
1313
)

library/cpp/coroutine/engine/stack/ut/stack_allocator_ut.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include <library/cpp/coroutine/engine/stack/stack_allocator.h>
22
#include <library/cpp/coroutine/engine/stack/stack_common.h>
3-
#include <library/cpp/testing/gtest/gtest.h>
3+
#include <gtest/gtest.h>
44

55

66
using namespace testing;

library/cpp/coroutine/engine/stack/ut/stack_guards_ut.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include <library/cpp/coroutine/engine/stack/stack_common.h>
22
#include <library/cpp/coroutine/engine/stack/stack_guards.h>
33
#include <library/cpp/coroutine/engine/stack/stack_utils.h>
4-
#include <library/cpp/testing/gtest/gtest.h>
4+
#include <gtest/gtest.h>
55

66

77
using namespace testing;

library/cpp/coroutine/engine/stack/ut/stack_pool_ut.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include <library/cpp/coroutine/engine/stack/stack_common.h>
22
#include <library/cpp/coroutine/engine/stack/stack_guards.h>
33
#include <library/cpp/coroutine/engine/stack/stack_pool.h>
4-
#include <library/cpp/testing/gtest/gtest.h>
4+
#include <gtest/gtest.h>
55

66

77
using namespace testing;

library/cpp/coroutine/engine/stack/ut/stack_ut.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <library/cpp/coroutine/engine/stack/stack_common.h>
33
#include <library/cpp/coroutine/engine/stack/stack_guards.h>
44
#include <library/cpp/coroutine/engine/stack/stack_utils.h>
5-
#include <library/cpp/testing/gtest/gtest.h>
5+
#include <gtest/gtest.h>
66

77

88
using namespace testing;

library/cpp/coroutine/engine/stack/ut/stack_utils_ut.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include <library/cpp/coroutine/engine/stack/stack_common.h>
22
#include <library/cpp/coroutine/engine/stack/stack_utils.h>
3-
#include <library/cpp/testing/gtest/gtest.h>
3+
#include <gtest/gtest.h>
44

55

66
using namespace testing;

library/cpp/json/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,7 @@ target_sources(json
5757
json_prettifier.cpp
5858
rapidjson_helpers.cpp
5959
)
60+
target_compile_definitions(json PUBLIC
61+
DISABLE_JSON_ESCAPE
62+
)
6063
_ydb_sdk_install_targets(TARGETS json)

library/cpp/json/json_reader.cpp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -347,11 +347,11 @@ namespace NJson {
347347
if (flags & ReaderConfigFlags::VALIDATE) {
348348
rapidjsonFlags |= rapidjson::kParseValidateEncodingFlag;
349349
}
350-
351-
// if (flags & ReaderConfigFlags::ESCAPE) {
352-
// rapidjsonFlags |= rapidjson::kParseEscapedApostropheFlag;
353-
// }
354-
350+
#ifndef DISABLE_JSON_ESCAPE
351+
if (flags & ReaderConfigFlags::ESCAPE) {
352+
rapidjsonFlags |= rapidjson::kParseEscapedApostropheFlag;
353+
}
354+
#endif
355355
return rapidjsonFlags;
356356
}
357357

@@ -374,7 +374,9 @@ namespace NJson {
374374
TRY_EXTRACT_FLAG(ReaderConfigFlags::ITERATIVE);
375375
TRY_EXTRACT_FLAG(ReaderConfigFlags::COMMENTS);
376376
TRY_EXTRACT_FLAG(ReaderConfigFlags::VALIDATE);
377+
#ifndef DISABLE_JSON_ESCAPE
377378
TRY_EXTRACT_FLAG(ReaderConfigFlags::ESCAPE);
379+
#endif
378380

379381
#undef TRY_EXTRACT_FLAG
380382

@@ -401,10 +403,11 @@ namespace NJson {
401403
if (config.DontValidateUtf8) {
402404
flags &= ~(ReaderConfigFlags::VALIDATE);
403405
}
404-
406+
#ifndef DISABLE_JSON_ESCAPE
405407
if (config.AllowEscapedApostrophe) {
406408
flags |= ReaderConfigFlags::ESCAPE;
407409
}
410+
#endif
408411

409412
return ReadWithRuntimeFlags(flags, reader, is, handler);
410413
}
@@ -584,14 +587,14 @@ namespace NJson {
584587
config.AllowComments = allowComments;
585588
return ReadJson(in, &config, cbs);
586589
}
587-
590+
#ifndef DISABLE_JSON_ESCAPE
588591
bool ReadJson(IInputStream* in, bool allowComments, bool allowEscapedApostrophe, TJsonCallbacks* cbs) {
589592
TJsonReaderConfig config;
590593
config.AllowComments = allowComments;
591594
config.AllowEscapedApostrophe = allowEscapedApostrophe;
592595
return ReadJson(in, &config, cbs);
593596
}
594-
597+
#endif
595598
bool ReadJson(IInputStream* in, const TJsonReaderConfig* config, TJsonCallbacks* cbs) {
596599
TJsonCallbacksWrapper wrapper(*cbs);
597600
TInputStreamWrapper is(*in);

library/cpp/json/json_reader.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ namespace NJson {
1919
// js-style comments (both // and /**/)
2020
bool AllowComments = false;
2121
bool DontValidateUtf8 = false;
22+
#ifndef DISABLE_JSON_ESCAPE
2223
bool AllowEscapedApostrophe = false;
24+
#endif
2325

2426
ui64 MaxDepth = 0;
2527

@@ -44,14 +46,18 @@ namespace NJson {
4446

4547
bool ReadJson(IInputStream* in, TJsonCallbacks* callbacks);
4648
bool ReadJson(IInputStream* in, bool allowComments, TJsonCallbacks* callbacks);
49+
#ifndef DISABLE_JSON_ESCAPE
4750
bool ReadJson(IInputStream* in, bool allowComments, bool allowEscapedApostrophe, TJsonCallbacks* callbacks);
51+
#endif
4852
bool ReadJson(IInputStream* in, const TJsonReaderConfig* config, TJsonCallbacks* callbacks);
4953

5054
enum ReaderConfigFlags {
5155
ITERATIVE = 0b1000,
5256
COMMENTS = 0b0100,
5357
VALIDATE = 0b0010,
58+
#ifndef DISABLE_JSON_ESCAPE
5459
ESCAPE = 0b0001,
60+
#endif
5561
};
5662

5763
inline bool ValidateJson(IInputStream* in, const TJsonReaderConfig* config, bool throwOnError = false) {

library/cpp/json/ut/json_reader_ut.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Y_UNIT_TEST_SUITE(TJsonReaderTest) {
116116

117117
UNIT_ASSERT_VALUES_EQUAL(result1, result2);
118118
}
119-
119+
#ifndef DISABLE_JSON_ESCAPE
120120
Y_UNIT_TEST(TJsonEscapedApostrophe) {
121121
TString jsonString = "{ \"foo\" : \"bar\\'buzz\" }";
122122
{
@@ -139,7 +139,7 @@ Y_UNIT_TEST_SUITE(TJsonReaderTest) {
139139
UNIT_ASSERT_EQUAL(out.Str(), "[\"foo\",\"bar'buzz\"]");
140140
}
141141
}
142-
142+
#endif
143143
Y_UNIT_TEST(TJsonTreeTest) {
144144
TString data = "{\"intkey\": 10, \"double key\": 11.11, \"null value\":null, \"string key\": \"string\", \"array\": [1,2,3,\"TString\"], \"bool key\": true}";
145145
TStringStream in;

0 commit comments

Comments
 (0)