summaryrefslogtreecommitdiffstats
path: root/util/system/atexit_ut.cpp
diff options
context:
space:
mode:
authorAnton Samokhvalov <[email protected]>2022-02-10 16:45:15 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 16:45:15 +0300
commit72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch)
treeda2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /util/system/atexit_ut.cpp
parent778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff)
Restoring authorship annotation for Anton Samokhvalov <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'util/system/atexit_ut.cpp')
-rw-r--r--util/system/atexit_ut.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/util/system/atexit_ut.cpp b/util/system/atexit_ut.cpp
index 953f4328110..39f88ab1a56 100644
--- a/util/system/atexit_ut.cpp
+++ b/util/system/atexit_ut.cpp
@@ -1,20 +1,20 @@
#include <library/cpp/testing/unittest/registar.h>
+
+#include "atexit.h"
-#include "atexit.h"
-
-#include <errno.h>
-
+#include <errno.h>
+
#ifdef _win_
-// not implemented
+// not implemented
#else
- #include <sys/types.h>
- #include <sys/wait.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
#endif //_win_
#include <stdio.h>
#ifdef _win_
-// not implemented
+// not implemented
#else
struct TAtExitParams {
TAtExitParams(int fd_, const char* str_)
@@ -27,26 +27,26 @@ struct TAtExitParams {
const char* str;
};
-void MyAtExitFunc(void* ptr) {
+void MyAtExitFunc(void* ptr) {
THolder<TAtExitParams> params{static_cast<TAtExitParams*>(ptr)};
- if (write(params->fd, params->str, strlen(params->str)) < 0) {
- abort();
- }
+ if (write(params->fd, params->str, strlen(params->str)) < 0) {
+ abort();
+ }
}
#endif
-class TAtExitTest: public TTestBase {
- UNIT_TEST_SUITE(TAtExitTest);
- UNIT_TEST(TestAtExit)
+class TAtExitTest: public TTestBase {
+ UNIT_TEST_SUITE(TAtExitTest);
+ UNIT_TEST(TestAtExit)
UNIT_TEST_SUITE_END();
void TestAtExit() {
#ifdef _win_
-// not implemented
+// not implemented
#else
int ret;
int pipefd[2];
-
+
ret = pipe(pipefd);
UNIT_ASSERT(ret == 0);
@@ -65,7 +65,7 @@ class TAtExitTest: public TTestBase {
while (read(pipefd[0], data + last++, 1) > 0 && last < 1024) {
}
data[--last] = 0;
-
+
UNIT_ASSERT(strcmp(data, "High prio\nMiddle prio\nLow-middle prio\nLow prio\nVery low prio\n") == 0);
} else {
close(pipefd[0]);