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 /* ************************************************************************* */
TestRegistry::runAllTests
static int runAllTests(TestResult &result)
Definition: TestRegistry.cpp:27
SETDEBUG
#define SETDEBUG(S, V)
Definition: debug.h:61
EXPECT
#define EXPECT(condition)
Definition: Test.h:150
TestHarness.h
Debug
static void Debug(DSizes< Index, NumDims > dims)
Definition: cxx11_tensor_block_access.cpp:61
TEST
TEST(Debug, debug_disabled)
Definition: testDebug.cpp:26
ISDEBUG
#define ISDEBUG(S)
Definition: debug.h:60
main
int main()
Definition: testDebug.cpp:49
TestResult
Definition: TestResult.h:26
debug.h
Global debugging flags.


gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:16:13