A lambda-based C++ unit-testing framework.
Revisão | ccfc4b7ee03eabd4ca1f6e8dc49a4fb4a2ab24ee (tree) |
---|---|
Hora | 2020-05-20 17:27:02 |
Autor | Kaz Nishimura <kazssym@linu...> |
Commiter | Kaz Nishimura |
Call 'terminate' if a libltdl error is detected in destructors
@@ -19,7 +19,6 @@ | ||
19 | 19 | #ifndef LTDL_UTILITY_H |
20 | 20 | #define LTDL_UTILITY_H 1 |
21 | 21 | |
22 | -#include <iostream> | |
23 | 22 | #include <stdexcept> |
24 | 23 | #include <memory> |
25 | 24 | #include <cstring> |
@@ -60,7 +59,8 @@ | ||
60 | 59 | { |
61 | 60 | int result = lt_dlexit(); |
62 | 61 | if (result != 0) { |
63 | - std::cerr << lt_dlerror() << " (ignored)\n"; | |
62 | + // This shall not happen. | |
63 | + std::terminate(); | |
64 | 64 | } |
65 | 65 | } |
66 | 66 | }; |
@@ -96,7 +96,8 @@ | ||
96 | 96 | { |
97 | 97 | int result = lt_dlsetsearchpath(_original_path.get()); |
98 | 98 | if (result != 0) { |
99 | - std::cerr << lt_dlerror() << " (ignored)\n"; | |
99 | + // This shall not happen. | |
100 | + std::terminate(); | |
100 | 101 | } |
101 | 102 | } |
102 | 103 | }; |
@@ -127,7 +128,8 @@ | ||
127 | 128 | { |
128 | 129 | int result = lt_dlclose(_handle); |
129 | 130 | if (result != 0) { |
130 | - std::cerr << lt_dlerror() << " (ignored)\n"; | |
131 | + // This shall not happen. | |
132 | + std::terminate(); | |
131 | 133 | } |
132 | 134 | } |
133 | 135 |