From 4b717562c4768883a87f62d67610c0a48e911445 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Tue, 19 Mar 2024 10:15:27 -0300 Subject: wcsmbs: Add test-wcsstr Parametrize test-strstr.c so it can be used to check wcsstr. Checked on x86_64-linux-gnu and aarch64-linux-gnu. Reviewed-by: DJ Delorie --- wcsmbs/Makefile | 1 + wcsmbs/test-wcsstr.c | 20 ++++++++++++++++++++ wcsmbs/wcsstr.c | 6 +++++- 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 wcsmbs/test-wcsstr.c (limited to 'wcsmbs') diff --git a/wcsmbs/Makefile b/wcsmbs/Makefile index f3333c6a4b..1cddd8cc6d 100644 --- a/wcsmbs/Makefile +++ b/wcsmbs/Makefile @@ -163,6 +163,7 @@ tests := \ test-wcspbrk \ test-wcsrchr \ test-wcsspn \ + test-wcsstr \ test-wmemchr \ test-wmemcmp \ test-wmemset \ diff --git a/wcsmbs/test-wcsstr.c b/wcsmbs/test-wcsstr.c new file mode 100644 index 0000000000..23d6517255 --- /dev/null +++ b/wcsmbs/test-wcsstr.c @@ -0,0 +1,20 @@ +/* Test wcsstr function. + Copyright (C) 2024 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#define WIDE 1 +#include diff --git a/wcsmbs/wcsstr.c b/wcsmbs/wcsstr.c index 78f1cc9ce0..b49630c1cf 100644 --- a/wcsmbs/wcsstr.c +++ b/wcsmbs/wcsstr.c @@ -28,8 +28,12 @@ #include +#ifndef WCSSTR +# define WCSSTR wcsstr +#endif + wchar_t * -wcsstr (const wchar_t *haystack, const wchar_t *needle) +WCSSTR (const wchar_t *haystack, const wchar_t *needle) { wchar_t b, c; -- cgit 1.4.1