diff options
author | CismonX <admin@cismon.net> | 2025-08-19 08:05:45 +0800 |
---|---|---|
committer | Bernd Schubert <bernd@bsbernd.com> | 2025-08-19 16:21:24 +0200 |
commit | a63fc71a55038f49671eb56d0ade99a48ad8d7ab (patch) | |
tree | fdfda549997183bcc9b8cddd90b30bdeffe0d230 /test | |
parent | 42b9b3bbb71d38be6a5670bbd0948cf406c1573c (diff) | |
download | libfuse-a63fc71a55038f49671eb56d0ade99a48ad8d7ab.tar.gz |
tests: move struct size assertions into a test
These checks are meant for libfuse maintainers only,
and should not be exposed to users.
Signed-off-by: CismonX <admin@cismon.net>
Diffstat (limited to 'test')
-rw-r--r-- | test/meson.build | 3 | ||||
-rw-r--r-- | test/test_abi.c | 18 | ||||
-rw-r--r-- | test/test_ctests.py | 4 |
3 files changed, 25 insertions, 0 deletions
diff --git a/test/meson.build b/test/meson.build index 3329216..9f6f409 100644 --- a/test/meson.build +++ b/test/meson.build @@ -22,6 +22,9 @@ td += executable('test_want_conversion', 'test_want_conversion.c', td += executable('test_signals', 'test_signals.c', dependencies: [ libfuse_dep, thread_dep ], install: false) +td += executable('test_abi', 'test_abi.c', + dependencies: [ libfuse_dep ], + install: false) test_scripts = [ 'conftest.py', 'pytest.ini', 'test_examples.py', 'util.py', 'test_ctests.py', 'test_custom_io.py' ] diff --git a/test/test_abi.c b/test/test_abi.c new file mode 100644 index 0000000..99daa09 --- /dev/null +++ b/test/test_abi.c @@ -0,0 +1,18 @@ +#define FUSE_USE_VERSION 30 + +#include "fuse.h" + +#include <stdio.h> +#include <stdlib.h> + +int main(void) +{ + if (sizeof(struct fuse_file_info) != 64) { + fprintf(stderr, "struct fuse_file_info size mismatch\n"); + exit(1); + } + if (sizeof(struct fuse_conn_info) != 128) { + fprintf(stderr, "struct fuse_conn_info size mismatch\n"); + exit(1); + } +} diff --git a/test/test_ctests.py b/test/test_ctests.py index ae5cc8f..b3863e0 100644 --- a/test/test_ctests.py +++ b/test/test_ctests.py @@ -20,6 +20,10 @@ import os.path pytestmark = fuse_test_marker() +def test_abi(): + cmdline = [ pjoin(basename, 'test', 'test_abi') ] + subprocess.check_call(cmdline) + @pytest.mark.skipif('FUSE_CAP_WRITEBACK_CACHE' not in fuse_caps, reason='not supported by running kernel') @pytest.mark.parametrize("writeback", (False, True)) |