aboutsummaryrefslogtreecommitdiffstats
path: root/util/system/atexit_ut.cpp
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:17 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:17 +0300
commitd3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch)
treedd4bd3ca0f36b817e96812825ffaf10d645803f2 /util/system/atexit_ut.cpp
parent72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff)
downloadydb-d3a398281c6fd1d3672036cb2d63f842d2cb28c5.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 2 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 39f88ab1a5..953f432811 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 <errno.h>
-
+#include "atexit.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]);