diff options
| author | divankov <[email protected]> | 2022-02-10 16:48:05 +0300 |
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:48:05 +0300 |
| commit | cd88d7933255d8690da34c7b1f7427cf2bb3ae23 (patch) | |
| tree | 39e40694c8b41674a17b90f034e31d7cfcf20142 /util/system | |
| parent | 37a2795395ba606e239b750ff2afb17905274ec4 (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'util/system')
| -rw-r--r-- | util/system/nice.cpp | 28 | ||||
| -rw-r--r-- | util/system/nice.h | 6 | ||||
| -rw-r--r-- | util/system/nice_ut.cpp | 54 | ||||
| -rw-r--r-- | util/system/tls.h | 2 |
4 files changed, 45 insertions, 45 deletions
diff --git a/util/system/nice.cpp b/util/system/nice.cpp index 20fe9260545..cbab07f688f 100644 --- a/util/system/nice.cpp +++ b/util/system/nice.cpp @@ -1,15 +1,15 @@ -#include "nice.h" - -#include "platform.h" - -#if defined(_unix_) +#include "nice.h" + +#include "platform.h" + +#if defined(_unix_) #include <unistd.h> -#endif - -bool Nice(int prioDelta) { -#if defined(_unix_) - return nice(prioDelta) != -1; -#else - return prioDelta == 0; -#endif -} +#endif + +bool Nice(int prioDelta) { +#if defined(_unix_) + return nice(prioDelta) != -1; +#else + return prioDelta == 0; +#endif +} diff --git a/util/system/nice.h b/util/system/nice.h index 86b8bc5f3c7..9d2e01331d3 100644 --- a/util/system/nice.h +++ b/util/system/nice.h @@ -1,3 +1,3 @@ -#pragma once - -bool Nice(int prioDelta); +#pragma once + +bool Nice(int prioDelta); diff --git a/util/system/nice_ut.cpp b/util/system/nice_ut.cpp index ae0051f285a..8650711defa 100644 --- a/util/system/nice_ut.cpp +++ b/util/system/nice_ut.cpp @@ -1,42 +1,42 @@ -#include "nice.h" - -#include "platform.h" - +#include "nice.h" + +#include "platform.h" + #include <library/cpp/testing/unittest/registar.h> - -#ifdef _unix_ + +#ifdef _unix_ #include <sys/resource.h> - -static int GetPriority() { - return getpriority(PRIO_PROCESS, 0); -} -#endif - + +static int GetPriority() { + return getpriority(PRIO_PROCESS, 0); +} +#endif + Y_UNIT_TEST_SUITE(NiceTest) { Y_UNIT_TEST(TestNiceZero) { - UNIT_ASSERT(Nice(0)); - UNIT_ASSERT(Nice(0)); - } -#ifdef _unix_ + UNIT_ASSERT(Nice(0)); + UNIT_ASSERT(Nice(0)); + } +#ifdef _unix_ Y_UNIT_TEST(TestNice) { - int prio = GetPriority(); + int prio = GetPriority(); if (prio >= 10) { return; } - if (Nice(-2)) { - UNIT_ASSERT_VALUES_EQUAL(GetPriority(), prio - 2); - prio -= 2; - } else { - UNIT_ASSERT_VALUES_EQUAL(GetPriority(), prio); - } + if (Nice(-2)) { + UNIT_ASSERT_VALUES_EQUAL(GetPriority(), prio - 2); + prio -= 2; + } else { + UNIT_ASSERT_VALUES_EQUAL(GetPriority(), prio); + } UNIT_ASSERT(Nice(1)); UNIT_ASSERT_VALUES_EQUAL(GetPriority(), prio + 1); - UNIT_ASSERT(Nice(0)); + UNIT_ASSERT(Nice(0)); UNIT_ASSERT_VALUES_EQUAL(GetPriority(), prio + 1); UNIT_ASSERT(Nice(2)); UNIT_ASSERT_VALUES_EQUAL(GetPriority(), prio + 3); - } -#endif -} + } +#endif +} diff --git a/util/system/tls.h b/util/system/tls.h index 3c4f56dbeb7..589a4effe99 100644 --- a/util/system/tls.h +++ b/util/system/tls.h @@ -235,7 +235,7 @@ namespace NTls { } inline operator const T&() const { - return Get(); + return Get(); } inline operator T&() { |
