diff mbox

[ndctl,06/17] ndctl, test: emit smart field names

Message ID 151217070197.28402.15413187772658826772.stgit@dwillia2-desk3.amr.corp.intel.com (mailing list archive)
State Accepted
Commit 2361eb36ccfd
Headers show

Commit Message

Dan Williams Dec. 1, 2017, 11:25 p.m. UTC
Make the SMART tests easier to debug by emitting the field name.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 test/libndctl.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/test/libndctl.c b/test/libndctl.c
index 5189f7886481..b534b640cb8d 100644
--- a/test/libndctl.c
+++ b/test/libndctl.c
@@ -2122,8 +2122,9 @@  static int check_set_config_data(struct ndctl_bus *bus, struct ndctl_dimm *dimm,
 
 #define __check_smart(dimm, cmd, field) ({ \
 	if (ndctl_cmd_smart_get_##field(cmd) != smart_data.field) { \
-		fprintf(stderr, "%s dimm: %#x expected field %#x got: %#x\n", \
-				__func__, ndctl_dimm_get_handle(dimm), \
+		fprintf(stderr, "%s dimm: %#x expected \'" #field \
+				"\' %#x got: %#x\n", __func__, \
+				ndctl_dimm_get_handle(dimm), \
 				smart_data.field, \
 				ndctl_cmd_smart_get_##field(cmd)); \
 		ndctl_cmd_unref(cmd); \
@@ -2187,8 +2188,9 @@  static int check_smart(struct ndctl_bus *bus, struct ndctl_dimm *dimm,
 
 #define __check_smart_threshold(dimm, cmd, field) ({ \
 	if (ndctl_cmd_smart_threshold_get_##field(cmd) != smart_t_data.field) { \
-		fprintf(stderr, "%s dimm: %#x expected field %#x got: %#x\n", \
-				__func__, ndctl_dimm_get_handle(dimm), \
+		fprintf(stderr, "%s dimm: %#x expected \'" #field \
+				"\' %#x got: %#x\n", __func__, \
+				ndctl_dimm_get_handle(dimm), \
 				smart_t_data.field, \
 				ndctl_cmd_smart_threshold_get_##field(cmd)); \
 		ndctl_cmd_unref(cmd); \