diff mbox series

[v2,1/3] string: Remove c_strstr from test-strstr

Message ID 20240220200445.4000158-2-adhemerval.zanella@linaro.org
State New
Headers show
Series Improve wcsstr | expand

Commit Message

Adhemerval Zanella Netto Feb. 20, 2024, 8:04 p.m. UTC
There is no much point is checking the generic code if this is not
really used by libc.
---
 string/test-strstr.c | 6 ------
 1 file changed, 6 deletions(-)

Comments

DJ Delorie Feb. 27, 2024, 4:42 a.m. UTC | #1
Adhemerval Zanella <adhemerval.zanella@linaro.org> writes:
> There is no much point is checking the generic code if this is not
> really used by libc.

The point isn't to test the generic code, it's to validate the test.
Without such, you get a "pass" as long as the test and the code are both
broken in compatible ways.

Every test should have this kind of "baseline" check to make sure the
test is operating corectly, and so that any failures can be shown to be
failures in implementation, and not failures in the test itself.
Adhemerval Zanella Netto Feb. 27, 2024, 12:11 p.m. UTC | #2
On 27/02/24 01:42, DJ Delorie wrote:
> Adhemerval Zanella <adhemerval.zanella@linaro.org> writes:
>> There is no much point is checking the generic code if this is not
>> really used by libc.
> 
> The point isn't to test the generic code, it's to validate the test.
> Without such, you get a "pass" as long as the test and the code are both
> broken in compatible ways.
> 
> Every test should have this kind of "baseline" check to make sure the
> test is operating corectly, and so that any failures can be shown to be
> failures in implementation, and not failures in the test itself.
> 

Fair enough, it would waste some time if the system uses the generic
implementation (since it testing twice) but I guess it make sense for
architecture that implement it with a different/optimized version.
diff mbox series

Patch

diff --git a/string/test-strstr.c b/string/test-strstr.c
index 4115f7d2fd..05d0b7c98c 100644
--- a/string/test-strstr.c
+++ b/string/test-strstr.c
@@ -21,11 +21,6 @@ 
 #include "test-string.h"
 
 
-#define STRSTR c_strstr
-#define libc_hidden_builtin_def(arg) /* nothing */
-#define __strnlen strnlen
-#include "strstr.c"
-
 /* Naive implementation to verify results.  */
 static char *
 simple_strstr (const char *s1, const char *s2)
@@ -52,7 +47,6 @@  simple_strstr (const char *s1, const char *s2)
 
 typedef char *(*proto_t) (const char *, const char *);
 
-IMPL (c_strstr, 0)
 IMPL (strstr, 1)