From 71f20c349da0ec1aeb94954ecdd8a822a3fbdf73 Mon Sep 17 00:00:00 2001 From: "John M. Penn" Date: Thu, 13 Aug 2015 14:33:30 -0500 Subject: [PATCH] Fixes #107 : added parens to args --- include/trick/trick_tests.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/trick/trick_tests.h b/include/trick/trick_tests.h index f8a25f62..268df9bb 100644 --- a/include/trick/trick_tests.h +++ b/include/trick/trick_tests.h @@ -17,49 +17,49 @@ } #define TRICK_EXPECT_EQ( a , b , test_suite , test_case) \ - if ( a == b ) { \ + if ( (a) == (b) ) { \ add_test_result( test_suite , test_case , "" ) ; \ } else { \ add_test_result( test_suite , test_case , "TRICK_EXPECT_EQ failed" ) ; \ } #define TRICK_EXPECT_NE( a , b , test_suite , test_case) \ - if ( a != b ) { \ + if ( (a) != (b) ) { \ add_test_result( test_suite , test_case , "" ) ; \ } else { \ add_test_result( test_suite , test_case , "TRICK_EXPECT_NE failed" ) ; \ } #define TRICK_EXPECT_LT( a , b , test_suite , test_case) \ - if ( a < b ) { \ + if ( (a) < (b) ) { \ add_test_result( test_suite , test_case , "" ) ; \ } else { \ add_test_result( test_suite , test_case , "TRICK_EXPECT_LT failed" ) ; \ } #define TRICK_EXPECT_LE( a , b , test_suite , test_case) \ - if ( a <= b ) { \ + if ( (a) <= (b) ) { \ add_test_result( test_suite , test_case , "" ) ; \ } else { \ add_test_result( test_suite , test_case , "TRICK_EXPECT_LE failed" ) ; \ } #define TRICK_EXPECT_GT( a , b , test_suite , test_case) \ - if ( a > b ) { \ + if ( (a) > (b) ) { \ add_test_result( test_suite , test_case , "" ) ; \ } else { \ add_test_result( test_suite , test_case , "TRICK_EXPECT_GT failed" ) ; \ } #define TRICK_EXPECT_GE( a , b , test_suite , test_case) \ - if ( a >= b ) { \ + if ( (a) >= (b) ) { \ add_test_result( test_suite , test_case , "" ) ; \ } else { \ add_test_result( test_suite , test_case , "TRICK_EXPECT_GE failed" ) ; \ } #define TRICK_EXPECT_NEAR( a , b , tol , test_suite , test_case) \ - if ( fabs ( a - b ) < tol ) { \ + if ( fabs ( (a) - (b) ) < tol ) { \ add_test_result( test_suite , test_case , "" ) ; \ } else { \ add_test_result( test_suite , test_case , "floating point not within tolerance" ) ; \