Commit 6e4ef142 authored by Kees Cook's avatar Kees Cook

string: Prepare to merge strcat KUnit tests into string_kunit.c

The test naming convention differs between string_kunit.c and
strcat_kunit.c. Move "test" to the beginning of the function name.
Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Tested-by: default avatarIvan Orlov <ivan.orlov0322@gmail.com>
Link: https://lore.kernel.org/r/20240419140155.3028912-3-keescook@chromium.orgSigned-off-by: default avatarKees Cook <keescook@chromium.org>
parent bb8d9b74
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
static volatile int unconst; static volatile int unconst;
static void strcat_test(struct kunit *test) static void test_strcat(struct kunit *test)
{ {
char dest[8]; char dest[8];
...@@ -29,7 +29,7 @@ static void strcat_test(struct kunit *test) ...@@ -29,7 +29,7 @@ static void strcat_test(struct kunit *test)
KUNIT_EXPECT_STREQ(test, dest, "fourAB"); KUNIT_EXPECT_STREQ(test, dest, "fourAB");
} }
static void strncat_test(struct kunit *test) static void test_strncat(struct kunit *test)
{ {
char dest[8]; char dest[8];
...@@ -56,7 +56,7 @@ static void strncat_test(struct kunit *test) ...@@ -56,7 +56,7 @@ static void strncat_test(struct kunit *test)
KUNIT_EXPECT_STREQ(test, dest, "fourAB"); KUNIT_EXPECT_STREQ(test, dest, "fourAB");
} }
static void strlcat_test(struct kunit *test) static void test_strlcat(struct kunit *test)
{ {
char dest[8] = ""; char dest[8] = "";
int len = sizeof(dest) + unconst; int len = sizeof(dest) + unconst;
...@@ -88,9 +88,9 @@ static void strlcat_test(struct kunit *test) ...@@ -88,9 +88,9 @@ static void strlcat_test(struct kunit *test)
} }
static struct kunit_case strcat_test_cases[] = { static struct kunit_case strcat_test_cases[] = {
KUNIT_CASE(strcat_test), KUNIT_CASE(test_strcat),
KUNIT_CASE(strncat_test), KUNIT_CASE(test_strncat),
KUNIT_CASE(strlcat_test), KUNIT_CASE(test_strlcat),
{} {}
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment