summaryrefslogtreecommitdiffstats
path: root/util/system/atexit_ut.cpp
diff options
context:
space:
mode:
authorthegeorg <[email protected]>2022-06-24 12:22:44 +0300
committerthegeorg <[email protected]>2022-06-24 12:22:44 +0300
commitece86e83e77dcf3d9e757517d3d16f707272a4c7 (patch)
tree6366c9b5116ff7606a9706074bf4a7db0c17279c /util/system/atexit_ut.cpp
parenta4c1572074a6f4eb937168c283a61c43468d8650 (diff)
Allow creating Singlelon during Singleton destruction back again
ref:53c837a1fa0289db60812b95b6ac96be23ae018d
Diffstat (limited to 'util/system/atexit_ut.cpp')
-rw-r--r--util/system/atexit_ut.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/util/system/atexit_ut.cpp b/util/system/atexit_ut.cpp
index 953f4328110..f093c2b86b4 100644
--- a/util/system/atexit_ut.cpp
+++ b/util/system/atexit_ut.cpp
@@ -1,6 +1,7 @@
#include <library/cpp/testing/unittest/registar.h>
#include "atexit.h"
+#include <util/generic/singleton.h>
#include <errno.h>
@@ -83,3 +84,21 @@ class TAtExitTest: public TTestBase {
};
UNIT_TEST_SUITE_REGISTRATION(TAtExitTest);
+
+Y_UNIT_TEST_SUITE(TestAtExit) {
+
+ Y_UNIT_TEST(CreateUponDestruction) {
+
+ struct T1 {
+ };
+
+ struct T2 {
+ ~T2() {
+ Singleton<T1>();
+ }
+ };
+
+ Singleton<T2>();
+
+ }
+}