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/future | |
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/future')
-rw-r--r-- | library/cpp/threading/future/async_ut.cpp | 8 | ||||
-rw-r--r-- | library/cpp/threading/future/core/future.h | 4 | ||||
-rw-r--r-- | library/cpp/threading/future/future_ut.cpp | 44 | ||||
-rw-r--r-- | library/cpp/threading/future/fwd.cpp | 2 | ||||
-rw-r--r-- | library/cpp/threading/future/fwd.h | 12 | ||||
-rw-r--r-- | library/cpp/threading/future/legacy_future.h | 4 | ||||
-rw-r--r-- | library/cpp/threading/future/legacy_future_ut.cpp | 10 | ||||
-rw-r--r-- | library/cpp/threading/future/wait/wait.h | 4 | ||||
-rw-r--r-- | library/cpp/threading/future/ya.make | 10 |
9 files changed, 49 insertions, 49 deletions
diff --git a/library/cpp/threading/future/async_ut.cpp b/library/cpp/threading/future/async_ut.cpp index 07f2a66951..a3699744e4 100644 --- a/library/cpp/threading/future/async_ut.cpp +++ b/library/cpp/threading/future/async_ut.cpp @@ -27,15 +27,15 @@ namespace NThreading { } -Y_UNIT_TEST_SUITE(Async) { - Y_UNIT_TEST(ExtensionExample) { +Y_UNIT_TEST_SUITE(Async) { + Y_UNIT_TEST(ExtensionExample) { TMySuperTaskQueue queue; auto future = NThreading::Async([]() { return 5; }, queue); future.Wait(); UNIT_ASSERT_VALUES_EQUAL(future.GetValue(), 5); } - Y_UNIT_TEST(WorksWithIMtpQueue) { + Y_UNIT_TEST(WorksWithIMtpQueue) { auto queue = MakeHolder<TThreadPool>(); queue->Start(1); @@ -44,7 +44,7 @@ Y_UNIT_TEST_SUITE(Async) { UNIT_ASSERT_VALUES_EQUAL(future.GetValue(), 5); } - Y_UNIT_TEST(ProperlyDeducesFutureType) { + Y_UNIT_TEST(ProperlyDeducesFutureType) { // Compileability test auto queue = CreateThreadPool(1); diff --git a/library/cpp/threading/future/core/future.h b/library/cpp/threading/future/core/future.h index 4ab56efb30..2e82bb953e 100644 --- a/library/cpp/threading/future/core/future.h +++ b/library/cpp/threading/future/core/future.h @@ -1,7 +1,7 @@ #pragma once -#include "fwd.h" - +#include "fwd.h" + #include <util/datetime/base.h> #include <util/generic/function.h> #include <util/generic/maybe.h> diff --git a/library/cpp/threading/future/future_ut.cpp b/library/cpp/threading/future/future_ut.cpp index f45fc84e23..05950a568d 100644 --- a/library/cpp/threading/future/future_ut.cpp +++ b/library/cpp/threading/future/future_ut.cpp @@ -64,8 +64,8 @@ namespace { //////////////////////////////////////////////////////////////////////////////// - Y_UNIT_TEST_SUITE(TFutureTest) { - Y_UNIT_TEST(ShouldInitiallyHasNoValue) { + Y_UNIT_TEST_SUITE(TFutureTest) { + Y_UNIT_TEST(ShouldInitiallyHasNoValue) { TPromise<int> promise; UNIT_ASSERT(!promise.HasValue()); @@ -79,7 +79,7 @@ namespace { UNIT_ASSERT(!future.HasValue()); } - Y_UNIT_TEST(ShouldInitiallyHasNoValueVoid) { + Y_UNIT_TEST(ShouldInitiallyHasNoValueVoid) { TPromise<void> promise; UNIT_ASSERT(!promise.HasValue()); @@ -93,7 +93,7 @@ namespace { UNIT_ASSERT(!future.HasValue()); } - Y_UNIT_TEST(ShouldStoreValue) { + Y_UNIT_TEST(ShouldStoreValue) { TPromise<int> promise = NewPromise<int>(); promise.SetValue(123); UNIT_ASSERT(promise.HasValue()); @@ -108,7 +108,7 @@ namespace { UNIT_ASSERT_EQUAL(future.GetValue(), 345); } - Y_UNIT_TEST(ShouldStoreValueVoid) { + Y_UNIT_TEST(ShouldStoreValueVoid) { TPromise<void> promise = NewPromise(); promise.SetValue(); UNIT_ASSERT(promise.HasValue()); @@ -151,7 +151,7 @@ namespace { } }; - Y_UNIT_TEST(ShouldInvokeCallback) { + Y_UNIT_TEST(ShouldInvokeCallback) { TPromise<int> promise = NewPromise<int>(); TTestCallback callback(123); @@ -163,7 +163,7 @@ namespace { UNIT_ASSERT_EQUAL(callback.Value, 123 + 456); } - Y_UNIT_TEST(ShouldApplyFunc) { + Y_UNIT_TEST(ShouldApplyFunc) { TPromise<int> promise = NewPromise<int>(); TTestCallback callback(123); @@ -175,7 +175,7 @@ namespace { UNIT_ASSERT_EQUAL(callback.Value, 123 + 456); } - Y_UNIT_TEST(ShouldApplyVoidFunc) { + Y_UNIT_TEST(ShouldApplyVoidFunc) { TPromise<int> promise = NewPromise<int>(); TTestCallback callback(123); @@ -186,7 +186,7 @@ namespace { UNIT_ASSERT(future.HasValue()); } - Y_UNIT_TEST(ShouldApplyFutureFunc) { + Y_UNIT_TEST(ShouldApplyFutureFunc) { TPromise<int> promise = NewPromise<int>(); TTestCallback callback(123); @@ -198,7 +198,7 @@ namespace { UNIT_ASSERT_EQUAL(callback.Value, 123 + 456); } - Y_UNIT_TEST(ShouldApplyFutureVoidFunc) { + Y_UNIT_TEST(ShouldApplyFutureVoidFunc) { TPromise<int> promise = NewPromise<int>(); TTestCallback callback(123); @@ -212,7 +212,7 @@ namespace { UNIT_ASSERT(future.HasValue()); } - Y_UNIT_TEST(ShouldIgnoreResultIfAsked) { + Y_UNIT_TEST(ShouldIgnoreResultIfAsked) { TPromise<int> promise = NewPromise<int>(); TTestCallback callback(123); @@ -225,7 +225,7 @@ namespace { class TCustomException: public yexception { }; - Y_UNIT_TEST(ShouldRethrowException) { + Y_UNIT_TEST(ShouldRethrowException) { TPromise<int> promise = NewPromise<int>(); try { ythrow TCustomException(); @@ -335,7 +335,7 @@ namespace { UNIT_ASSERT(future.HasValue()); } - Y_UNIT_TEST(ShouldWaitAnyVector) { + Y_UNIT_TEST(ShouldWaitAnyVector) { TPromise<void> promise1 = NewPromise(); TPromise<void> promise2 = NewPromise(); @@ -372,7 +372,7 @@ namespace { UNIT_ASSERT(future.HasValue()); } - Y_UNIT_TEST(ShouldWaitAnyList) { + Y_UNIT_TEST(ShouldWaitAnyList) { TPromise<void> promise1 = NewPromise(); TPromise<void> promise2 = NewPromise(); @@ -390,14 +390,14 @@ namespace { UNIT_ASSERT(future.HasValue()); } - Y_UNIT_TEST(ShouldWaitAnyVectorEmpty) { + Y_UNIT_TEST(ShouldWaitAnyVectorEmpty) { TVector<TFuture<void>> promises; TFuture<void> future = WaitAny(promises); UNIT_ASSERT(future.HasValue()); } - Y_UNIT_TEST(ShouldWaitAny) { + Y_UNIT_TEST(ShouldWaitAny) { TPromise<void> promise1 = NewPromise(); TPromise<void> promise2 = NewPromise(); @@ -411,7 +411,7 @@ namespace { UNIT_ASSERT(future.HasValue()); } - Y_UNIT_TEST(ShouldStoreTypesWithoutDefaultConstructor) { + Y_UNIT_TEST(ShouldStoreTypesWithoutDefaultConstructor) { // compileability test struct TRec { explicit TRec(int) { @@ -426,7 +426,7 @@ namespace { Y_UNUSED(rec); } - Y_UNIT_TEST(ShouldStoreMovableTypes) { + Y_UNIT_TEST(ShouldStoreMovableTypes) { // compileability test struct TRec : TMoveOnly { explicit TRec(int) { @@ -441,7 +441,7 @@ namespace { Y_UNUSED(rec); } - Y_UNIT_TEST(ShouldMoveMovableTypes) { + Y_UNIT_TEST(ShouldMoveMovableTypes) { // compileability test struct TRec : TMoveOnly { explicit TRec(int) { @@ -456,7 +456,7 @@ namespace { Y_UNUSED(rec); } - Y_UNIT_TEST(ShouldNotExtractAfterGet) { + Y_UNIT_TEST(ShouldNotExtractAfterGet) { TPromise<int> promise = NewPromise<int>(); promise.SetValue(123); UNIT_ASSERT(promise.HasValue()); @@ -464,7 +464,7 @@ namespace { UNIT_CHECK_GENERATED_EXCEPTION(promise.ExtractValue(), TFutureException); } - Y_UNIT_TEST(ShouldNotGetAfterExtract) { + Y_UNIT_TEST(ShouldNotGetAfterExtract) { TPromise<int> promise = NewPromise<int>(); promise.SetValue(123); UNIT_ASSERT(promise.HasValue()); @@ -472,7 +472,7 @@ namespace { UNIT_CHECK_GENERATED_EXCEPTION(promise.GetValue(), TFutureException); } - Y_UNIT_TEST(ShouldNotExtractAfterExtract) { + Y_UNIT_TEST(ShouldNotExtractAfterExtract) { TPromise<int> promise = NewPromise<int>(); promise.SetValue(123); UNIT_ASSERT(promise.HasValue()); diff --git a/library/cpp/threading/future/fwd.cpp b/library/cpp/threading/future/fwd.cpp index 2261ef316c..4214b6df83 100644 --- a/library/cpp/threading/future/fwd.cpp +++ b/library/cpp/threading/future/fwd.cpp @@ -1 +1 @@ -#include "fwd.h" +#include "fwd.h" diff --git a/library/cpp/threading/future/fwd.h b/library/cpp/threading/future/fwd.h index b51d9b0019..0cd25dd288 100644 --- a/library/cpp/threading/future/fwd.h +++ b/library/cpp/threading/future/fwd.h @@ -1,8 +1,8 @@ -#pragma once - +#pragma once + #include "core/fwd.h" -namespace NThreading { - template <typename TR = void, bool IgnoreException = false> - class TLegacyFuture; -} +namespace NThreading { + template <typename TR = void, bool IgnoreException = false> + class TLegacyFuture; +} diff --git a/library/cpp/threading/future/legacy_future.h b/library/cpp/threading/future/legacy_future.h index 9bb126e76b..6f1eabad73 100644 --- a/library/cpp/threading/future/legacy_future.h +++ b/library/cpp/threading/future/legacy_future.h @@ -1,6 +1,6 @@ #pragma once -#include "fwd.h" +#include "fwd.h" #include "future.h" #include <util/thread/factory.h> @@ -8,7 +8,7 @@ #include <functional> namespace NThreading { - template <typename TR, bool IgnoreException> + template <typename TR, bool IgnoreException> class TLegacyFuture: public IThreadFactory::IThreadAble, TNonCopyable { public: typedef TR(TFunctionSignature)(); diff --git a/library/cpp/threading/future/legacy_future_ut.cpp b/library/cpp/threading/future/legacy_future_ut.cpp index b0c9dc21aa..ff63db1725 100644 --- a/library/cpp/threading/future/legacy_future_ut.cpp +++ b/library/cpp/threading/future/legacy_future_ut.cpp @@ -3,12 +3,12 @@ #include <library/cpp/testing/unittest/registar.h> namespace NThreading { - Y_UNIT_TEST_SUITE(TLegacyFutureTest) { + Y_UNIT_TEST_SUITE(TLegacyFutureTest) { int intf() { return 17; } - Y_UNIT_TEST(TestIntFunction) { + Y_UNIT_TEST(TestIntFunction) { TLegacyFuture<int> f((&intf)); UNIT_ASSERT_VALUES_EQUAL(17, f.Get()); } @@ -19,7 +19,7 @@ namespace NThreading { r = 18; } - Y_UNIT_TEST(TestVoidFunction) { + Y_UNIT_TEST(TestVoidFunction) { r = 0; TLegacyFuture<> f((&voidf)); f.Get(); @@ -39,7 +39,7 @@ namespace NThreading { } }; - Y_UNIT_TEST(TestMethod) { + Y_UNIT_TEST(TestMethod) { TLegacyFuture<int> f11(std::bind(&TSampleClass::Calc, TSampleClass(3))); UNIT_ASSERT_VALUES_EQUAL(4, f11.Get()); @@ -57,7 +57,7 @@ namespace NThreading { struct TSomeThreadPool: public IThreadFactory {}; - Y_UNIT_TEST(TestFunction) { + Y_UNIT_TEST(TestFunction) { std::function<int()> f((&intf)); UNIT_ASSERT_VALUES_EQUAL(17, TLegacyFuture<int>(f).Get()); diff --git a/library/cpp/threading/future/wait/wait.h b/library/cpp/threading/future/wait/wait.h index 6497574cec..6ff7d57baa 100644 --- a/library/cpp/threading/future/wait/wait.h +++ b/library/cpp/threading/future/wait/wait.h @@ -1,7 +1,7 @@ #pragma once -#include "fwd.h" - +#include "fwd.h" + #include <library/cpp/threading/future/core/future.h> #include <library/cpp/threading/future/wait/wait_group.h> diff --git a/library/cpp/threading/future/ya.make b/library/cpp/threading/future/ya.make index d3ad13fa8e..6591031f46 100644 --- a/library/cpp/threading/future/ya.make +++ b/library/cpp/threading/future/ya.make @@ -1,14 +1,14 @@ -OWNER( - g:rtmr -) - +OWNER( + g:rtmr +) + LIBRARY() SRCS( async.cpp core/future.cpp core/fwd.cpp - fwd.cpp + fwd.cpp wait/fwd.cpp wait/wait.cpp wait/wait_group.cpp |