Skip to contentSkip to conversation

include/tst_test_macros.h: Use TTERRNO for TST_EXP_FAIL() properly

PATCH New [email protected] 2 participants 2 messages Mar 17, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 include/tst_test_macros.h: Use TTERRNO for TST_EXP_FAIL() properly

From: Xiao Yang <[email protected]>

1) Remove TTERRNO if TST_RET == 0
2) Use TTERRNO if TST_RET == -1

---
 include/tst_test_macros.h | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
include/tst_test_macros.h +3 -4
index 92cb5c66b..189891507 100644
@@ -114,8 +114,7 @@ extern void *TST_RET_PTR;
 		TST_PASS = 0;                                                  \
 		                                                               \
 		if (TST_RET == 0) {                                            \
-			TST_MSG_(TFAIL | TTERRNO, " succeeded",                \
-			         #SCALL, ##__VA_ARGS__);                       \
+			TST_MSG_(TFAIL, " succeeded", #SCALL, ##__VA_ARGS__);  \
 		        break;                                                 \
 		}                                                              \
 		                                                               \
@@ -127,11 +126,11 @@ extern void *TST_RET_PTR;
 		                                                               \
 		if (ERRNO) {                                                   \
 			if (TST_ERR == ERRNO) {                                \
-				TST_MSG_(TPASS | TERRNO, "",                   \
+				TST_MSG_(TPASS | TTERRNO, "",                  \
 				         #SCALL, ##__VA_ARGS__);               \
 				TST_PASS = 1;                                  \
 			} else {                                               \
-				TST_MSGP_(TFAIL | TERRNO, " expected %s",      \
+				TST_MSGP_(TFAIL | TTERRNO, " expected %s",     \
 				          tst_strerrno(ERRNO),                 \
 				          #SCALL, ##__VA_ARGS__);              \
 			}                                                      \
Signature · 1 line
2.26.2
#1 lore raw

PATCH 1/1 include/tst_test_macros.h: Use TTERRNO for TST_EXP_FAIL() properly

Hi!
Good catch, pushed, thanks.

Signature · 2 lines
Cyril Hrubis
[email protected]