DIE("assertion '%s' failed: "fmt, #cond, ## __VA_ARGS__);\
} while (0) \
+#define IN_RANGE(value, low, high) ((value >= low) && (value <= high))
+
static char *lustre_dir;
static char *poolname;
static bool run_list_provided;
rc = llapi_layout_stripe_count_get(filelayout, &fcount);
ASSERTF(rc == 0, "errno = %d", errno);
ASSERTF(fcount == dcount || dcount == LLAPI_LAYOUT_DEFAULT ||
- dcount == LLAPI_LAYOUT_WIDE,
+ IN_RANGE(dcount, LLAPI_LAYOUT_WIDE_MIN, LLAPI_LAYOUT_WIDE_MAX),
"%"PRIu64" != %"PRIu64, fcount, dcount);
rc = llapi_layout_stripe_size_get(filelayout, &fsize);
rc = llapi_layout_stripe_size_get(filelayout, &fsize);
ASSERTF(rc == 0, "errno = %d", errno);
ASSERTF(fcount == dcount || dcount == LLAPI_LAYOUT_DEFAULT ||
- dcount == LLAPI_LAYOUT_WIDE,
+ IN_RANGE(dcount, LLAPI_LAYOUT_WIDE_MIN, LLAPI_LAYOUT_WIDE_MAX),
"%"PRIu64" != %"PRIu64, fcount, dcount);
ASSERTF(fsize == dsize, "%"PRIu64" != %"PRIu64, fsize, dsize);