Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RCPNodeTracer_UnitTests.cpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Teuchos: Common Tools Package
4 //
5 // Copyright 2004 NTESS and the Teuchos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #include "Teuchos_RCPNode.hpp"
11 
13 
14 
15 namespace {
16 
17 
19 
20 
21 TEUCHOS_UNIT_TEST( RCPNodeTracer, defaults )
22 {
23 #if defined(TEUCHOS_DEBUG) && defined(HAVE_TEUCHOS_DEBUG_RCP_NODE_TRACING)
24  TEST_EQUALITY_CONST(RCPNodeTracer::isTracingActiveRCPNodes(), true);
25 #else
26  TEST_EQUALITY_CONST(RCPNodeTracer::isTracingActiveRCPNodes(), false);
27 #endif
28  TEST_EQUALITY_CONST(RCPNodeTracer::getPrintRCPNodeStatisticsOnExit(), false);
29  TEST_EQUALITY_CONST(RCPNodeTracer::getPrintActiveRcpNodesOnExit(), true);
30 }
31 
32 
33 TEUCHOS_UNIT_TEST( RCPNodeTracer, changeDefaults )
34 {
35  TEST_EQUALITY_CONST(RCPNodeTracer::getPrintRCPNodeStatisticsOnExit(), false);
36  ECHO(RCPNodeTracer::setPrintRCPNodeStatisticsOnExit(true));
37  TEST_EQUALITY_CONST(RCPNodeTracer::getPrintRCPNodeStatisticsOnExit(), true);
38  TEST_EQUALITY_CONST(RCPNodeTracer::getPrintActiveRcpNodesOnExit(), true);
39  (RCPNodeTracer::setPrintActiveRcpNodesOnExit(false));
40  TEST_EQUALITY_CONST(RCPNodeTracer::getPrintActiveRcpNodesOnExit(), false);
41 }
42 
43 
44 } // namespace
#define ECHO(statement)
Echo the given statement before it is executed.
#define TEUCHOS_UNIT_TEST(TEST_GROUP, TEST_NAME)
Macro for defining a (non-templated) unit test.
Debug-mode RCPNode tracing class.
Unit testing support.
#define TEST_EQUALITY_CONST(v1, v2)
Assert the equality of v1 and constant v2.
Reference-counted pointer node classes.