aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/json
diff options
context:
space:
mode:
authorandrew-rykov <arykov@ydb.tech>2022-10-07 00:13:31 +0300
committerandrew-rykov <arykov@ydb.tech>2022-10-07 00:13:31 +0300
commit53354011eff56242aedc542ce6884d5b7ca3beb8 (patch)
treef0516a5377c6afde5e2d8ef24e73ac7293c46c94 /library/cpp/json
parent7be9429fa6e226df17f1e04841dc2962e1d8c755 (diff)
downloadydb-53354011eff56242aedc542ce6884d5b7ca3beb8.tar.gz
health checker tests
Diffstat (limited to 'library/cpp/json')
-rw-r--r--library/cpp/json/writer/json_ut.cpp39
1 files changed, 0 insertions, 39 deletions
diff --git a/library/cpp/json/writer/json_ut.cpp b/library/cpp/json/writer/json_ut.cpp
index 9980555683..1768e91224 100644
--- a/library/cpp/json/writer/json_ut.cpp
+++ b/library/cpp/json/writer/json_ut.cpp
@@ -265,43 +265,4 @@ Y_UNIT_TEST_SUITE(JsonWriter) {
UNIT_ASSERT_STRINGS_EQUAL(buf.Str(), R"({"\u003C\u003E&":"Ololo","<>&":"Ololo2"})");
}
}
-
- Y_UNIT_TEST(WriteUninitializedBoolDoesntCrashProgram) {
- // makes sense only in release build w/ address sanitizer
- //
- // passing uninitialized boolean into WriteBool can make cleverly optimized code which is emitted by compiler crash program
- // https://stackoverflow.com/questions/54120862/does-the-c-standard-allow-for-an-uninitialized-bool-to-crash-a-program
-
- // looks like compiler can detect UB at compile time in simple cases, but not in this one
- class TSensorConf {
- public:
- class TAggrRuleItem {
- public:
- TVector<TString> Cond;
- TVector<TString> Target;
- };
-
- TString ToString() const {
- NJson::TJsonValue jsonValue;
- NJsonWriter::TBuf jsonOutput;
- jsonOutput.BeginObject()
- .WriteKey("rawDataMemOnly").WriteBool(RawDataMemOnly)
- .WriteKey("aggrRules").BeginList();
-
- jsonOutput.EndList()
- .EndObject();
-
- return jsonOutput.Str();
- }
-
- TVector<TAggrRuleItem> AggrRules;
- bool RawDataMemOnly;
- };
-
- TSensorConf s;
- NSan::Unpoison(&s.RawDataMemOnly, sizeof(s.RawDataMemOnly));
- auto p = s.ToString();
- // doesn't really matter
- UNIT_ASSERT(!p.empty());
- }
}