From 5e6762d4591ed427715b1ad76b0737b6f59cf571 Mon Sep 17 00:00:00 2001 From: mj-xmr Date: Mon, 5 Jul 2021 17:42:11 +0200 Subject: EasyLogging++: Add UTests, that protect against regressions --- tests/unit_tests/logging.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/unit_tests/logging.cpp b/tests/unit_tests/logging.cpp index b3afba243..f11b17412 100644 --- a/tests/unit_tests/logging.cpp +++ b/tests/unit_tests/logging.cpp @@ -195,3 +195,16 @@ TEST(logging, multiline) cleanup(); } +// These operations might segfault +TEST(logging, copy_ctor_segfault) +{ + const el::Logger log1("id1", nullptr); + const el::Logger log2(log1); +} + +TEST(logging, operator_equals_segfault) +{ + const el::Logger log1("id1", nullptr); + el::Logger log2("id2", nullptr); + log2 = log1; +} -- cgit v1.2.3