|
12 | 12 | #include <kunit/test.h> |
13 | 13 | #include "smb1proto.h" |
14 | 14 | #include "nterr.h" |
| 15 | +#include "smberr.h" |
15 | 16 |
|
16 | 17 | #define DEFINE_CHECK_SEARCH_FUNC(__struct_name, __field, \ |
17 | 18 | __array, __num) \ |
@@ -39,12 +40,29 @@ test_cmp_ntstatus_to_dos_err(struct kunit *test, |
39 | 40 | KUNIT_EXPECT_STREQ(test, expect->nt_errstr, result->nt_errstr); |
40 | 41 | } |
41 | 42 |
|
| 43 | +static void |
| 44 | +test_cmp_smb_to_posix_error(struct kunit *test, |
| 45 | + const struct smb_to_posix_error *expect, |
| 46 | + const struct smb_to_posix_error *result) |
| 47 | +{ |
| 48 | + KUNIT_EXPECT_EQ(test, expect->smb_err, result->smb_err); |
| 49 | + KUNIT_EXPECT_EQ(test, expect->posix_code, result->posix_code); |
| 50 | +} |
| 51 | + |
42 | 52 | /* check_search_ntstatus_to_dos_map */ |
43 | 53 | DEFINE_CHECK_SEARCH_FUNC(ntstatus_to_dos_err, ntstatus, ntstatus_to_dos_map, |
44 | 54 | ntstatus_to_dos_num); |
| 55 | +/* check_search_mapping_table_ERRDOS */ |
| 56 | +DEFINE_CHECK_SEARCH_FUNC(smb_to_posix_error, smb_err, mapping_table_ERRDOS, |
| 57 | + mapping_table_ERRDOS_num); |
| 58 | +/* check_search_mapping_table_ERRSRV */ |
| 59 | +DEFINE_CHECK_SEARCH_FUNC(smb_to_posix_error, smb_err, mapping_table_ERRSRV, |
| 60 | + mapping_table_ERRSRV_num); |
45 | 61 |
|
46 | 62 | static struct kunit_case maperror_test_cases[] = { |
47 | 63 | KUNIT_CASE(check_search_ntstatus_to_dos_map), |
| 64 | + KUNIT_CASE(check_search_mapping_table_ERRDOS), |
| 65 | + KUNIT_CASE(check_search_mapping_table_ERRSRV), |
48 | 66 | {} |
49 | 67 | }; |
50 | 68 |
|
|
0 commit comments