diff options
author | yazevnul <yazevnul@yandex-team.ru> | 2022-02-10 16:46:48 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:48 +0300 |
commit | 9abfb1a53b7f7b791444d1378e645d8fad9b06ed (patch) | |
tree | 49e222ea1c5804306084bb3ae065bb702625360f /library/cpp/threading/local_executor/ut | |
parent | 8cbc307de0221f84c80c42dcbe07d40727537e2c (diff) | |
download | ydb-9abfb1a53b7f7b791444d1378e645d8fad9b06ed.tar.gz |
Restoring authorship annotation for <yazevnul@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/threading/local_executor/ut')
-rw-r--r-- | library/cpp/threading/local_executor/ut/local_executor_ut.cpp | 56 | ||||
-rw-r--r-- | library/cpp/threading/local_executor/ut/ya.make | 6 |
2 files changed, 31 insertions, 31 deletions
diff --git a/library/cpp/threading/local_executor/ut/local_executor_ut.cpp b/library/cpp/threading/local_executor/ut/local_executor_ut.cpp index fe7dab08994..ac5737717cd 100644 --- a/library/cpp/threading/local_executor/ut/local_executor_ut.cpp +++ b/library/cpp/threading/local_executor/ut/local_executor_ut.cpp @@ -1,10 +1,10 @@ #include <library/cpp/threading/local_executor/local_executor.h> #include <library/cpp/threading/future/future.h> - + #include <library/cpp/testing/unittest/registar.h> #include <util/system/mutex.h> #include <util/system/rwlock.h> -#include <util/generic/algorithm.h> +#include <util/generic/algorithm.h> using namespace NPar; @@ -14,7 +14,7 @@ class TTestException: public yexception { static const int DefaultThreadsCount = 41; static const int DefaultRangeSize = 999; -Y_UNIT_TEST_SUITE(ExecRangeWithFutures){ +Y_UNIT_TEST_SUITE(ExecRangeWithFutures){ bool AllOf(const TVector<int>& vec, int value){ return AllOf(vec, [value](int element) { return value == element; }); } @@ -41,23 +41,23 @@ void AsyncRunAndWaitFuturesReady(int rangeSize, int threads) { UNIT_ASSERT(AllOf(data, 1)); } -Y_UNIT_TEST(AsyncRunRangeAndWaitFuturesReady) { +Y_UNIT_TEST(AsyncRunRangeAndWaitFuturesReady) { AsyncRunAndWaitFuturesReady(DefaultRangeSize, DefaultThreadsCount); } -Y_UNIT_TEST(AsyncRunOneTaskAndWaitFuturesReady) { +Y_UNIT_TEST(AsyncRunOneTaskAndWaitFuturesReady) { AsyncRunAndWaitFuturesReady(1, DefaultThreadsCount); } -Y_UNIT_TEST(AsyncRunRangeAndWaitFuturesReadyOneExtraThread) { +Y_UNIT_TEST(AsyncRunRangeAndWaitFuturesReadyOneExtraThread) { AsyncRunAndWaitFuturesReady(DefaultRangeSize, 1); } -Y_UNIT_TEST(AsyncRunOneThreadAndWaitFuturesReadyOneExtraThread) { +Y_UNIT_TEST(AsyncRunOneThreadAndWaitFuturesReadyOneExtraThread) { AsyncRunAndWaitFuturesReady(1, 1); } -Y_UNIT_TEST(AsyncRunTwoRangesAndWaitFuturesReady) { +Y_UNIT_TEST(AsyncRunTwoRangesAndWaitFuturesReady) { TLocalExecutor localExecutor; localExecutor.RunAdditionalThreads(DefaultThreadsCount); TAtomic signal = 0; @@ -118,23 +118,23 @@ void AsyncRunRangeAndWaitExceptions(int rangeSize, int threadsCount) { UNIT_ASSERT(AllOf(data, 1)); } -Y_UNIT_TEST(AsyncRunRangeAndWaitExceptions) { +Y_UNIT_TEST(AsyncRunRangeAndWaitExceptions) { AsyncRunRangeAndWaitExceptions(DefaultRangeSize, DefaultThreadsCount); } -Y_UNIT_TEST(AsyncRunOneTaskAndWaitExceptions) { +Y_UNIT_TEST(AsyncRunOneTaskAndWaitExceptions) { AsyncRunRangeAndWaitExceptions(1, DefaultThreadsCount); } -Y_UNIT_TEST(AsyncRunRangeAndWaitExceptionsOneExtraThread) { +Y_UNIT_TEST(AsyncRunRangeAndWaitExceptionsOneExtraThread) { AsyncRunRangeAndWaitExceptions(DefaultRangeSize, 1); } -Y_UNIT_TEST(AsyncRunOneTaskAndWaitExceptionsOneExtraThread) { +Y_UNIT_TEST(AsyncRunOneTaskAndWaitExceptionsOneExtraThread) { AsyncRunRangeAndWaitExceptions(1, 1); } -Y_UNIT_TEST(AsyncRunTwoRangesAndWaitExceptions) { +Y_UNIT_TEST(AsyncRunTwoRangesAndWaitExceptions) { TLocalExecutor localExecutor; localExecutor.RunAdditionalThreads(DefaultThreadsCount); TAtomic signal = 0; @@ -209,33 +209,33 @@ void RunRangeAndCheckExceptionsWithWaitComplete(int rangeSize, int threadsCount) UNIT_ASSERT(AllOf(data, 1)); } -Y_UNIT_TEST(RunRangeAndCheckExceptionsWithWaitComplete) { +Y_UNIT_TEST(RunRangeAndCheckExceptionsWithWaitComplete) { RunRangeAndCheckExceptionsWithWaitComplete(DefaultRangeSize, DefaultThreadsCount); } -Y_UNIT_TEST(RunOneAndCheckExceptionsWithWaitComplete) { +Y_UNIT_TEST(RunOneAndCheckExceptionsWithWaitComplete) { RunRangeAndCheckExceptionsWithWaitComplete(1, DefaultThreadsCount); } -Y_UNIT_TEST(RunRangeAndCheckExceptionsWithWaitCompleteOneExtraThread) { +Y_UNIT_TEST(RunRangeAndCheckExceptionsWithWaitCompleteOneExtraThread) { RunRangeAndCheckExceptionsWithWaitComplete(DefaultRangeSize, 1); } -Y_UNIT_TEST(RunOneAndCheckExceptionsWithWaitCompleteOneExtraThread) { +Y_UNIT_TEST(RunOneAndCheckExceptionsWithWaitCompleteOneExtraThread) { RunRangeAndCheckExceptionsWithWaitComplete(1, 1); } -Y_UNIT_TEST(RunRangeAndCheckExceptionsWithWaitCompleteZeroExtraThreads) { +Y_UNIT_TEST(RunRangeAndCheckExceptionsWithWaitCompleteZeroExtraThreads) { RunRangeAndCheckExceptionsWithWaitComplete(DefaultRangeSize, 0); } -Y_UNIT_TEST(RunOneAndCheckExceptionsWithWaitCompleteZeroExtraThreads) { +Y_UNIT_TEST(RunOneAndCheckExceptionsWithWaitCompleteZeroExtraThreads) { RunRangeAndCheckExceptionsWithWaitComplete(1, 0); } } ; -Y_UNIT_TEST_SUITE(ExecRangeWithThrow){ +Y_UNIT_TEST_SUITE(ExecRangeWithThrow){ void RunParallelWhichThrowsTTestException(int rangeStart, int rangeSize, int threadsCount, int flags, TAtomic& processed){ AtomicSet(processed, 0); TLocalExecutor localExecutor; @@ -247,7 +247,7 @@ localExecutor.ExecRangeWithThrow([&processed](int) { rangeStart, rangeStart + rangeSize, flags); } -Y_UNIT_TEST(RunParallelWhichThrowsTTestException) { +Y_UNIT_TEST(RunParallelWhichThrowsTTestException) { TAtomic processed = 0; UNIT_ASSERT_EXCEPTION( RunParallelWhichThrowsTTestException(10, 40, DefaultThreadsCount, @@ -264,32 +264,32 @@ void ThrowAndCatchTTestException(int rangeSize, int threadsCount, int flags) { UNIT_ASSERT(AtomicGet(processed) == rangeSize); } -Y_UNIT_TEST(ThrowAndCatchTTestExceptionLowPriority) { +Y_UNIT_TEST(ThrowAndCatchTTestExceptionLowPriority) { ThrowAndCatchTTestException(DefaultRangeSize, DefaultThreadsCount, TLocalExecutor::EFlags::WAIT_COMPLETE | TLocalExecutor::EFlags::LOW_PRIORITY); } -Y_UNIT_TEST(ThrowAndCatchTTestExceptionMedPriority) { +Y_UNIT_TEST(ThrowAndCatchTTestExceptionMedPriority) { ThrowAndCatchTTestException(DefaultRangeSize, DefaultThreadsCount, TLocalExecutor::EFlags::WAIT_COMPLETE | TLocalExecutor::EFlags::MED_PRIORITY); } -Y_UNIT_TEST(ThrowAndCatchTTestExceptionHighPriority) { +Y_UNIT_TEST(ThrowAndCatchTTestExceptionHighPriority) { ThrowAndCatchTTestException(DefaultRangeSize, DefaultThreadsCount, TLocalExecutor::EFlags::WAIT_COMPLETE | TLocalExecutor::EFlags::HIGH_PRIORITY); } -Y_UNIT_TEST(ThrowAndCatchTTestExceptionWaitComplete) { +Y_UNIT_TEST(ThrowAndCatchTTestExceptionWaitComplete) { ThrowAndCatchTTestException(DefaultRangeSize, DefaultThreadsCount, TLocalExecutor::EFlags::WAIT_COMPLETE); } -Y_UNIT_TEST(RethrowExeptionSequentialWaitComplete) { +Y_UNIT_TEST(RethrowExeptionSequentialWaitComplete) { ThrowAndCatchTTestException(DefaultRangeSize, 0, TLocalExecutor::EFlags::WAIT_COMPLETE); } -Y_UNIT_TEST(RethrowExeptionOneExtraThreadWaitComplete) { +Y_UNIT_TEST(RethrowExeptionOneExtraThreadWaitComplete) { ThrowAndCatchTTestException(DefaultRangeSize, 1, TLocalExecutor::EFlags::WAIT_COMPLETE); } @@ -314,7 +314,7 @@ void CatchTTestExceptionFromNested(TAtomic& processed1, TAtomic& processed2) { 0, DefaultRangeSize, TLocalExecutor::EFlags::WAIT_COMPLETE); } -Y_UNIT_TEST(NestedParallelExceptionsDoNotLeak) { +Y_UNIT_TEST(NestedParallelExceptionsDoNotLeak) { TAtomic processed1 = 0; TAtomic processed2 = 0; UNIT_ASSERT_NO_EXCEPTION( diff --git a/library/cpp/threading/local_executor/ut/ya.make b/library/cpp/threading/local_executor/ut/ya.make index 2983c4f4669..be579a5ca06 100644 --- a/library/cpp/threading/local_executor/ut/ya.make +++ b/library/cpp/threading/local_executor/ut/ya.make @@ -1,10 +1,10 @@ OWNER( g:matrixnet - gulin -) + gulin +) UNITTEST_FOR(library/cpp/threading/local_executor) - + SRCS( local_executor_ut.cpp ) |