summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Jeffery <andrew@aj.id.au>2019-03-14 14:56:34 +1030
committerAndrew Jeffery <andrew@aj.id.au>2019-03-15 22:42:12 +1030
commitbf2417e5efaf799ca196d61aafd481c916d11bf8 (patch)
treea7b1b3778f92569e1c1343151719c12c12fb0e2c
parent261f61a1747a9ebf092d4f426e891ff94ad33ffc (diff)
downloadphosphor-mboxbridge-bf2417e5efaf799ca196d61aafd481c916d11bf8.tar.gz
phosphor-mboxbridge-bf2417e5efaf799ca196d61aafd481c916d11bf8.zip
test/mbox: Use assertions for error handling
No need to try to exit gracefully in the test cases. Change-Id: Id558c5201c08bdb0b34859cb3af1a0efa1a2809b Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
-rw-r--r--test/mbox.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/test/mbox.c b/test/mbox.c
index f7560f1..8897924 100644
--- a/test/mbox.c
+++ b/test/mbox.c
@@ -292,11 +292,8 @@ int mbox_set_mtd_data(struct mbox_context *context, const void *data,
/* Sanity check */
arg = container_of(context, struct mbox_test_context, context);
- if (&test != arg)
- return -1;
-
- if (len > test.context.mtd_info.size)
- return -2;
+ assert(&test == arg);
+ assert(len <= test.context.flash_size);
map = mmap(NULL, test.context.mtd_info.size, PROT_WRITE, MAP_SHARED,
test.flash.fd, 0);
OpenPOWER on IntegriCloud