File tree Expand file tree Collapse file tree
tests/unittests/tests-spiffs Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11USEMODULE += spiffs
2- USEMODULE += mtdi_native
2+ USEMODULE += mtd_native
Original file line number Diff line number Diff line change 2222
2323#include "tests-spiffs.h"
2424
25- MTD_NATIVE_DESC (_dev );
25+ MTD_NATIVE_DESC (_dev , "MEMORY.bin" );
2626
2727static struct spiffs_desc spiffs_desc = {
2828 .lock = MUTEX_INIT ,
29- .dev = & _dev ,
29+ .dev = ( mtd_dev_t * ) & _dev ,
3030};
3131
3232static vfs_mount_t _test_spiffs_mount = {
@@ -102,10 +102,10 @@ static void tests_spiffs_write(void)
102102
103103static void tests_spiffs_write2 (void )
104104{
105- char buf [1024 ];
105+ char buf [256 ];
106106 /*char r_buf[sizeof(buf) + 2];*/
107107
108- for (int i = 0 ; i < 1024 ; i ++ ) {
108+ for (int i = 0 ; i < 256 ; i ++ ) {
109109 buf [i ] = 'A' + (i % 30 );
110110 }
111111
@@ -117,7 +117,7 @@ static void tests_spiffs_write2(void)
117117 int fd = vfs_open ("/test-spiffs/test.txt" , O_CREAT | O_RDWR , 0 );
118118 TEST_ASSERT (fd >= 0 );
119119
120- for (int i = 0 ; i < 500 ; i ++ ) {
120+ for (int i = 0 ; i < 2000 ; i ++ ) {
121121 res = vfs_write (fd , buf , sizeof (buf ));
122122 TEST_ASSERT_EQUAL_INT (sizeof (buf ), res );
123123 }
You can’t perform that action at this time.
0 commit comments