Update wcsmbs tests to use the support test driver.
Commit Message
Replaced test-skeleton.c with support/test-driver.c and
adjusted the tests accordinly.
Checked on x86_64.
2017-03-28 Wainer dos Santos Moschetta <wainersm@linux.vnet.ibm.com>
* wcsmbs/tst-btowc.c: Import support/test-driver.c, remove
TEST_FUNCTION macro, and adjust return of do_test function.
return of do_test method.
* wcsmbs/tst-mbrtowc2.c: Likewise.
* wcsmbs/tst-mbsrtowcs.c: Likewise.
* wcsmbs/tst-wchar-h.c: Likewise.
* wcsmbs/tst-wcpncpy.c: Likewise.
* wcsmbs/tst-wcrtomb.c: Likewise.
* wcsmbs/tst-wcsnlen.c: Likewise.
* wcsmbs/tst-wcstof.c: Likewise.
---
wcsmbs/tst-btowc.c | 5 ++---
wcsmbs/tst-mbrtowc2.c | 5 ++---
wcsmbs/tst-mbsrtowcs.c | 5 ++---
wcsmbs/tst-wchar-h.c | 5 ++---
wcsmbs/tst-wcpncpy.c | 5 ++---
wcsmbs/tst-wcrtomb.c | 5 ++---
wcsmbs/tst-wcsnlen.c | 5 ++---
wcsmbs/tst-wcstof.c | 5 ++---
8 files changed, 16 insertions(+), 24 deletions(-)
Comments
LGTM with just one remark below.
On 29/03/2017 10:59, Wainer dos Santos Moschetta wrote:
> Replaced test-skeleton.c with support/test-driver.c and
> adjusted the tests accordinly.
>
> Checked on x86_64.
>
> 2017-03-28 Wainer dos Santos Moschetta <wainersm@linux.vnet.ibm.com>
>
> * wcsmbs/tst-btowc.c: Import support/test-driver.c, remove
> TEST_FUNCTION macro, and adjust return of do_test function.
> return of do_test method.
> * wcsmbs/tst-mbrtowc2.c: Likewise.
> * wcsmbs/tst-mbsrtowcs.c: Likewise.
> * wcsmbs/tst-wchar-h.c: Likewise.
> * wcsmbs/tst-wcpncpy.c: Likewise.
> * wcsmbs/tst-wcrtomb.c: Likewise.
> * wcsmbs/tst-wcsnlen.c: Likewise.
> * wcsmbs/tst-wcstof.c: Likewise.
> ---
> wcsmbs/tst-btowc.c | 5 ++---
> wcsmbs/tst-mbrtowc2.c | 5 ++---
> wcsmbs/tst-mbsrtowcs.c | 5 ++---
> wcsmbs/tst-wchar-h.c | 5 ++---
> wcsmbs/tst-wcpncpy.c | 5 ++---
> wcsmbs/tst-wcrtomb.c | 5 ++---
> wcsmbs/tst-wcsnlen.c | 5 ++---
> wcsmbs/tst-wcstof.c | 5 ++---
> 8 files changed, 16 insertions(+), 24 deletions(-)
>
> diff --git a/wcsmbs/tst-btowc.c b/wcsmbs/tst-btowc.c
> index 00c9f23..6e7d1a7 100644
> --- a/wcsmbs/tst-btowc.c
> +++ b/wcsmbs/tst-btowc.c
> @@ -74,7 +74,7 @@ eof_test (void)
>
>
> /* Test the btowc() function for a few locales with known character sets. */
> -static int
> +int
> do_test (void)
> {
> int result = 0;
> @@ -173,5 +173,4 @@ do_test (void)
> return result;
> }
As for previous tests update, there is no need to change the static modifier
on the do_test functions.
@@ -74,7 +74,7 @@ eof_test (void)
/* Test the btowc() function for a few locales with known character sets. */
-static int
+int
do_test (void)
{
int result = 0;
@@ -173,5 +173,4 @@ do_test (void)
return result;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -25,7 +25,7 @@ static struct
static int t (const char *ch, size_t nch, const char *loc);
-static int
+int
do_test (void)
{
int r = 0;
@@ -63,5 +63,4 @@ t (const char *ch, size_t nch, const char *loc)
return ret;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -21,7 +21,7 @@
#include <string.h>
#include <wchar.h>
-static int
+int
do_test (void)
{
const unsigned char buf[] = { 'a', 'b', '\0', 'c', 'd', '\0', 'e' };
@@ -63,5 +63,4 @@ do_test (void)
return result;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -1,12 +1,11 @@
#include <stdlib.h>
#include <wchar.h>
-static int
+int
do_test (void)
{
mbstate_t x;
return sizeof (x) - sizeof (mbstate_t);
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -20,7 +20,7 @@
#include <wchar.h>
-static int
+int
do_test (void)
{
int result = 0;
@@ -75,5 +75,4 @@ do_test (void)
return result;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -26,7 +26,7 @@
static int check_ascii (const char *locname);
-static int
+int
do_test (void)
{
int result = 0;
@@ -93,5 +93,4 @@ check_ascii (const char *locname)
return res != 0;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -27,7 +27,7 @@
printf ("wcsnlen (L\"%s\", %d) = %d, not %d\n", Str, Max, n, Exp); \
}
-static int
+int
do_test (void)
{
int result = 0;
@@ -49,5 +49,4 @@ do_test (void)
return result;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -5,7 +5,7 @@
#include <wctype.h>
#include <libc-diag.h>
-static int
+int
do_test (void)
{
int result = 0;
@@ -30,5 +30,4 @@ do_test (void)
return result;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>