diff options
author | Christopher Haster <chaster@utexas.edu> | 2017-04-22 19:42:05 +0300 |
---|---|---|
committer | Christopher Haster <chaster@utexas.edu> | 2017-04-22 23:42:05 +0300 |
commit | 789286a25748649f46afebec6566d00763a0074e (patch) | |
tree | ec3970bd33da5077944f0c30736cfa8276b22b5e /tests/test_files.sh | |
parent | 3b9d6630c8fab475307d95824c368d45cd6ba41a (diff) |
Simplified config
Before, the lfs had multiple paths to determine config options:
- lfs_config struct passed during initialization
- lfs_bd_info struct passed during block device initialization
- compile time options
This allowed different developers to provide their own needs
to the filesystem, such as the block device capabilities and
the higher level user's own tweaks.
However, this comes with additional complexity and action required
when the configurations are incompatible.
For now, this has been reduced to all information (including block
device function pointers) being passed through the lfs_config struct.
We just defer more complicated handling of configuration options to
the top level user.
This simplifies configuration handling and gives the top level user
the responsibility to handle configuration, which they probably would
have wanted to do anyways.
Diffstat (limited to 'tests/test_files.sh')
-rwxr-xr-x | tests/test_files.sh | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/test_files.sh b/tests/test_files.sh index 7a381ec..dbdd923 100755 --- a/tests/test_files.sh +++ b/tests/test_files.sh @@ -8,12 +8,12 @@ LARGESIZE=262144 echo "=== File tests ===" rm -rf blocks tests/test.py << TEST - lfs_format(&lfs, &config) => 0; + lfs_format(&lfs, &cfg) => 0; TEST echo "--- Simple file test ---" tests/test.py << TEST - lfs_mount(&lfs, &config) => 0; + lfs_mount(&lfs, &cfg) => 0; lfs_file_open(&lfs, &file[0], "hello", LFS_O_RDWR | LFS_O_CREAT | LFS_O_APPEND) => 0; size = strlen("Hello World!\n"); memcpy(wbuffer, "Hello World!\n", size); @@ -29,7 +29,7 @@ tests/test.py << TEST lfs_size_t size = $1; lfs_size_t chunk = 31; srand(0); - lfs_mount(&lfs, &config) => 0; + lfs_mount(&lfs, &cfg) => 0; lfs_file_open(&lfs, &file[0], "$2", LFS_O_WRONLY | LFS_O_CREAT) => 0; for (lfs_size_t i = 0; i < size; i += chunk) { chunk = (chunk < size - i) ? chunk : size - i; @@ -48,7 +48,7 @@ tests/test.py << TEST lfs_size_t size = $1; lfs_size_t chunk = 29; srand(0); - lfs_mount(&lfs, &config) => 0; + lfs_mount(&lfs, &cfg) => 0; lfs_file_open(&lfs, &file[0], "$2", LFS_O_RDONLY) => 0; for (lfs_size_t i = 0; i < size; i += chunk) { chunk = (chunk < size - i) ? chunk : size - i; @@ -81,7 +81,7 @@ r_test $LARGESIZE largeavacado echo "--- Dir check ---" tests/test.py << TEST - lfs_mount(&lfs, &config) => 0; + lfs_mount(&lfs, &cfg) => 0; lfs_dir_open(&lfs, &dir[0], "/") => 0; lfs_dir_read(&lfs, &dir[0], &info) => 1; lfs_dir_read(&lfs, &dir[0], &info) => 1; |