The current implementation of nvme_assert in the unit test nvme_impl.h just prints the message and continues. We should not be triggering assert conditions, even in the unit test code, so make nvme_assert actually call assert(). This lets us catch mistakes in the unit tests more easily. Also fix the two unit tests that currently trigger an assert: - The I/O splitting test in nvme_ns_cmd_ut was passing an invalid combination of NULL payload with non-zero lba_count. - The ctrlr_cmd test was passing an invalid number of entries to nvme_ctrlr_cmd_get_error_page(). This case should probably not be an assert but rather an error code. However, the function does not return a status code currently, so it is not trivial to make that change. For now, just drop the asserting test case and the code added to the test to work around it. While we're here, fix the macros in the unit test nvme_impl.h so they are usable in single-line conditionals without braces - that is the whole point of the do { ... } while (0) pattern, so there should be no trailing semicolon. Change-Id: Iad503c5c5d19a426d48c80d9a7d6da12ff2c982a Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com> |
||
---|---|---|
.. | ||
.gitignore | ||
Makefile | ||
nvme_ctrlr_cmd_ut.c |