print_message("\n\nrunning quick tests for yaffs\n\n", 0);
for (x=0;x<total_number_of_tests;x++){
- output=test_yaffs_open();
- printf("yaffs_open = %d\n",output);
- printf("yaffs_close handle 0 = %d\n",yaffs_close(output));
- //printf("yaffs_close handle 1#################################### =%d\n",yaffs_close(1));
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,3);
int test_yaffs_mount2(void)
{
int output = -1;
- printf("closing handle again %d\n",yaffs_close(0));
output= yaffs_unmount(YAFFS_MOUNT_POINT);
if (output < 0) {
print_message("failed to unmount current_mountpoint\n",2);
#include "test_yaffs_mount_ENODEV.h"
-static int handle = 0;
+
int test_yaffs_mount_ENODEV(void)
{
int output=0;
int error_code=0;
- handle = yaffs_mount("/nonexisting_mount_point/");
- if (handle==-1){
+ output = yaffs_mount("/nonexisting_mount_point/");
+ if (output<0){
error_code = yaffs_get_error();
if (abs(error_code) == ENODEV){
return 1;
print_message("different error than expected\n",2);
return -1;
}
- } else if (output >=0){
+ } else {
print_message("non existant directory opened.(which is a bad thing)\n",2);
return -1;
}
{
int error_code = 0;
handle=yaffs_open(FILE_PATH,O_CREAT | O_RDWR, FILE_MODE);
- printf("newly opend handle = %d handle\n",handle);
char text[2000000]="\0";
int output=0;
if(output>=0){
output=yaffs_close(handle);
if (output>=0){
- printf("closed the file, handle %d\n",handle);
return 1;
} else {
print_message("could not close the handle\n",2);