#include "test_yaffs_lseek.h"
+static int handle=0;
int test_yaffs_lseek(void){
- int handle=test_open_file();
+ handle=test_yaffs_open_file();
char text[20]="\0";
int output=0;
if (handle>0){
- return yaffs_lseek(handle, 0, SEEK_SET);
- /*
- 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");
- }
+ if (0==yaffs_lseek(handle, 0, SEEK_SET)){
+ return 1;
+ }
+ else {
+ printf("lseek returned a different position to the expeced position\n");
}
- else{
- printf("error reading file");
- } */
}
else {
printf("error opening file\n");
}
int test_yaffs_lseek_clean(void){
- /* need to reset the seek position*/
- return test_yaffs_lseek_to_beginning();
-}
-int test_yaffs_lseek_to_beginning(void){
- int handle=test_open_file();
- if (handle>0){
- return yaffs_lseek(handle, 0, SEEK_SET);
- }
- else {
- printf("error opening file\n");
- return -1;
- }
+ return yaffs_close(handle);
}
+