Ivan Orlov
5570ca9719
string_kunit: Add test cases for str*cmp functions
...
[ Upstream commit 9259a4721699947ceb397037991c0e4acc496b21 ]
Currently, str*cmp functions (strcmp, strncmp, strcasecmp and
strncasecmp) are not covered with tests. Extend the `string_kunit.c`
test by adding the test cases for them.
This patch adds 8 more test cases:
1) strcmp test
2) strcmp test on long strings (2048 chars)
3) strncmp test
4) strncmp test on long strings (2048 chars)
5) strcasecmp test
6) strcasecmp test on long strings
7) strncasecmp test
8) strncasecmp test on long strings
These test cases aim at covering as many edge cases as possible,
including the tests on empty strings, situations when the different
symbol is placed at the end of one of the strings, etc.
Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20240417233033.717596-1-ivan.orlov0322@gmail.com
Signed-off-by: Kees Cook <keescook@chromium.org>
Stable-dep-of: 5bb288c4abc2 ("scsi: mptfusion: Avoid possible run-time warning with long manufacturer strings")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-06-12 11:39:30 +02:00
..
2023-12-22 12:30:19 +08:00
2023-05-09 11:06:45 +02:00
2024-03-22 10:09:08 -07:00
2024-05-30 09:44:32 +02:00
2022-07-17 17:31:39 -07:00
2022-07-29 18:12:34 -07:00
2024-03-12 13:09:22 -07:00
2023-04-13 13:13:53 -07:00
2024-03-14 18:03:09 -07:00
2022-11-18 02:15:15 +01:00
2024-01-19 11:59:11 -08:00
2023-03-21 21:15:34 +01:00
2023-09-11 08:13:17 +00:00
2023-02-27 17:00:14 -08:00
2023-02-02 22:50:10 -08:00
2023-02-02 22:50:09 -08:00
2023-11-14 17:12:52 -08:00
2022-04-26 17:58:51 -04:00
2023-09-19 13:21:33 -07:00
2020-11-18 14:15:17 -06:00
2022-01-20 08:52:55 +02:00
2024-03-12 13:09:23 -07:00
2021-12-13 10:56:09 +01:00
2021-10-01 16:52:48 -04:00
2022-08-02 17:14:47 -06:00
2023-08-18 10:18:58 -07:00
2020-10-16 13:25:14 -06:00
2023-10-14 20:25:22 -07:00
2024-02-01 13:06:40 +01:00
2022-04-26 17:58:51 -04:00
2024-04-18 05:01:32 +09:00
2023-04-13 13:13:54 -07:00
2023-01-31 15:01:45 +01:00
2024-03-14 18:03:09 -07:00
2022-09-01 16:55:35 +02:00
2024-04-08 11:03:05 +01:00
2023-11-24 00:29:58 -05:00
2023-08-25 13:22:10 -07:00
2024-02-27 15:25:56 -07:00
2022-09-11 21:55:06 -07:00
2021-10-01 16:52:48 -04:00
2023-06-07 21:25:00 -07:00
2023-03-05 14:30:34 -08:00
2023-11-03 07:08:36 -10:00
2021-01-21 14:06:00 -07:00
2021-05-06 19:24:12 -07:00
2022-01-31 11:21:43 +11:00
2022-01-31 11:21:43 +11:00
2022-03-07 12:48:35 -07:00
2022-03-07 12:48:35 -07:00
2023-12-29 12:22:26 -08:00
2022-06-07 10:27:38 +02:00
2021-08-19 09:02:55 +09:00
2021-06-22 13:56:43 +02:00
2023-11-22 10:41:46 +01:00
2023-01-31 20:37:18 +01:00
2021-07-01 11:06:05 -07:00
2023-06-09 17:44:17 -07:00
2021-07-01 11:06:06 -07:00
2021-05-06 19:24:12 -07:00
2021-07-01 11:06:06 -07:00
2023-09-11 08:13:17 +00:00
2023-06-09 17:44:17 -07:00
2023-06-09 17:44:15 -07:00
2024-02-12 10:36:17 -06:00
2024-02-22 15:38:52 -08:00
2023-02-02 22:50:01 -08:00
2024-02-22 15:38:52 -08:00
2023-02-02 22:50:01 -08:00
2020-11-20 14:45:33 +11:00
2024-02-07 17:23:19 +01:00
2024-04-30 09:20:48 +02:00
2024-03-08 10:23:26 +00:00
2022-09-11 21:55:10 -07:00
2023-11-25 09:43:18 +01:00
2023-08-18 10:18:55 -07:00
2020-12-15 22:46:15 -08:00
2021-01-03 20:05:18 -05:00
2020-10-16 11:11:22 -07:00
2023-04-13 07:38:54 -06:00
2022-11-18 02:15:15 +01:00
2023-03-19 10:02:04 -07:00
2024-02-22 15:38:52 -08:00
2024-05-30 09:44:09 +02:00
2024-03-13 00:03:21 -07:00
2022-03-07 12:48:35 -07:00
2023-08-30 17:04:28 -07:00
2024-03-13 21:22:26 -04:00
2022-04-29 14:38:01 -07:00
2023-12-06 16:12:46 -08:00
2023-02-08 14:28:17 -07:00
2022-04-27 10:57:33 -07:00
2023-12-21 10:02:28 -08:00
2022-11-29 16:34:15 -04:00
2022-10-03 14:03:21 -07:00
2024-03-11 09:38:17 -07:00
2022-04-13 21:32:21 +02:00
2022-11-19 00:56:15 +01:00
2021-08-19 09:02:55 +09:00
2024-02-12 10:35:40 -06:00
2024-04-05 15:12:47 +02:00
2024-02-22 15:38:51 -08:00
2023-02-25 13:02:20 -08:00
2023-12-05 11:14:40 +01:00
2024-01-27 19:03:51 -08:00
2023-12-05 11:14:40 +01:00
2024-03-18 11:24:14 -07:00
2021-07-08 11:48:20 -07:00
2024-02-17 16:20:41 +01:00
2024-02-08 16:39:25 +00:00
2023-08-21 13:46:25 -07:00
2021-05-19 15:05:11 +02:00
2023-09-09 15:11:49 -07:00
2023-04-17 18:01:23 +02:00
2021-08-13 18:37:38 +02:00
2023-08-15 14:57:25 -07:00
2021-07-08 11:48:20 -07:00
2023-03-31 09:21:35 -06:00
2023-10-16 12:44:06 -04:00
2023-07-26 12:29:13 +02:00
2023-01-13 14:35:38 -06:00
2022-03-11 10:42:56 +01:00
2023-08-24 16:20:18 -07:00
2022-11-22 19:38:39 -07:00
2023-10-16 12:44:06 -04:00
2024-03-14 10:58:27 -07:00
2024-05-05 17:28:05 -07:00
2024-03-18 11:24:15 -07:00
2020-09-26 10:33:57 -07:00
2023-06-06 13:18:32 +02:00
2024-02-22 19:01:55 -08:00
2023-08-18 10:19:00 -07:00
2023-08-18 10:18:55 -07:00
2021-12-24 14:54:29 -08:00
2023-12-01 14:53:55 +09:00
2022-11-18 13:55:06 -08:00
2022-10-03 17:34:32 -07:00
2024-03-22 16:25:31 -07:00
2023-03-09 23:08:04 -08:00
2021-04-16 16:10:37 -07:00
2023-03-02 21:54:22 -08:00
2023-10-18 14:34:14 -07:00
2022-11-30 13:16:40 -08:00
2022-05-22 11:32:30 -07:00
2023-08-21 13:07:22 -07:00
2023-06-12 11:31:50 -07:00
2022-10-11 17:42:58 -06:00
2022-08-24 13:46:57 +01:00
2023-04-18 16:39:33 -07:00
2023-10-10 10:14:27 +02:00
2023-06-05 15:28:42 -07:00
2021-07-08 11:48:20 -07:00
2022-12-09 10:42:56 +00:00
2024-01-15 07:23:50 -07:00
2024-04-26 12:35:57 -07:00
2024-02-15 12:17:28 -05:00
2022-09-23 16:46:19 +02:00
2022-11-01 10:04:52 -07:00
2022-06-03 10:34:34 -07:00
2024-05-30 09:44:04 +02:00
2022-07-17 17:31:41 -07:00
2024-02-22 15:38:52 -08:00
2024-04-24 19:34:26 -07:00
2024-03-14 18:03:09 -07:00
2023-05-16 14:08:02 -07:00
2024-03-05 01:55:28 -08:00
2024-02-29 22:34:42 -08:00
2024-06-12 11:39:30 +02:00
2024-02-20 20:47:32 -08:00
2022-04-19 21:58:47 +02:00
2022-04-19 21:58:47 +02:00
2022-11-01 10:04:52 -07:00
2021-06-18 11:43:09 +02:00
2024-03-11 09:36:11 +00:00
2021-07-08 11:48:20 -07:00
2024-02-05 12:30:54 +00:00
2023-12-09 21:27:54 -08:00
2022-09-07 17:04:49 +02:00
2023-11-24 18:09:19 -08:00
2023-06-06 21:39:55 +09:00
2021-01-18 11:03:26 +01:00
2022-07-17 17:14:36 -07:00
2022-01-20 08:52:54 +02:00
2022-11-18 02:18:02 +01:00
2022-10-12 18:51:50 -07:00
2024-05-30 09:44:56 +02:00
2024-01-09 11:46:20 -08:00
2024-02-02 10:21:26 -08:00
2023-02-21 08:52:42 +09:00
2022-11-16 13:32:32 +00:00
2022-11-18 02:15:15 +01:00
2022-02-25 09:36:06 +01:00
2024-02-21 09:34:26 +01:00
2024-01-08 15:27:15 -08:00
2022-10-11 17:42:58 -06:00
2022-10-11 17:42:58 -06:00
2023-11-10 19:59:04 +09:00
2023-08-21 13:46:24 -07:00
2023-06-05 15:28:42 -07:00
2023-12-27 11:50:20 -05:00
2023-08-16 11:47:29 +02:00
2021-09-08 11:50:26 -07:00
2023-12-28 04:57:57 -08:00
2024-04-03 14:35:57 -07:00
2024-03-04 17:01:22 -08:00
2024-05-05 17:28:08 -07:00
2021-02-17 14:08:01 +01:00
2023-12-29 12:22:29 -08:00
2023-07-27 13:45:51 +02:00
2020-11-18 14:15:17 -06:00
2024-04-15 17:42:43 -07:00
2024-02-20 20:44:49 -08:00
2023-09-13 10:18:42 -07:00
2023-02-21 14:45:22 -08:00
2022-10-11 17:42:58 -06:00
2023-12-06 11:06:59 +01:00
2023-01-11 16:14:21 -08:00
2024-05-05 17:28:08 -07:00