From aed1065488d0c27e1654091636e4cfe5fb8e6951 Mon Sep 17 00:00:00 2001 From: Timothy Manning Date: Mon, 15 Nov 2010 16:04:24 +1300 Subject: [PATCH] yaffs Fixed some bigs in quick tests. Signed-off-by: Timothy Manning --- direct/timothy_tests/quick_tests/lib.c | 2 +- direct/timothy_tests/quick_tests/quick_tests.c | 6 +++--- direct/timothy_tests/quick_tests/test_yaffs_close_EBADF.c | 4 +++- direct/timothy_tests/quick_tests/test_yaffs_fchmod.c | 2 +- direct/timothy_tests/quick_tests/test_yaffs_fchmod_EBADF.c | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/direct/timothy_tests/quick_tests/lib.c b/direct/timothy_tests/quick_tests/lib.c index 8c7608e..1c3ca68 100644 --- a/direct/timothy_tests/quick_tests/lib.c +++ b/direct/timothy_tests/quick_tests/lib.c @@ -14,7 +14,7 @@ #include "lib.h" static int EXIT_ON_ERROR = 1; -static int PRINT_LEVEL = 1; //This sets the level of detail which is printed. There are 3 levels 0,1,2 and 3 +static int PRINT_LEVEL = 2; //This sets the level of detail which is printed. There are 3 levels 0,1,2 and 3 //0 just prints the number of tests passed and failed. //1 is the basic print level. it will print the details of a failed test. //2 will print if a test passes and cleans. diff --git a/direct/timothy_tests/quick_tests/quick_tests.c b/direct/timothy_tests/quick_tests/quick_tests.c index fcf312d..0dfe000 100644 --- a/direct/timothy_tests/quick_tests/quick_tests.c +++ b/direct/timothy_tests/quick_tests/quick_tests.c @@ -40,12 +40,12 @@ int main(int argc, char *argv[]){ //printf("x %d\n",x); yaffs_set_error(0); /*reset the last error to 0 */ sprintf(message,"\nrunning test: %s \n",test_list[x].name_of_test); - print_message(message,2); + print_message(message,3); output=test_list[x].p_function(); /*run test*/ if (output>=0){ /*test has passed*/ sprintf(message,"\ttest %s passed\n",test_list[x].name_of_test); - print_message(message,2); + print_message(message,3); num_of_tests_pass++; } else { /*test is assumed to have failed*/ @@ -77,7 +77,7 @@ int main(int argc, char *argv[]){ } else { sprintf(message,"\ttest clean: %s passed\n",test_list[x].name_of_test); - print_message(message,2); + print_message(message,3); } } /*this is where the loop should break to*/ diff --git a/direct/timothy_tests/quick_tests/test_yaffs_close_EBADF.c b/direct/timothy_tests/quick_tests/test_yaffs_close_EBADF.c index 7a0184d..a058d98 100644 --- a/direct/timothy_tests/quick_tests/test_yaffs_close_EBADF.c +++ b/direct/timothy_tests/quick_tests/test_yaffs_close_EBADF.c @@ -30,6 +30,7 @@ int test_yaffs_close_EBADF(void) if (output < 0){ error_code = yaffs_get_error(); if (abs(error_code) == EBADF){ + handle =-1; return 1; } else { print_message("different error than expected\n",2); @@ -53,7 +54,8 @@ int test_yaffs_close_EBADF(void) int test_yaffs_close_EBADF_clean(void) { - if (handle <= 0){ + if (handle >= 0){ + printf("handle %d\n",handle); return yaffs_close(handle); } else { return 1; diff --git a/direct/timothy_tests/quick_tests/test_yaffs_fchmod.c b/direct/timothy_tests/quick_tests/test_yaffs_fchmod.c index 896a33b..ff924be 100644 --- a/direct/timothy_tests/quick_tests/test_yaffs_fchmod.c +++ b/direct/timothy_tests/quick_tests/test_yaffs_fchmod.c @@ -26,7 +26,7 @@ int test_yaffs_fchmod(void) return -1; } - output = yaffs_fchmod(handle,S_IREAD||S_IWRITE); + output = yaffs_fchmod(handle,S_IREAD|S_IWRITE); if (output>=0){ /* there were no errors */ diff --git a/direct/timothy_tests/quick_tests/test_yaffs_fchmod_EBADF.c b/direct/timothy_tests/quick_tests/test_yaffs_fchmod_EBADF.c index 9e19636..ce31a4c 100644 --- a/direct/timothy_tests/quick_tests/test_yaffs_fchmod_EBADF.c +++ b/direct/timothy_tests/quick_tests/test_yaffs_fchmod_EBADF.c @@ -19,7 +19,7 @@ int test_yaffs_fchmod_EBADF(void) int error = 0; int output = 0; - output = yaffs_fchmod(-1,S_IREAD||S_IWRITE); + output = yaffs_fchmod(-1,S_IREAD|S_IWRITE); if (output<0){ error=yaffs_get_error(); -- 2.30.2