diff options
author | andrew-rykov <arykov@ydb.tech> | 2022-10-07 00:13:31 +0300 |
---|---|---|
committer | andrew-rykov <arykov@ydb.tech> | 2022-10-07 00:13:31 +0300 |
commit | 53354011eff56242aedc542ce6884d5b7ca3beb8 (patch) | |
tree | f0516a5377c6afde5e2d8ef24e73ac7293c46c94 /library/cpp/json | |
parent | 7be9429fa6e226df17f1e04841dc2962e1d8c755 (diff) | |
download | ydb-53354011eff56242aedc542ce6884d5b7ca3beb8.tar.gz |
health checker tests
Diffstat (limited to 'library/cpp/json')
-rw-r--r-- | library/cpp/json/writer/json_ut.cpp | 39 |
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()); - } } |