Skip to content

Commit

Permalink
Removed use of LFS_VERSION in test_compat
Browse files Browse the repository at this point in the history
LFS_VERSION -> LFS_DISK_VERSION

These tests shouldn't depend on LFS_VERSION. It's a bit subtle, but
LFS_VERSION versions the API, and LFS_DISK_VERSION versions the
on-disk format, which is what test_compat should be testing.
  • Loading branch information
geky committed Jun 6, 2023
1 parent 87bbf1d commit fdee127
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions tests/test_compat.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ code = '''
#define STRINGIZE_(x) #x
#include STRINGIZE(LFSP)
#else
#define LFSP_VERSION LFS_VERSION
#define LFSP_VERSION_MAJOR LFS_VERSION_MAJOR
#define LFSP_VERSION_MINOR LFS_VERSION_MINOR
#define LFSP_DISK_VERSION LFS_DISK_VERSION
#define LFSP_DISK_VERSION_MAJOR LFS_DISK_VERSION_MAJOR
#define LFSP_DISK_VERSION_MINOR LFS_DISK_VERSION_MINOR
Expand Down Expand Up @@ -63,7 +60,7 @@ code = '''

# test we can mount in a new version
[cases.test_compat_forward_mount]
if = 'LFS_VERSION_MAJOR == LFSP_VERSION_MAJOR'
if = 'LFS_DISK_VERSION_MAJOR == LFSP_DISK_VERSION_MAJOR'
code = '''
// create the previous version
struct lfsp_config cfgp;
Expand Down Expand Up @@ -91,7 +88,7 @@ code = '''
# test we can read dirs in a new version
[cases.test_compat_forward_read_dirs]
defines.COUNT = 5
if = 'LFS_VERSION_MAJOR == LFSP_VERSION_MAJOR'
if = 'LFS_DISK_VERSION_MAJOR == LFSP_DISK_VERSION_MAJOR'
code = '''
// create the previous version
struct lfsp_config cfgp;
Expand Down Expand Up @@ -148,7 +145,7 @@ code = '''
defines.COUNT = 5
defines.SIZE = [4, 32, 512, 8192]
defines.CHUNK = 4
if = 'LFS_VERSION_MAJOR == LFSP_VERSION_MAJOR'
if = 'LFS_DISK_VERSION_MAJOR == LFSP_DISK_VERSION_MAJOR'
code = '''
// create the previous version
struct lfsp_config cfgp;
Expand Down Expand Up @@ -235,7 +232,7 @@ code = '''
defines.COUNT = 5
defines.SIZE = [4, 32, 512, 8192]
defines.CHUNK = 4
if = 'LFS_VERSION_MAJOR == LFSP_VERSION_MAJOR'
if = 'LFS_DISK_VERSION_MAJOR == LFSP_DISK_VERSION_MAJOR'
code = '''
// create the previous version
struct lfsp_config cfgp;
Expand Down Expand Up @@ -347,7 +344,7 @@ code = '''
# test we can write dirs in a new version
[cases.test_compat_forward_write_dirs]
defines.COUNT = 10
if = 'LFS_VERSION_MAJOR == LFSP_VERSION_MAJOR'
if = 'LFS_DISK_VERSION_MAJOR == LFSP_DISK_VERSION_MAJOR'
code = '''
// create the previous version
struct lfsp_config cfgp;
Expand Down Expand Up @@ -411,7 +408,7 @@ code = '''
defines.COUNT = 5
defines.SIZE = [4, 32, 512, 8192]
defines.CHUNK = 2
if = 'LFS_VERSION_MAJOR == LFSP_VERSION_MAJOR'
if = 'LFS_DISK_VERSION_MAJOR == LFSP_DISK_VERSION_MAJOR'
code = '''
// create the previous version
struct lfsp_config cfgp;
Expand Down Expand Up @@ -530,7 +527,7 @@ code = '''
defines.COUNT = 5
defines.SIZE = [4, 32, 512, 8192]
defines.CHUNK = 2
if = 'LFS_VERSION_MAJOR == LFSP_VERSION_MAJOR'
if = 'LFS_DISK_VERSION_MAJOR == LFSP_DISK_VERSION_MAJOR'
code = '''
// create the previous version
struct lfsp_config cfgp;
Expand Down Expand Up @@ -677,7 +674,7 @@ code = '''

# test we can mount in an old version
[cases.test_compat_backward_mount]
if = 'LFS_VERSION == LFSP_VERSION'
if = 'LFS_DISK_VERSION == LFSP_DISK_VERSION'
code = '''
// create the new version
lfs_t lfs;
Expand All @@ -704,7 +701,7 @@ code = '''
# test we can read dirs in an old version
[cases.test_compat_backward_read_dirs]
defines.COUNT = 5
if = 'LFS_VERSION == LFSP_VERSION'
if = 'LFS_DISK_VERSION == LFSP_DISK_VERSION'
code = '''
// create the new version
lfs_t lfs;
Expand Down Expand Up @@ -761,7 +758,7 @@ code = '''
defines.COUNT = 5
defines.SIZE = [4, 32, 512, 8192]
defines.CHUNK = 4
if = 'LFS_VERSION == LFSP_VERSION'
if = 'LFS_DISK_VERSION == LFSP_DISK_VERSION'
code = '''
// create the new version
lfs_t lfs;
Expand Down Expand Up @@ -848,7 +845,7 @@ code = '''
defines.COUNT = 5
defines.SIZE = [4, 32, 512, 8192]
defines.CHUNK = 4
if = 'LFS_VERSION == LFSP_VERSION'
if = 'LFS_DISK_VERSION == LFSP_DISK_VERSION'
code = '''
// create the new version
lfs_t lfs;
Expand Down Expand Up @@ -960,7 +957,7 @@ code = '''
# test we can write dirs in an old version
[cases.test_compat_backward_write_dirs]
defines.COUNT = 10
if = 'LFS_VERSION == LFSP_VERSION'
if = 'LFS_DISK_VERSION == LFSP_DISK_VERSION'
code = '''
// create the new version
lfs_t lfs;
Expand Down Expand Up @@ -1024,7 +1021,7 @@ code = '''
defines.COUNT = 5
defines.SIZE = [4, 32, 512, 8192]
defines.CHUNK = 2
if = 'LFS_VERSION == LFSP_VERSION'
if = 'LFS_DISK_VERSION == LFSP_DISK_VERSION'
code = '''
// create the previous version
lfs_t lfs;
Expand Down Expand Up @@ -1143,7 +1140,7 @@ code = '''
defines.COUNT = 5
defines.SIZE = [4, 32, 512, 8192]
defines.CHUNK = 2
if = 'LFS_VERSION == LFSP_VERSION'
if = 'LFS_DISK_VERSION == LFSP_DISK_VERSION'
code = '''
// create the previous version
lfs_t lfs;
Expand Down

0 comments on commit fdee127

Please sign in to comment.