diff options
author | iddqd <iddqd@yandex-team.ru> | 2022-02-10 16:49:45 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:45 +0300 |
commit | 07fce9c5f7771600d0b3d70e1f88fd8a7e164d85 (patch) | |
tree | e4aa4750fbb864d70f8c06cf03d2750e979ea3bf /library/cpp/testing | |
parent | af42068bf6cd93c976b80dd0388fa48cdf65da11 (diff) | |
download | ydb-07fce9c5f7771600d0b3d70e1f88fd8a7e164d85.tar.gz |
Restoring authorship annotation for <iddqd@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/testing')
-rw-r--r-- | library/cpp/testing/unittest/gtest.cpp | 2 | ||||
-rw-r--r-- | library/cpp/testing/unittest/gtest.h | 6 | ||||
-rw-r--r-- | library/cpp/testing/unittest/registar.h | 24 | ||||
-rw-r--r-- | library/cpp/testing/unittest/utmain.cpp | 10 |
4 files changed, 21 insertions, 21 deletions
diff --git a/library/cpp/testing/unittest/gtest.cpp b/library/cpp/testing/unittest/gtest.cpp index ebad1ea4d6..e064938f13 100644 --- a/library/cpp/testing/unittest/gtest.cpp +++ b/library/cpp/testing/unittest/gtest.cpp @@ -46,7 +46,7 @@ namespace { return new TCurrentTest(Test); } - void AddTest(const char* name, void (*body)(TTestContext&), bool forceFork) override { + void AddTest(const char* name, void (*body)(TTestContext&), bool forceFork) override { Test.Tests.push_back(TBaseTestCase(name, body, forceFork)); } diff --git a/library/cpp/testing/unittest/gtest.h b/library/cpp/testing/unittest/gtest.h index b6768b1bf0..7dc5eac4a2 100644 --- a/library/cpp/testing/unittest/gtest.h +++ b/library/cpp/testing/unittest/gtest.h @@ -15,7 +15,7 @@ namespace NUnitTest { struct IGTestFactory: public ITestBaseFactory { ~IGTestFactory() override; - virtual void AddTest(const char* name, void (*body)(TTestContext&), bool forceFork) = 0; + virtual void AddTest(const char* name, void (*body)(TTestContext&), bool forceFork) = 0; }; IGTestFactory* ByName(const char* name); @@ -42,7 +42,7 @@ namespace testing { } #define TEST_IMPL(N, NN, FF) \ - void Test##N##NN(NUnitTest::TTestContext&); \ + void Test##N##NN(NUnitTest::TTestContext&); \ namespace NTestSuite##N##NN { \ struct TReg { \ inline TReg() { \ @@ -51,7 +51,7 @@ namespace testing { }; \ static TReg reg; \ } \ - void Test##N##NN(NUnitTest::TTestContext&) + void Test##N##NN(NUnitTest::TTestContext&) #define TEST_F_IMPL(N, NN, FF) \ namespace NTestSuite##N##NN { \ diff --git a/library/cpp/testing/unittest/registar.h b/library/cpp/testing/unittest/registar.h index 44517a0092..dd62a5110b 100644 --- a/library/cpp/testing/unittest/registar.h +++ b/library/cpp/testing/unittest/registar.h @@ -62,7 +62,7 @@ namespace NUnitTest { class ITestSuiteProcessor; - struct TTestContext { + struct TTestContext { TTestContext() : Processor(nullptr) { @@ -74,11 +74,11 @@ namespace NUnitTest { } using TMetrics = THashMap<TString, double>; - TMetrics Metrics; + TMetrics Metrics; ITestSuiteProcessor* Processor; - }; - + }; + class ITestSuiteProcessor { public: struct TUnit { @@ -285,8 +285,8 @@ private: \ #define CATCH_REACTION(FN, e, context) this->AddError(("(" + TypeName(e) + ") " + e.what()).data(), context) #define CATCH_REACTION_BT(FN, e, context) this->AddError(("(" + TypeName(e) + ") " + e.what()).data(), (e.BackTrace() ? e.BackTrace()->PrintToString() : TString()), context) #else -#define CATCH_REACTION(FN, e, context) throw -#define CATCH_REACTION_BT(FN, e, context) throw +#define CATCH_REACTION(FN, e, context) throw +#define CATCH_REACTION_BT(FN, e, context) throw #endif #define UNIT_TEST_CHECK_TEST_IS_DECLARED_ONLY_ONCE(F) \ @@ -334,7 +334,7 @@ private: \ if (this->GetForkTests() && !this->GetIsForked()) { \ UNIT_TEST_IMPL(F, false); \ /* forked process (or main without "--fork-tests") treats some exceptions as success - it's exception test! */ \ - } else { \ + } else { \ NUnitTest::TTestContext context(this->TTestBase::Processor()); \ if (this->CheckAccessTest((#F))) { \ try { \ @@ -350,9 +350,9 @@ private: \ } catch (...) { \ this->AddError("non-std exception!", &context); \ } \ - this->Finish((#F), &context); \ - } \ - } + this->Finish((#F), &context); \ + } \ + } #define UNIT_TEST_SUITE_END() \ this->AtEnd(); \ @@ -753,7 +753,7 @@ public: \ #define UNIT_ASSERT_TEST_FAILS(A) UNIT_ASSERT_TEST_FAILS_C(A, "") #define UNIT_ADD_METRIC(name, value) ut_context.Metrics[name] = value - + class TTestFactory { friend class TTestBase; friend class ITestBaseFactory; @@ -1010,7 +1010,7 @@ public: \ #define Y_UNIT_TEST_IMPL(N, FF, F) \ Y_UNIT_TEST_IMPL_REGISTER(N, FF, F) \ void TTestCase##N::Execute_(NUnitTest::TTestContext& ut_context Y_DECLARE_UNUSED) - + #define Y_UNIT_TEST(N) Y_UNIT_TEST_IMPL(N, false, TCurrentTestCase) #define Y_UNIT_TEST_F(N, F) Y_UNIT_TEST_IMPL(N, false, F) #define SIMPLE_UNIT_FORKED_TEST(N) Y_UNIT_TEST_IMPL(N, true, TCurrentTestCase) diff --git a/library/cpp/testing/unittest/utmain.cpp b/library/cpp/testing/unittest/utmain.cpp index 305bc6b40f..2c1dcc4208 100644 --- a/library/cpp/testing/unittest/utmain.cpp +++ b/library/cpp/testing/unittest/utmain.cpp @@ -89,11 +89,11 @@ private: event.InsertValue("status", status); event.InsertValue("comment", comment.data()); event.InsertValue("time", (now - PrevTime).SecondsFloat()); - if (context) { - for (const auto& metric : context->Metrics) { - event["metrics"].InsertValue(metric.first, metric.second); - } - } + if (context) { + for (const auto& metric : context->Metrics) { + event["metrics"].InsertValue(metric.first, metric.second); + } + } Trace("subtest-finished", event); PrevTime = now; |