summaryrefslogtreecommitdiffstats
path: root/src/include/usr/cxxtest
diff options
context:
space:
mode:
authorChristian Geddes <crgeddes@us.ibm.com>2018-10-11 15:46:04 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-10-16 14:12:31 -0500
commit3e677e6cdf31494f05d6c23828c80d92ba5b2280 (patch)
treeb33bacd91aeb4e07f759a6284da04296b92e01b9 /src/include/usr/cxxtest
parentf07e1f6859517dba668056e3e8afd8721bbabb5e (diff)
downloadblackbird-hostboot-3e677e6cdf31494f05d6c23828c80d92ba5b2280.tar.gz
blackbird-hostboot-3e677e6cdf31494f05d6c23828c80d92ba5b2280.zip
Wrap TS_ macros in {} to avoid strange IF statement behavior
The TS_ macros will replace the macro with multiple lines of code. So if you put a TS_FAIL in an if statement that was not enclosed in {} you could get strange/unexpected behavior. This addes an extra layer of protection to ensure that the macro is enclosed in its own execution block. Change-Id: I226ccef81095cf8511b30e147e59d1da4904cd5c Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/67373 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Corey V. Swenson <cswenson@us.ibm.com> Reviewed-by: Thi N. Tran <thi@us.ibm.com> Reviewed-by: Matt Derksen <mderkse1@us.ibm.com> Reviewed-by: Ilya Smirnov <ismirno@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include/usr/cxxtest')
-rwxr-xr-xsrc/include/usr/cxxtest/TestSuite.H18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/include/usr/cxxtest/TestSuite.H b/src/include/usr/cxxtest/TestSuite.H
index cc27ec321..0c9e2305a 100755
--- a/src/include/usr/cxxtest/TestSuite.H
+++ b/src/include/usr/cxxtest/TestSuite.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2017 */
+/* Contributors Listed Below - COPYRIGHT 2011,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -102,23 +102,23 @@ extern uint64_t g_ModulesCompleted;
#define _TS_CATCH_ABORT(b)
// TS_TRACE
-#define TS_TRACE(...) TRACDCOMP( g_trac_test, "TS_TRACE> " __VA_ARGS__ ); \
- CxxTest::doTrace( )
+#define TS_TRACE(...) { TRACDCOMP( g_trac_test, "TS_TRACE> " __VA_ARGS__ ); \
+ CxxTest::doTrace( ); }
// TS_INFO
-#define TS_INFO(...) TRACFCOMP( g_trac_test, "TS_INFO> " __VA_ARGS__ ); \
- CxxTest::doTrace( )
+#define TS_INFO(...) { TRACFCOMP( g_trac_test, "TS_INFO> " __VA_ARGS__ ); \
+ CxxTest::doTrace( ); }
// TS_WARN
-#define TS_WARN(...) TRACFCOMP( g_trac_test, "!TS_WARN> " __VA_ARGS__ ); \
- CxxTest::doWarn( )
+#define TS_WARN(...) { TRACFCOMP( g_trac_test, "!TS_WARN> " __VA_ARGS__ ); \
+ CxxTest::doWarn( ); }
// TS_FAIL
-#define TS_FAIL(...) TRACFCOMP( g_trac_test, "!!!TS_FAIL> " __VA_ARGS__); \
- CxxTest::doFailTest( __FILE__, __LINE__ )
+#define TS_FAIL(...) { TRACFCOMP( g_trac_test, "!!!TS_FAIL> " __VA_ARGS__); \
+ CxxTest::doFailTest( __FILE__, __LINE__ ); }
// Statistics structure for passing original pointers to the runtime test suite.
struct CxxTestStats
OpenPOWER on IntegriCloud