test_astlpc: Do debug logging before asserts
This way if the asserts fire it's obvious why.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: Ibc3d9231696ec524498615a9d75c6ba19c060a7f
diff --git a/tests/test_astlpc.c b/tests/test_astlpc.c
index 2d637de..c5f9e93 100644
--- a/tests/test_astlpc.c
+++ b/tests/test_astlpc.c
@@ -98,13 +98,13 @@
{
struct mctp_binding_astlpc_mmio *mmio = binding_to_mmio(data);
+ mctp_prdebug("%s: %zu bytes from 0x%lx", __func__, len, offset);
+
assert(offset >= 0L);
assert(offset + len < mmio->lpc_size);
memcpy(buf, mmio->lpc + offset, len);
- mctp_prdebug("%s: %zu bytes from 0x%lx", __func__, len, offset);
-
return 0;
}
@@ -112,13 +112,13 @@
{
struct mctp_binding_astlpc_mmio *mmio = binding_to_mmio(data);
+ mctp_prdebug("%s: %zu bytes to 0x%lx", __func__, len, offset);
+
assert(offset >= 0L);
assert(offset + len < mmio->lpc_size);
memcpy(mmio->lpc + offset, buf, len);
- mctp_prdebug("%s: %zu bytes to 0x%lx", __func__, len, offset);
-
return 0;
}