@@ -20,57 +20,57 @@ static void damon_dbgfs_test_str_to_target_ids(struct kunit *test)
20
20
ssize_t nr_integers = 0 , i ;
21
21
22
22
question = "123" ;
23
- answers = str_to_target_ids (question , strnlen (question , 128 ),
23
+ answers = str_to_target_ids (question , strlen (question ),
24
24
& nr_integers );
25
25
KUNIT_EXPECT_EQ (test , (ssize_t )1 , nr_integers );
26
26
KUNIT_EXPECT_EQ (test , 123ul , answers [0 ]);
27
27
kfree (answers );
28
28
29
29
question = "123abc" ;
30
- answers = str_to_target_ids (question , strnlen (question , 128 ),
30
+ answers = str_to_target_ids (question , strlen (question ),
31
31
& nr_integers );
32
32
KUNIT_EXPECT_EQ (test , (ssize_t )1 , nr_integers );
33
33
KUNIT_EXPECT_EQ (test , 123ul , answers [0 ]);
34
34
kfree (answers );
35
35
36
36
question = "a123" ;
37
- answers = str_to_target_ids (question , strnlen (question , 128 ),
37
+ answers = str_to_target_ids (question , strlen (question ),
38
38
& nr_integers );
39
39
KUNIT_EXPECT_EQ (test , (ssize_t )0 , nr_integers );
40
40
kfree (answers );
41
41
42
42
question = "12 35" ;
43
- answers = str_to_target_ids (question , strnlen (question , 128 ),
43
+ answers = str_to_target_ids (question , strlen (question ),
44
44
& nr_integers );
45
45
KUNIT_EXPECT_EQ (test , (ssize_t )2 , nr_integers );
46
46
for (i = 0 ; i < nr_integers ; i ++ )
47
47
KUNIT_EXPECT_EQ (test , expected [i ], answers [i ]);
48
48
kfree (answers );
49
49
50
50
question = "12 35 46" ;
51
- answers = str_to_target_ids (question , strnlen (question , 128 ),
51
+ answers = str_to_target_ids (question , strlen (question ),
52
52
& nr_integers );
53
53
KUNIT_EXPECT_EQ (test , (ssize_t )3 , nr_integers );
54
54
for (i = 0 ; i < nr_integers ; i ++ )
55
55
KUNIT_EXPECT_EQ (test , expected [i ], answers [i ]);
56
56
kfree (answers );
57
57
58
58
question = "12 35 abc 46" ;
59
- answers = str_to_target_ids (question , strnlen (question , 128 ),
59
+ answers = str_to_target_ids (question , strlen (question ),
60
60
& nr_integers );
61
61
KUNIT_EXPECT_EQ (test , (ssize_t )2 , nr_integers );
62
62
for (i = 0 ; i < 2 ; i ++ )
63
63
KUNIT_EXPECT_EQ (test , expected [i ], answers [i ]);
64
64
kfree (answers );
65
65
66
66
question = "" ;
67
- answers = str_to_target_ids (question , strnlen (question , 128 ),
67
+ answers = str_to_target_ids (question , strlen (question ),
68
68
& nr_integers );
69
69
KUNIT_EXPECT_EQ (test , (ssize_t )0 , nr_integers );
70
70
kfree (answers );
71
71
72
72
question = "\n" ;
73
- answers = str_to_target_ids (question , strnlen (question , 128 ),
73
+ answers = str_to_target_ids (question , strlen (question ),
74
74
& nr_integers );
75
75
KUNIT_EXPECT_EQ (test , (ssize_t )0 , nr_integers );
76
76
kfree (answers );
0 commit comments