Make the SMART tests easier to debug by emitting the field name.
Signed-off-by: Dan Williams <[email protected]>
---
test/libndctl.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
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); \
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm