From 64407caacb4d68aeabc6afe1ddd28750bf7522f4 Mon Sep 17 00:00:00 2001 From: myrrc Date: Thu, 10 Feb 2022 16:50:05 +0300 Subject: Restoring authorship annotation for . Commit 2 of 2. --- library/cpp/actors/core/actor.h | 10 ++++---- library/cpp/actors/core/actorsystem.h | 4 ++-- library/cpp/actors/testlib/test_runtime.h | 2 +- library/cpp/testing/unittest/registar.h | 34 ++++++++++++++-------------- library/cpp/testing/unittest/registar_ut.cpp | 26 ++++++++++----------- 5 files changed, 38 insertions(+), 38 deletions(-) (limited to 'library/cpp') diff --git a/library/cpp/actors/core/actor.h b/library/cpp/actors/core/actor.h index b0f529bd62c..ed29bd14b9e 100644 --- a/library/cpp/actors/core/actor.h +++ b/library/cpp/actors/core/actor.h @@ -356,11 +356,11 @@ namespace NActors { return Send(recipient, static_cast(ev.Release()), flags, cookie, std::move(traceId)); } - template - bool Send(TActorId recipient, TEventArgs&& ... args) const { - return Send(recipient, MakeHolder(std::forward(args)...)); - } - + template + bool Send(TActorId recipient, TEventArgs&& ... args) const { + return Send(recipient, MakeHolder(std::forward(args)...)); + } + void Schedule(TInstant deadline, IEventBase* ev, ISchedulerCookie* cookie = nullptr) const noexcept final; void Schedule(TMonotonic deadline, IEventBase* ev, ISchedulerCookie* cookie = nullptr) const noexcept final; void Schedule(TDuration delta, IEventBase* ev, ISchedulerCookie* cookie = nullptr) const noexcept final; diff --git a/library/cpp/actors/core/actorsystem.h b/library/cpp/actors/core/actorsystem.h index 91d539f3c5f..40499d7586f 100644 --- a/library/cpp/actors/core/actorsystem.h +++ b/library/cpp/actors/core/actorsystem.h @@ -193,8 +193,8 @@ namespace NActors { TInterconnectSetup Interconnect; - using TLocalServices = TVector>; - TLocalServices LocalServices; + using TLocalServices = TVector>; + TLocalServices LocalServices; ui32 GetExecutorsCount() const { return Executors ? ExecutorsCount : CpuManager.GetExecutorsCount(); diff --git a/library/cpp/actors/testlib/test_runtime.h b/library/cpp/actors/testlib/test_runtime.h index 37d7b85626b..26e3b45c984 100644 --- a/library/cpp/actors/testlib/test_runtime.h +++ b/library/cpp/actors/testlib/test_runtime.h @@ -94,7 +94,7 @@ namespace NActors { TVector NonEmptyMailboxes; TVector OnlyMailboxes; std::function CustomFinalCondition; - bool Quiet = false; + bool Quiet = false; }; struct TScheduledEventQueueItem { diff --git a/library/cpp/testing/unittest/registar.h b/library/cpp/testing/unittest/registar.h index 454e77a980a..44517a00924 100644 --- a/library/cpp/testing/unittest/registar.h +++ b/library/cpp/testing/unittest/registar.h @@ -627,23 +627,23 @@ public: \ // Assert that a specific exception is thrown #define UNIT_ASSERT_EXCEPTION(A, E) UNIT_ASSERT_EXCEPTION_C(A, E, "") -#define UNIT_ASSERT_NO_EXCEPTION_RESULT_C(A, C) \ - [&] () mutable -> decltype(A) { \ - static_assert(!std::is_void_v); \ - try { return (A); } \ - catch (const ::NUnitTest::TAssertException&) { throw; } \ - catch (...) { \ - UNIT_FAIL_IMPL( \ - "exception-free assertion failed", \ - Sprintf("%s throws %s\nException message: %s", \ - #A, (::TStringBuilder() << C).data(), \ - CurrentExceptionMessage().data())); \ - return decltype(A){}; \ - } \ - }() - -#define UNIT_ASSERT_NO_EXCEPTION_RESULT(A) UNIT_ASSERT_NO_EXCEPTION_RESULT_C(A, "") - +#define UNIT_ASSERT_NO_EXCEPTION_RESULT_C(A, C) \ + [&] () mutable -> decltype(A) { \ + static_assert(!std::is_void_v); \ + try { return (A); } \ + catch (const ::NUnitTest::TAssertException&) { throw; } \ + catch (...) { \ + UNIT_FAIL_IMPL( \ + "exception-free assertion failed", \ + Sprintf("%s throws %s\nException message: %s", \ + #A, (::TStringBuilder() << C).data(), \ + CurrentExceptionMessage().data())); \ + return decltype(A){}; \ + } \ + }() + +#define UNIT_ASSERT_NO_EXCEPTION_RESULT(A) UNIT_ASSERT_NO_EXCEPTION_RESULT_C(A, "") + #define UNIT_ASSERT_NO_EXCEPTION_C(A, C) \ do { \ try { \ diff --git a/library/cpp/testing/unittest/registar_ut.cpp b/library/cpp/testing/unittest/registar_ut.cpp index bcab0999977..1f36d53abbe 100644 --- a/library/cpp/testing/unittest/registar_ut.cpp +++ b/library/cpp/testing/unittest/registar_ut.cpp @@ -275,22 +275,22 @@ Y_UNIT_TEST_SUITE(TUnitTestMacroTest) { } } - std::string ThrowStr() { - if (ThrowMe) { - throw *this; - } - - return {}; - } - + std::string ThrowStr() { + if (ThrowMe) { + throw *this; + } + + return {}; + } + void AssertNoException() { UNIT_ASSERT_NO_EXCEPTION(Throw()); } - void AssertNoExceptionRet() { - const TString res = UNIT_ASSERT_NO_EXCEPTION_RESULT(ThrowStr()); - } - + void AssertNoExceptionRet() { + const TString res = UNIT_ASSERT_NO_EXCEPTION_RESULT(ThrowStr()); + } + template void AssertException() { UNIT_ASSERT_EXCEPTION(Throw(), TExpectedException); @@ -345,7 +345,7 @@ Y_UNIT_TEST_SUITE(TUnitTestMacroTest) { Y_UNIT_TEST(NoException) { UNIT_ASSERT_TEST_FAILS(TTestException().AssertNoException()); - UNIT_ASSERT_TEST_FAILS(TTestException().AssertNoExceptionRet()); + UNIT_ASSERT_TEST_FAILS(TTestException().AssertNoExceptionRet()); UNIT_ASSERT_NO_EXCEPTION(TTestException("", false).Throw()); } -- cgit v1.3