mirror of
https://github.com/eclipse-threadx/filex.git
synced 2026-09-14 04:05:59 +08:00
Updated copyright headers and removed revision history
* Updated version number constants * Updated copyright headers and removed revision history
This commit is contained in:
@@ -55,13 +55,13 @@ void filex_directory_naming_application_define(void *first_unused_memory)
|
||||
#ifndef FX_STANDALONE_ENABLE
|
||||
UCHAR *pointer;
|
||||
|
||||
|
||||
|
||||
/* Setup the working pointer. */
|
||||
pointer = (UCHAR *) first_unused_memory;
|
||||
|
||||
/* Create the main thread. */
|
||||
tx_thread_create(&ftest_0, "thread 0", ftest_0_entry, 0,
|
||||
pointer, DEMO_STACK_SIZE,
|
||||
tx_thread_create(&ftest_0, "thread 0", ftest_0_entry, 0,
|
||||
pointer, DEMO_STACK_SIZE,
|
||||
4, 4, TX_NO_TIME_SLICE, TX_AUTO_START);
|
||||
|
||||
pointer = pointer + DEMO_STACK_SIZE;
|
||||
@@ -98,20 +98,20 @@ UINT i;
|
||||
printf("FileX Test: Directory naming test..................................");
|
||||
|
||||
/* Format the media. This needs to be done before opening it! */
|
||||
status = fx_media_format(&ram_disk,
|
||||
status = fx_media_format(&ram_disk,
|
||||
_fx_ram_driver, // Driver entry
|
||||
ram_disk_memory, // RAM disk memory pointer
|
||||
cache_buffer, // Media buffer pointer
|
||||
CACHE_SIZE, // Media buffer size
|
||||
CACHE_SIZE, // Media buffer size
|
||||
"MY_RAM_DISK", // Volume Name
|
||||
1, // Number of FATs
|
||||
32, // Directory Entries
|
||||
0, // Hidden sectors
|
||||
512, // Total sectors
|
||||
128, // Sector size
|
||||
512, // Total sectors
|
||||
128, // Sector size
|
||||
1, // Sectors per cluster
|
||||
1, // Heads
|
||||
1); // Sectors per track
|
||||
1); // Sectors per track
|
||||
|
||||
/* Determine if the format had an error. */
|
||||
if (status)
|
||||
@@ -120,7 +120,7 @@ UINT i;
|
||||
printf("ERROR!\n");
|
||||
test_control_return(1);
|
||||
}
|
||||
|
||||
|
||||
/* Try to rename a directory before the media is opened to generate an error */
|
||||
status = fx_directory_rename(&ram_disk, "/A0", "/A1");
|
||||
if (status != FX_MEDIA_NOT_OPEN)
|
||||
@@ -152,7 +152,7 @@ UINT i;
|
||||
printf("ERROR!\n");
|
||||
test_control_return(4);
|
||||
}
|
||||
|
||||
|
||||
/* Test a directory name that does not exist to generate an error */
|
||||
/* status = fx_directory_name_test(&ram_disk, "/A0");
|
||||
if (status == FX_SUCCESS)
|
||||
@@ -161,7 +161,7 @@ UINT i;
|
||||
test_control_return(5);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/* test some directory names to test the directory search function */
|
||||
/* status = fx_directory_create(&ram_disk, "\\TEST");
|
||||
status += fx_directory_name_test(&ram_disk, "\\TEST");
|
||||
@@ -172,7 +172,7 @@ UINT i;
|
||||
test_control_return(6);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* Create a series of directories... */
|
||||
status = fx_directory_create(&ram_disk, "/A0");
|
||||
@@ -219,7 +219,7 @@ UINT i;
|
||||
/* Error creating special name. Return to caller. */
|
||||
printf("ERROR!\n");
|
||||
test_control_return(9);
|
||||
}
|
||||
}
|
||||
|
||||
/* Create another special file name. */
|
||||
special_name[0] = (CHAR)0xE5;
|
||||
@@ -240,7 +240,7 @@ UINT i;
|
||||
/* Error creating special name. Return to caller. */
|
||||
printf("ERROR!\n");
|
||||
test_control_return(10);
|
||||
}
|
||||
}
|
||||
|
||||
/* Create the next level of sub-directories.... with the interesting names... */
|
||||
status = fx_directory_default_set(&ram_disk, "/A0");
|
||||
@@ -252,7 +252,7 @@ UINT i;
|
||||
status += fx_directory_create(&ram_disk, " c");
|
||||
status += fx_directory_create(&ram_disk, " c/ e");
|
||||
status += fx_directory_create(&ram_disk, " c/ e/ f");
|
||||
|
||||
|
||||
/* Check for errors. */
|
||||
if (status != FX_SUCCESS)
|
||||
{
|
||||
@@ -260,7 +260,7 @@ UINT i;
|
||||
/* Error creating interesting directory names. Return to caller. */
|
||||
printf("ERROR!\n");
|
||||
test_control_return(11);
|
||||
}
|
||||
}
|
||||
|
||||
/* Now attempt to create a file in each of these sub-directories. */
|
||||
status = fx_file_create(&ram_disk, "/A0/a/test.txt");
|
||||
@@ -270,7 +270,7 @@ UINT i;
|
||||
fx_media_flush(&ram_disk);
|
||||
status += fx_file_create(&ram_disk, "/A0 / c/ e/ f/test.txt");
|
||||
fx_media_flush(&ram_disk);
|
||||
|
||||
|
||||
/* Check for errors. */
|
||||
if (status != FX_SUCCESS)
|
||||
{
|
||||
@@ -278,7 +278,7 @@ UINT i;
|
||||
/* Error creating test files in the interesting sub-directories. Return to caller. */
|
||||
printf("ERROR!\n");
|
||||
test_control_return(12);
|
||||
}
|
||||
}
|
||||
|
||||
/* Now attempt to delete the file in each of these sub-directories. */
|
||||
status = fx_file_delete(&ram_disk, "/A0/a/test.txt");
|
||||
@@ -294,7 +294,7 @@ UINT i;
|
||||
/* Error deleting test files in the interesting sub-directories. Return to caller. */
|
||||
printf("ERROR!\n");
|
||||
test_control_return(13);
|
||||
}
|
||||
}
|
||||
|
||||
/* Now attempt to delete the interesting sub-directories. */
|
||||
status = fx_directory_delete(&ram_disk, "/A0/a");
|
||||
@@ -312,7 +312,7 @@ UINT i;
|
||||
/* Error deleting the interesting sub-directories. Return to caller. */
|
||||
printf("ERROR!\n");
|
||||
test_control_return(14);
|
||||
}
|
||||
}
|
||||
|
||||
/* Delete a series of directories... Use short name for b0 and d0! */
|
||||
status = fx_directory_delete(&ram_disk, "/A0");
|
||||
@@ -335,7 +335,7 @@ UINT i;
|
||||
/* Flush the media... should be empty at this point. */
|
||||
status += fx_media_flush(&ram_disk);
|
||||
|
||||
/* Now fill the media's root directory until we get an error... We will use 8.3 names
|
||||
/* Now fill the media's root directory until we get an error... We will use 8.3 names
|
||||
to attempt to create 32 names. */
|
||||
status += fx_directory_create(&ram_disk, "A01");
|
||||
status += fx_directory_create(&ram_disk, "A02");
|
||||
@@ -429,7 +429,7 @@ fx_media_flush(&ram_disk);
|
||||
status += fx_directory_delete(&ram_disk, "A30");
|
||||
status += fx_directory_delete(&ram_disk, "A31");
|
||||
status += fx_directory_delete(&ram_disk, "A32");
|
||||
|
||||
|
||||
/* Check for errors... */
|
||||
if (status != FX_SUCCESS)
|
||||
{
|
||||
@@ -441,7 +441,7 @@ fx_media_flush(&ram_disk);
|
||||
|
||||
/* Flush the media. */
|
||||
status = fx_media_flush(&ram_disk);
|
||||
|
||||
|
||||
/* Now do the same thing, except with 2 entry long names. */
|
||||
status += fx_directory_create(&ram_disk, "b01");
|
||||
status += fx_directory_create(&ram_disk, "b02");
|
||||
@@ -501,7 +501,7 @@ fx_media_flush(&ram_disk);
|
||||
status += fx_directory_delete(&ram_disk, "b14");
|
||||
status += fx_directory_delete(&ram_disk, "b15");
|
||||
status += fx_directory_delete(&ram_disk, "b16");
|
||||
|
||||
|
||||
/* Check for errors... */
|
||||
if (status != FX_SUCCESS)
|
||||
{
|
||||
@@ -510,7 +510,7 @@ fx_media_flush(&ram_disk);
|
||||
printf("ERROR!\n");
|
||||
test_control_return(21);
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
/* test the directory free search function for proper error handing with invalid names */
|
||||
FX_DIR_ENTRY dir_entry;
|
||||
@@ -524,7 +524,7 @@ fx_media_flush(&ram_disk);
|
||||
printf("ERROR!\n");
|
||||
test_control_return(22);
|
||||
}
|
||||
|
||||
|
||||
/* test the directory free search function for proper error handling of special characters */
|
||||
/* This code is executing differently on local vs server. Disabled until cause is explored */
|
||||
dir_entry.fx_dir_entry_name[0] = (char)128;
|
||||
@@ -536,7 +536,7 @@ fx_media_flush(&ram_disk);
|
||||
printf("ERROR!\n");
|
||||
test_control_return(23);
|
||||
}
|
||||
|
||||
|
||||
/* test the directory free search function for proper error handling of special characters */
|
||||
dir_entry.fx_dir_entry_name[0] = '%';
|
||||
dir_entry.fx_dir_entry_name[1] = '%';
|
||||
@@ -547,7 +547,7 @@ fx_media_flush(&ram_disk);
|
||||
printf("ERROR!\n");
|
||||
test_control_return(24);
|
||||
}
|
||||
|
||||
|
||||
/* test the directory free search function for proper error handling of special characters */
|
||||
dir_entry.fx_dir_entry_name[0] = ']';
|
||||
dir_entry.fx_dir_entry_name[1] = ']';
|
||||
@@ -559,7 +559,7 @@ fx_media_flush(&ram_disk);
|
||||
test_control_return(25);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* Create a directory. */
|
||||
status = fx_directory_create(&ram_disk, "b16");
|
||||
|
||||
@@ -576,22 +576,22 @@ fx_media_flush(&ram_disk);
|
||||
_fx_utility_logical_sector_read_error_request = 1;
|
||||
status = fx_directory_name_test(&ram_disk, "b16");
|
||||
_fx_utility_logical_sector_read_error_request = 0;
|
||||
|
||||
|
||||
/* Check for the I/O error. */
|
||||
if (status != FX_IO_ERROR)
|
||||
{
|
||||
|
||||
|
||||
printf("ERROR!\n");
|
||||
test_control_return(26);
|
||||
}
|
||||
|
||||
/* Test the directory name. */
|
||||
_fx_directory_name_extract("\\", return_name);
|
||||
|
||||
|
||||
/* Check for a good return name. */
|
||||
if (return_name[0] != 0)
|
||||
{
|
||||
|
||||
|
||||
printf("ERROR!\n");
|
||||
test_control_return(27);
|
||||
}
|
||||
@@ -608,11 +608,11 @@ fx_media_flush(&ram_disk);
|
||||
/* Was the name truncated? */
|
||||
if (return_name[FX_MAX_LONG_NAME_LEN - 1] != 0)
|
||||
{
|
||||
|
||||
|
||||
printf("ERROR!\n");
|
||||
test_control_return(28);
|
||||
}
|
||||
|
||||
|
||||
/* Close the media. */
|
||||
status = fx_media_close(&ram_disk);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user