summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/mock/usb_mux_mock.c2
-rw-r--r--include/test_util.h18
2 files changed, 11 insertions, 9 deletions
diff --git a/common/mock/usb_mux_mock.c b/common/mock/usb_mux_mock.c
index f367bfeb95..cbd0132836 100644
--- a/common/mock/usb_mux_mock.c
+++ b/common/mock/usb_mux_mock.c
@@ -27,7 +27,7 @@ static int mock_set(const struct usb_mux *me, mux_state_t mux_state)
{
mock_usb_mux.state = mux_state;
++mock_usb_mux.num_set_calls;
- ccprints("Called into mux with %d", mux_state);
+ ccprints("[MUX] Set to 0x%02x", mux_state);
return EC_SUCCESS;
}
diff --git a/include/test_util.h b/include/test_util.h
index e10dcbe259..53e750f472 100644
--- a/include/test_util.h
+++ b/include/test_util.h
@@ -17,7 +17,7 @@
#define RUN_TEST(n) \
do { \
- ccprintf("Running %s...", #n); \
+ ccprintf("Running %s...\n", #n); \
cflush(); \
before_test(); \
if (n() == EC_SUCCESS) { \
@@ -44,15 +44,17 @@
#define TEST_OPERATOR(a, b, op, fmt) \
do { \
- __auto_type _a = (a); \
- __auto_type _b = (b); \
- if (!(_a op _b)) { \
- ccprintf("%d: ASSERSION failed: %s " #op " %s\n", \
- __LINE__, #a, #b); \
- ccprintf("\t\tEVAL: " fmt " " #op " " fmt "\n", \
- _a, _b); \
+ __auto_type _a = (a); \
+ __auto_type _b = (b); \
+ if (!(_a op _b)) { \
+ ccprintf("%d: ASSERSION failed: %s " #op " %s\n", \
+ __LINE__, #a, #b); \
+ ccprintf("\t\tEVAL: " fmt " " #op " " fmt "\n", \
+ _a, _b); \
task_dump_trace(); \
return EC_ERROR_UNKNOWN; \
+ } else { \
+ ccprintf("Pass: %s " #op " %s\n", #a, #b); \
} \
} while (0)