testDebug.cpp
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2 
3  * GTSAM Copyright 2010, Georgia Tech Research Corporation,
4  * Atlanta, Georgia 30332-0415
5  * All Rights Reserved
6  * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7 
8  * See LICENSE for the license information
9 
10  * -------------------------------------------------------------------------- */
11 
19 
20 #undef NDEBUG
21 #define NDEBUG
22 #undef GTSAM_ENABLE_DEBUG
23 #include <gtsam/base/debug.h>
24 
25 /* ************************************************************************* */
26 TEST(Debug, debug_disabled) {
27  const bool debug1 = ISDEBUG("TestDebug");
28  EXPECT(!debug1);
29 
30  SETDEBUG("TestDebug", true);
31  bool debug2 = ISDEBUG("TestDebug");
32  EXPECT(!debug2);
33 }
34 
35 #define GTSAM_ENABLE_DEBUG
36 #include <gtsam/base/debug.h>
37 
38 /* ************************************************************************* */
39 TEST(Debug, debug_enabled) {
40  const bool debug1 = ISDEBUG("TestDebug");
41  EXPECT(!debug1);
42 
43  SETDEBUG("TestDebug", true);
44  bool debug2 = ISDEBUG("TestDebug");
45  EXPECT(debug2);
46 }
47 
48 /* ************************************************************************* */
49 int main() {
50  TestResult tr;
51  return TestRegistry::runAllTests(tr);
52 }
53 /* ************************************************************************* */
int main()
Definition: testDebug.cpp:49
#define SETDEBUG(S, V)
Definition: debug.h:61
static int runAllTests(TestResult &result)
Global debugging flags.
#define ISDEBUG(S)
Definition: debug.h:60
#define EXPECT(condition)
Definition: Test.h:150
TEST(Debug, debug_disabled)
Definition: testDebug.cpp:26
static void Debug(DSizes< Index, NumDims > dims)


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:38:01