diff options
author | ar7is7 <ar7is7@yandex-team.ru> | 2022-02-10 16:51:44 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:51:44 +0300 |
commit | 2c9aa84a37060f98639ea3e4d0a9a4010be436c9 (patch) | |
tree | ab7fbbf3253d4c0e2793218f09378908beb025fb | |
parent | bca7d3d73d4a870d93fb89f71a12d42cb6a731e0 (diff) | |
download | ydb-2c9aa84a37060f98639ea3e4d0a9a4010be436c9.tar.gz |
Restoring authorship annotation for <ar7is7@yandex-team.ru>. Commit 2 of 2.
-rw-r--r-- | util/system/backtrace.cpp | 26 | ||||
-rw-r--r-- | util/system/backtrace.h | 10 | ||||
-rw-r--r-- | util/system/backtrace_ut.cpp | 24 |
3 files changed, 30 insertions, 30 deletions
diff --git a/util/system/backtrace.cpp b/util/system/backtrace.cpp index c6e4a6a99b..b77fe58fb1 100644 --- a/util/system/backtrace.cpp +++ b/util/system/backtrace.cpp @@ -5,7 +5,7 @@ #include <util/stream/output.h> #include <util/stream/format.h> -#include <util/generic/array_ref.h> +#include <util/generic/array_ref.h> #include <util/generic/string.h> #ifdef _win_ @@ -284,18 +284,18 @@ TString TBackTrace::PrintToString() const { return ss.Str(); } -size_t TBackTrace::size() const { - return Size; -} - -const void* const* TBackTrace::data() const { - return Data; -} - -TBackTrace::operator TBackTraceView() const { - return TBackTraceView(Data, Size); -} - +size_t TBackTrace::size() const { + return Size; +} + +const void* const* TBackTrace::data() const { + return Data; +} + +TBackTrace::operator TBackTraceView() const { + return TBackTraceView(Data, Size); +} + TBackTrace TBackTrace::FromCurrentException() { #ifdef _YNDX_LIBUNWIND_EXCEPTION_BACKTRACE_SIZE TBackTrace result; diff --git a/util/system/backtrace.h b/util/system/backtrace.h index e62ea4c348..2fce7585c3 100644 --- a/util/system/backtrace.h +++ b/util/system/backtrace.h @@ -23,8 +23,8 @@ using TFormatBackTraceFn = void (*)(IOutputStream*, void* const* backtrace, size TFormatBackTraceFn SetFormatBackTraceFn(TFormatBackTraceFn f); TFormatBackTraceFn GetFormatBackTraceFn(); -using TBackTraceView = TArrayRef<void* const>; - +using TBackTraceView = TArrayRef<void* const>; + class TBackTrace { private: static constexpr size_t CAPACITY = 300; @@ -36,9 +36,9 @@ public: void Capture(); void PrintTo(IOutputStream&) const; TString PrintToString() const; - size_t size() const; - const void* const* data() const; - operator TBackTraceView() const; + size_t size() const; + const void* const* data() const; + operator TBackTraceView() const; static TBackTrace FromCurrentException(); }; diff --git a/util/system/backtrace_ut.cpp b/util/system/backtrace_ut.cpp index ebe1d7df8a..9b5ead71bc 100644 --- a/util/system/backtrace_ut.cpp +++ b/util/system/backtrace_ut.cpp @@ -1,6 +1,6 @@ #include "backtrace.h" -#include <util/generic/array_ref.h> +#include <util/generic/array_ref.h> #include <library/cpp/testing/unittest/registar.h> #include <util/stream/output.h> @@ -37,7 +37,7 @@ void SomeMethod() { class TBackTraceTest: public TTestBase { UNIT_TEST_SUITE(TBackTraceTest); UNIT_TEST(TestBackTrace) - UNIT_TEST(TestBackTraceView) + UNIT_TEST(TestBackTraceView) UNIT_TEST(TestPrintBackTrace) UNIT_TEST(TestSetFormatBackTraceFn) UNIT_TEST_SUITE_END(); @@ -70,16 +70,16 @@ class TBackTraceTest: public TTestBase { UNIT_ASSERT_EQUAL(ret1, ret2); } - - void TestBackTraceView() { - try { - throw TWithBackTrace<yexception>(); - } catch (const yexception& e) { - const TBackTrace bt = *e.BackTrace(); - const TBackTraceView btView = bt; - UNIT_ASSERT_VALUES_EQUAL(btView.size(), bt.size()); - } - } + + void TestBackTraceView() { + try { + throw TWithBackTrace<yexception>(); + } catch (const yexception& e) { + const TBackTrace bt = *e.BackTrace(); + const TBackTraceView btView = bt; + UNIT_ASSERT_VALUES_EQUAL(btView.size(), bt.size()); + } + } }; UNIT_TEST_SUITE_REGISTRATION(TBackTraceTest); |