diff mbox series

[v2,09/52] test-ipmi-hiomap: Print some information on early scenario_exit()

Message ID 20190221062851.21958-10-andrew@aj.id.au
State Accepted
Headers show
Series ipmi-hiomap: Tests and fixes for event handling | expand

Commit Message

Andrew Jeffery Feb. 21, 2019, 6:28 a.m. UTC
Now we dump the index of the event that we exited on if it's not the
appropriate scenario event type.

Cc: stable
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
---
 libflash/test/test-ipmi-hiomap.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c
index 738352cc89f1..4e1232f22ed0 100644
--- a/libflash/test/test-ipmi-hiomap.c
+++ b/libflash/test/test-ipmi-hiomap.c
@@ -96,7 +96,12 @@  static void scenario_advance(void)
 
 static void scenario_exit(void)
 {
-	assert(ipmi_msg_ctx.cursor->type == scenario_sentinel);
+	if (ipmi_msg_ctx.cursor->type != scenario_sentinel) {
+		ptrdiff_t d = ipmi_msg_ctx.cursor - ipmi_msg_ctx.scenario;
+		printf("%s: Exiting on event %tu with event type %d \n",
+		       __func__, d, ipmi_msg_ctx.cursor->type);
+		assert(false);
+	}
 }
 
 void ipmi_init_msg(struct ipmi_msg *msg, int interface __attribute__((unused)),