diff options
author | bulatman <bulatman@yandex-team.ru> | 2022-02-10 16:45:50 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:50 +0300 |
commit | 2f6ca198245aeffd5e2d82b65927c2465b68b4f5 (patch) | |
tree | 9142afc54d335ea52910662635b898e79e192e49 /library/cpp/testing/hook/hook.cpp | |
parent | 6560e4993b14d193f8c879e33a3de5e5eba6e21d (diff) | |
download | ydb-2f6ca198245aeffd5e2d82b65927c2465b68b4f5.tar.gz |
Restoring authorship annotation for <bulatman@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/testing/hook/hook.cpp')
-rw-r--r-- | library/cpp/testing/hook/hook.cpp | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/library/cpp/testing/hook/hook.cpp b/library/cpp/testing/hook/hook.cpp index f5daca11cb..b3c599da89 100644 --- a/library/cpp/testing/hook/hook.cpp +++ b/library/cpp/testing/hook/hook.cpp @@ -1,45 +1,45 @@ -#include "hook.h" - -namespace { - NTesting::THook* BeforeInitHead = nullptr; - NTesting::THook* BeforeRunHead = nullptr; - NTesting::THook* AfterRunHead = nullptr; - - void RegisterHook(NTesting::THook*& head, NTesting::THook* hook) { - hook->Next = head; - head = hook; - } - - void CallHooks(NTesting::THook* head) { - while (nullptr != head) { - if (nullptr != head->Fn) { - (*head->Fn)(); - } - head = head->Next; - } - } -} - -void NTesting::THook::RegisterBeforeInit(NTesting::THook* hook) noexcept { - RegisterHook(BeforeInitHead, hook); -} - -void NTesting::THook::CallBeforeInit() { - CallHooks(BeforeInitHead); -} - -void NTesting::THook::RegisterBeforeRun(NTesting::THook* hook) noexcept { - RegisterHook(BeforeRunHead, hook); -} - -void NTesting::THook::CallBeforeRun() { - CallHooks(BeforeRunHead); -} - -void NTesting::THook::RegisterAfterRun(NTesting::THook* hook) noexcept { - RegisterHook(AfterRunHead, hook); -} - -void NTesting::THook::CallAfterRun() { - CallHooks(AfterRunHead); -} +#include "hook.h" + +namespace { + NTesting::THook* BeforeInitHead = nullptr; + NTesting::THook* BeforeRunHead = nullptr; + NTesting::THook* AfterRunHead = nullptr; + + void RegisterHook(NTesting::THook*& head, NTesting::THook* hook) { + hook->Next = head; + head = hook; + } + + void CallHooks(NTesting::THook* head) { + while (nullptr != head) { + if (nullptr != head->Fn) { + (*head->Fn)(); + } + head = head->Next; + } + } +} + +void NTesting::THook::RegisterBeforeInit(NTesting::THook* hook) noexcept { + RegisterHook(BeforeInitHead, hook); +} + +void NTesting::THook::CallBeforeInit() { + CallHooks(BeforeInitHead); +} + +void NTesting::THook::RegisterBeforeRun(NTesting::THook* hook) noexcept { + RegisterHook(BeforeRunHead, hook); +} + +void NTesting::THook::CallBeforeRun() { + CallHooks(BeforeRunHead); +} + +void NTesting::THook::RegisterAfterRun(NTesting::THook* hook) noexcept { + RegisterHook(AfterRunHead, hook); +} + +void NTesting::THook::CallAfterRun() { + CallHooks(AfterRunHead); +} |