diff mbox series

[v2,07/10] mgmt-tester: Print unexpected command responses

Message ID 20201111230421.3364932-8-luiz.dentz@gmail.com (mailing list archive)
State New, archived
Headers show
Series Testers/Emulator overhaul | expand

Commit Message

Luiz Augusto von Dentz Nov. 11, 2020, 11:04 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This prints the difference between the command response and the
expected command response to make it easier to debug.
---
 tools/mgmt-tester.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c
index a5bfa1ce1..bb8eb578c 100644
--- a/tools/mgmt-tester.c
+++ b/tools/mgmt-tester.c
@@ -6315,6 +6315,9 @@  static void command_generic_callback(uint8_t status, uint16_t length,
 		if (expect_param && expect_len > 0 &&
 					memcmp(param, expect_param, length)) {
 			tester_warn("Unexpected cmd response parameter value");
+			util_hexdump('>', param, length, print_debug, "");
+			util_hexdump('!', expect_param, length, print_debug,
+								"");
 			tester_test_failed();
 			return;
 		}