File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ class test_base_t {
18
18
19
19
protected:
20
20
test_base_t ();
21
- ~test_base_t () = default ;
21
+ ~test_base_t ();
22
22
};
23
23
24
24
} // namespace testing_v1
Original file line number Diff line number Diff line change 1
1
#include " testing_v1/test.hpp"
2
2
3
+ #include < algorithm>
3
4
#include < cstdio>
4
5
#include < cstdlib>
5
6
#include < tuple>
@@ -33,6 +34,15 @@ testing_v1::test_base_t::test_base_t() {
33
34
test_private::tests ().push_back (this );
34
35
}
35
36
37
+ testing_v1::test_base_t::~test_base_t () {
38
+ auto &tests = test_private::tests ();
39
+ auto it = std::find (tests.rbegin (), tests.rend (), this );
40
+ if (it != tests.rend ()) {
41
+ std::swap (*it, tests.back ());
42
+ tests.pop_back ();
43
+ }
44
+ }
45
+
36
46
int main () {
37
47
testing_v1::test_private::run_all ();
38
48
return 0 ;
You can’t perform that action at this time.
0 commit comments