summaryrefslogtreecommitdiff
path: root/fs/smb/client/smb2maperror_test.c
AgeCommit message (Collapse)Author
2026-04-05smb/client: move smb2maperror declarations to smb2proto.hZhangGuoDong
For `smb2_error_map_table_test` and `smb2_error_map_num`, if their types are changed in `smb2maperror.c` but the corresponding extern declarations in `smb2maperror_test.c` are not updated, the compiler will not report an error. Moving them to a common header file allows the compiler to catch type mismatches. Signed-off-by: ZhangGuoDong <zhangguodong@kylinos.cn> Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: Steve French <stfrench@microsoft.com>
2026-04-05smb/client: avoid null-ptr-deref when tests fail in test_cmp_map()SunJianHao
Use KUNIT_ASSERT_NOT_NULL() to abort the test cases on failure. Reported-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: SunJianHao <24031212195@stu.xidian.edu.cn> Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: Steve French <stfrench@microsoft.com>
2026-03-01smb/client: make SMB2 maperror KUnit tests a separate moduleChenXiaoSong
Build the SMB2 maperror KUnit tests as `smb2maperror_test.ko`. Link: https://lore.kernel.org/linux-cifs/20260210081040.4156383-1-geert@linux-m68k.org/ Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Paulo Alcantara (Red Hat) <pc@manguebit.org> Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: Steve French <stfrench@microsoft.com>
2026-02-08smb/client: introduce KUnit test to check search result of smb2_error_map_tableChenXiaoSong
The KUnit test are executed when cifs.ko is loaded. Just like `fs/ext4/mballoc.c` includes `fs/ext4/mballoc-test.c`. `smb2maperror.c` also includes `smb2maperror_test.c`, allowing KUnit tests to access any functions and variables in `smb2maperror.c`. The maperror_test_check_search() checks whether all elements can be correctly found in the array. Suggested-by: David Howells <dhowells@redhat.com> Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: Steve French <stfrench@microsoft.com>