From 5ac61d3c42a59f86c4886c18f0dd7003156bd448 Mon Sep 17 00:00:00 2001 From: batt Date: Mon, 21 Jun 2010 17:56:15 +0000 Subject: [PATCH] Add some more error messages. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3929 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/kern/kfile_test.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bertos/kern/kfile_test.c b/bertos/kern/kfile_test.c index 36fde490..410243e6 100644 --- a/bertos/kern/kfile_test.c +++ b/bertos/kern/kfile_test.c @@ -105,7 +105,10 @@ static bool kfile_rwTest(KFile *f, uint8_t *buf, size_t size) * Write test buffer */ if (kfile_write(f, buf, size) != size) + { + LOG_ERR("error writing buf"); return false; + } kfile_seek(f, -(kfile_off_t)size, KSM_SEEK_CUR); @@ -118,7 +121,11 @@ static bool kfile_rwTest(KFile *f, uint8_t *buf, size_t size) * Read file in test buffer */ if (kfile_read(f, buf, size) != size) + { + LOG_ERR("error reading buf"); return false; + } + kfile_seek(f, -(kfile_off_t)size, KSM_SEEK_CUR); @@ -126,8 +133,13 @@ static bool kfile_rwTest(KFile *f, uint8_t *buf, size_t size) * Check test result */ for (size_t i = 0; i < size; i++) + { if (buf[i] != (i & 0xff)) + { + LOG_ERR("error comparing at index [%d] read [%02x] expected [%02x]\n", i, buf[i], i); return false; + } + } return true; } -- 2.25.1