Clean the proc structure before to use.
[bertos.git] / bertos / kern / kfile_test.c
index c5a996e0862052ef5d49f033797f87ad0f3acba6..8874209c0facae2874e132a846a7610173858927 100644 (file)
  * -->
  *
  * \brief Test suite for virtual KFile I/O interface.
+ *
  * This module implements a test for some generic I/O interfaces for kfile.
  *
  * \version $Id$
  * \author Francesco Sacchi <batt@develer.com>
  * \author Daniele Basile <asterix@develer.com>
- *
  */
 
 
@@ -47,8 +47,8 @@
 #include <cfg/module.h>
 
 // Define logging setting (for cfg/log.h module).
-#define LOG_LEVEL         KFILE_LOG_LEVEL
-#define LOG_VERBOSITY     KFILE_LOG_VERBOSITY
+#define LOG_LEVEL   KFILE_LOG_LEVEL
+#define LOG_FORMAT  KFILE_LOG_FORMAT
 #include <cfg/log.h>
 
 #include <mware/formatwr.h>
@@ -56,7 +56,6 @@
 #include <string.h>
 
 
-
 MOD_DEFINE(kfile_test);
 
 
@@ -91,6 +90,7 @@ static bool kfile_rwTest(KFile *f, uint8_t *buf, size_t size)
         */
        if (kfile_read(f, buf, size) != size)
                return false;
+
        kfile_seek(f, -(kfile_off_t)size, KSM_SEEK_CUR);
 
        /*
@@ -99,7 +99,6 @@ static bool kfile_rwTest(KFile *f, uint8_t *buf, size_t size)
        for (size_t i = 0; i < size; i++)
                if (buf[i] != (i & 0xff))
                        return false;
-
        return true;
 }
 
@@ -143,11 +142,11 @@ int kfile_testRun(KFile *fd, uint8_t *test_buf, uint8_t *save_buf, size_t size)
        if (save_buf)
        {
                kfile_read(fd, save_buf, size);
-               LOG_INFO("Saved content..form [%lu] to [%lu]\n", fd->seek_pos, fd->seek_pos + size);
+               LOG_INFO("Saved content..form [%ld] to [%ld]\n", fd->seek_pos, fd->seek_pos + size);
        }
 
        /* TEST 1 BEGIN. */
-       LOG_INFO("Test 1: write from pos 0 to [%lu]\n", size);
+       LOG_INFO("Test 1: write from pos 0 to [%ld]\n", (long)size);
 
        /*
         * Seek to addr 0.
@@ -267,7 +266,7 @@ int kfile_testRun(KFile *fd, uint8_t *test_buf, uint8_t *save_buf, size_t size)
 
 kfile_test_end:
        kfile_close(fd);
-       LOG_ERR("One kfile_test fail!\n");
+       LOG_ERR("One kfile_test failed!\n");
        return EOF;
 }