Line data Source code
1 : // Copyright (c) 2016-2025 Made to Order Software Corp. All Rights Reserved
2 : //
3 : // https://snapwebsites.org/project/eventdispatcher
4 : // contact@m2osw.com
5 : //
6 : // This program is free software: you can redistribute it and/or modify
7 : // it under the terms of the GNU General Public License as published by
8 : // the Free Software Foundation, either version 3 of the License, or
9 : // (at your option) any later version.
10 : //
11 : // This program is distributed in the hope that it will be useful,
12 : // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 : // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 : // GNU General Public License for more details.
15 : //
16 : // You should have received a copy of the GNU General Public License
17 : // along with this program. If not, see <https://www.gnu.org/licenses/>.
18 : #pragma once
19 :
20 : // catch2
21 : //
22 : #include <snaplogger/snapcatch2.hpp>
23 :
24 :
25 : // cppthread
26 : //
27 : #include <cppthread/log.h>
28 :
29 :
30 : // C++
31 : //
32 : #include <string>
33 : #include <cstring>
34 : #include <cstdlib>
35 : #include <iostream>
36 :
37 :
38 :
39 : namespace SNAP_CATCH2_NAMESPACE
40 : {
41 :
42 :
43 :
44 : //extern char ** g_argv;
45 :
46 :
47 :
48 : class reset_log_errors
49 : {
50 : public:
51 3 : ~reset_log_errors()
52 : {
53 3 : std::cerr << "--- errors before reset: " << cppthread::log.get_errors() << "\n";
54 3 : cppthread::log.reset_counters();
55 3 : std::cerr << "--- errors after reset: " << cppthread::log.get_errors() << "\n";
56 3 : }
57 : };
58 :
59 :
60 :
61 : }
62 : // namespace SNAP_CATCH2_NAMESPACE
63 : // vim: ts=4 sw=4 et
|