diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:15 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:15 +0300 |
commit | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch) | |
tree | da2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /util/system/backtrace_ut.cpp | |
parent | 778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff) | |
download | ydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'util/system/backtrace_ut.cpp')
-rw-r--r-- | util/system/backtrace_ut.cpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/util/system/backtrace_ut.cpp b/util/system/backtrace_ut.cpp index 9b5ead71bc..4f5e143a1e 100644 --- a/util/system/backtrace_ut.cpp +++ b/util/system/backtrace_ut.cpp @@ -1,10 +1,10 @@ -#include "backtrace.h" - +#include "backtrace.h" + #include <util/generic/array_ref.h> #include <library/cpp/testing/unittest/registar.h> #include <util/stream/output.h> - + using PFunc = int (*)(void**, size_t); int Dbg1(void** buf, size_t len) { @@ -17,35 +17,35 @@ int Dbg2(void** buf, size_t len) { return ret; } -void FormatBackTraceReplacement(IOutputStream* out, void* const*, size_t) { +void FormatBackTraceReplacement(IOutputStream* out, void* const*, size_t) { *out << "WorksLikeACharm" << Endl; } -void SomeMethod() { - TStringStream out; - - FormatBackTrace(&out); - -#if defined(_musl_) - // musl dladdr broken for us now - return; -#endif - +void SomeMethod() { + TStringStream out; + + FormatBackTrace(&out); + +#if defined(_musl_) + // musl dladdr broken for us now + return; +#endif + UNIT_ASSERT(out.Empty() || out.Str().find("SomeMethod") != TString::npos); -} - -class TBackTraceTest: public TTestBase { +} + +class TBackTraceTest: public TTestBase { UNIT_TEST_SUITE(TBackTraceTest); - UNIT_TEST(TestBackTrace) + UNIT_TEST(TestBackTrace) UNIT_TEST(TestBackTraceView) - UNIT_TEST(TestPrintBackTrace) + UNIT_TEST(TestPrintBackTrace) UNIT_TEST(TestSetFormatBackTraceFn) UNIT_TEST_SUITE_END(); - void TestPrintBackTrace() { - SomeMethod(); - } - + void TestPrintBackTrace() { + SomeMethod(); + } + void TestSetFormatBackTraceFn() { TFormatBackTraceFn prevFn = SetFormatBackTraceFn(FormatBackTraceReplacement); TStringStream out; @@ -56,7 +56,7 @@ class TBackTraceTest: public TTestBase { } void TestBackTrace() { - //PrintBackTrace(); + //PrintBackTrace(); void* buf1[100]; size_t ret1; |