X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=direct%2Ftimothy_tests%2Fquick_tests%2Ftest_yaffs_read.c;fp=direct%2Ftimothy_tests%2Fquick_tests%2Ftest_yaffs_read.c;h=9033107d9f5762e59870e54eec38662a9c6d9573;hb=26592c53da98ac887099559afbcb8dda05264e1c;hp=0000000000000000000000000000000000000000;hpb=10fffbf6cc8a96cb9b3b9164c668202010e37faa;p=yaffs2.git diff --git a/direct/timothy_tests/quick_tests/test_yaffs_read.c b/direct/timothy_tests/quick_tests/test_yaffs_read.c new file mode 100644 index 0000000..9033107 --- /dev/null +++ b/direct/timothy_tests/quick_tests/test_yaffs_read.c @@ -0,0 +1,32 @@ +#include "test_yaffs_write.h" + +int test_yaffs_read(void){ + int handle=test_open_file(); + char text[20]="\0"; + int output=0; + if (handle>0){ + output=yaffs_read(handle, text, FILE_TEXT_NBYTES); + if (output>0){ + if (text==FILE_TEXT){ + return 1; + } + else { + printf("text does not match the the text that should be in the file\n"); + } + } + else{ + printf("error reading file"); + } + } + else { + printf("error opening file\n"); + return -1; + } + +} + +int test_yaffs_read_clean(void){ + /* need to reset the seek position*/ + + return test_yaffs_lseek_to_beginning(); +}