Updated is_yaffs_working_test_fix
authorTimothy Manning <codedraftsman@gmail.com>
Fri, 25 Jun 2021 02:39:45 +0000 (14:39 +1200)
committerTimothy Manning <codedraftsman@gmail.com>
Thu, 1 Jul 2021 02:36:33 +0000 (14:36 +1200)
Added pthread library to the makefile and changed
the mountpoint to the new "yflash2".

Signed-off-by: Timothy Manning <codedraftsman@gmail.com>
direct/test-framework/timothy_tests/handle_tests/Makefile
direct/test-framework/timothy_tests/handle_tests/handle_test.c
direct/test-framework/timothy_tests/handle_tests/handle_test.h

index 2e847a612ac9fe997f57d02597bee116fb434a3d..af64f28d44641174cec274eb1515c84b888622d1 100644 (file)
@@ -34,10 +34,10 @@ include $(YDI_FRAMEWORK_DIR)/FrameworkRules.mk
 
 
 yaffs_test: $(FRAMEWORK_SOURCES) $(YAFFS_TEST_OBJS)
-       gcc $(CFLAGS) -o $@ $(YAFFS_TEST_OBJS)
+       gcc $(CFLAGS) -o $@ $(YAFFS_TEST_OBJS) -lpthread
 
 
 
 handle_test: $(FRAMEWORK_SOURCES) $(YAFFS_TEST_OBJS)
-       gcc $(CFLAGS) -o $@ $(YAFFS_TEST_OBJS)
+       gcc $(CFLAGS) -o $@ $(YAFFS_TEST_OBJS) -lpthread
 
index b27f2af742798863a7b27177b3ec92eecf17734c..ed721fbfab628e402fbb37f1755206d0bd9c1007 100644 (file)
@@ -22,7 +22,7 @@ int main()
        int output =0;
        unsigned int total_number_of_tests_run=0;
        yaffs_start_up();
-       yaffs_mount("yaffs2");
+       yaffs_mount(YAFFS_MOUNT_POINT);
 
        printf("running tests\n");
 
@@ -62,7 +62,7 @@ int dup_test(void){
        output=yaffs_lseek(handle,20,SEEK_SET);
        if (output >= 0) {
                output = yaffs_lseek(handle,0,SEEK_CUR);
-               if (output = 20){
+               if (output == 20){
                        printf("dup is working\n");
                        return 1;
                } else if (output <0){
index bc6c2f8bb6d6a0ad30624963a7198e6324c88f3a..35a41e9c6d53f7d115a0cc35a107a3e87e546ccc 100644 (file)
 #include <stdio.h>
 #include "yaffsfs.h"
 
-#define FILE_PATH "/yaffs2/foo"
+#define YAFFS_MOUNT_POINT "/yflash2/"
+#define FILE_PATH "/yflash2/foo"
 
 int open_close_handle_test(int num_of_tests);
 int open_handle(void);
 void get_error(void);
+int dup_test(void);
+
 #endif