lkml.org 
[lkml]   [2024]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/5] string: Prepare to merge strcat KUnit tests into string_kunit.c
Date
The test naming convention differs between string_kunit.c and
strcat_kunit.c. Move "test" to the beginning of the function name.

Signed-off-by: Kees Cook <keescook@chromium.org>
---
Cc: Andy Shevchenko <andy@kernel.org>
Cc: Ivan Orlov <ivan.orlov0322@gmail.com>
Cc: linux-hardening@vger.kernel.org
---
lib/strcat_kunit.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/strcat_kunit.c b/lib/strcat_kunit.c
index e21be95514af..ca09f7f0e6a2 100644
--- a/lib/strcat_kunit.c
+++ b/lib/strcat_kunit.c
@@ -10,7 +10,7 @@

static volatile int unconst;

-static void strcat_test(struct kunit *test)
+static void test_strcat(struct kunit *test)
{
char dest[8];

@@ -29,7 +29,7 @@ static void strcat_test(struct kunit *test)
KUNIT_EXPECT_STREQ(test, dest, "fourAB");
}

-static void strncat_test(struct kunit *test)
+static void test_strncat(struct kunit *test)
{
char dest[8];

@@ -56,7 +56,7 @@ static void strncat_test(struct kunit *test)
KUNIT_EXPECT_STREQ(test, dest, "fourAB");
}

-static void strlcat_test(struct kunit *test)
+static void test_strlcat(struct kunit *test)
{
char dest[8] = "";
int len = sizeof(dest) + unconst;
@@ -88,9 +88,9 @@ static void strlcat_test(struct kunit *test)
}

static struct kunit_case strcat_test_cases[] = {
- KUNIT_CASE(strcat_test),
- KUNIT_CASE(strncat_test),
- KUNIT_CASE(strlcat_test),
+ KUNIT_CASE(test_strcat),
+ KUNIT_CASE(test_strncat),
+ KUNIT_CASE(test_strlcat),
{}
};

--
2.34.1

\
 
 \ /
  Last update: 2024-05-27 16:47    [W:5.898 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site