aboutsummaryrefslogtreecommitdiffstats
path: root/util/system/nice_ut.cpp
diff options
context:
space:
mode:
authordivankov <divankov@yandex-team.ru>2022-02-10 16:48:05 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:48:05 +0300
commit5b8d95df2f0cfca4d3f5499a4259aa2050ef1571 (patch)
treeb222e5ac2e2e98872661c51ccceee5da0d291e13 /util/system/nice_ut.cpp
parentcd88d7933255d8690da34c7b1f7427cf2bb3ae23 (diff)
downloadydb-5b8d95df2f0cfca4d3f5499a4259aa2050ef1571.tar.gz
Restoring authorship annotation for <divankov@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/system/nice_ut.cpp')
-rw-r--r--util/system/nice_ut.cpp54
1 files changed, 27 insertions, 27 deletions
diff --git a/util/system/nice_ut.cpp b/util/system/nice_ut.cpp
index 8650711defa..ae0051f285a 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
+}