From f8baa259a1f4c4f2c0baa0ac393dbb6ab207e479 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Thu, 15 Dec 2016 12:45:22 -0700 Subject: [PATCH] test/nvme/hotplug: print an error if counts mismatch Change-Id: I99339b16051011c9685d9d8afb79463eba01bfc4 Signed-off-by: Daniel Verkamp --- examples/nvme/hotplug/hotplug.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/examples/nvme/hotplug/hotplug.c b/examples/nvme/hotplug/hotplug.c index 38ecfbb37..a307449f5 100644 --- a/examples/nvme/hotplug/hotplug.c +++ b/examples/nvme/hotplug/hotplug.c @@ -466,8 +466,15 @@ int main(int argc, char **argv) fprintf(stderr, "Initialization complete. Starting I/O...\n"); io_loop(); - if ((g_expected_insert_times != -1 && g_insert_times != g_expected_insert_times) || - (g_expected_removal_times != -1 && g_removal_times != g_expected_removal_times)) { + if (g_expected_insert_times != -1 && g_insert_times != g_expected_insert_times) { + fprintf(stderr, "Expected inserts %d != actual inserts %d\n", + g_expected_insert_times, g_insert_times); + return 1; + } + + if (g_expected_removal_times != -1 && g_removal_times != g_expected_removal_times) { + fprintf(stderr, "Expected removals %d != actual removals %d\n", + g_expected_removal_times, g_removal_times); return 1; }