This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] Update wcsmbs tests to use the support test driver.
- From: Wainer dos Santos Moschetta <wainersm at linux dot vnet dot ibm dot com>
- To: libc-alpha at sourceware dot org
- Date: Wed, 29 Mar 2017 10:59:20 -0300
- Subject: [PATCH] Update wcsmbs tests to use the support test driver.
- Authentication-results: sourceware.org; auth=none
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;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
diff --git a/wcsmbs/tst-mbrtowc2.c b/wcsmbs/tst-mbrtowc2.c
index 67d8e29..cc5d561 100644
--- a/wcsmbs/tst-mbrtowc2.c
+++ b/wcsmbs/tst-mbrtowc2.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>
diff --git a/wcsmbs/tst-mbsrtowcs.c b/wcsmbs/tst-mbsrtowcs.c
index bed76bf..6b41469 100644
--- a/wcsmbs/tst-mbsrtowcs.c
+++ b/wcsmbs/tst-mbsrtowcs.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>
diff --git a/wcsmbs/tst-wchar-h.c b/wcsmbs/tst-wchar-h.c
index fd2ad56..bc4ddf2 100644
--- a/wcsmbs/tst-wchar-h.c
+++ b/wcsmbs/tst-wchar-h.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>
diff --git a/wcsmbs/tst-wcpncpy.c b/wcsmbs/tst-wcpncpy.c
index 17a31fb..5ed15d6 100644
--- a/wcsmbs/tst-wcpncpy.c
+++ b/wcsmbs/tst-wcpncpy.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>
diff --git a/wcsmbs/tst-wcrtomb.c b/wcsmbs/tst-wcrtomb.c
index 052a254..4aa47c6 100644
--- a/wcsmbs/tst-wcrtomb.c
+++ b/wcsmbs/tst-wcrtomb.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>
diff --git a/wcsmbs/tst-wcsnlen.c b/wcsmbs/tst-wcsnlen.c
index e057885..42b9632 100644
--- a/wcsmbs/tst-wcsnlen.c
+++ b/wcsmbs/tst-wcsnlen.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>
diff --git a/wcsmbs/tst-wcstof.c b/wcsmbs/tst-wcstof.c
index d3d75f8..8c4d830 100644
--- a/wcsmbs/tst-wcstof.c
+++ b/wcsmbs/tst-wcstof.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>
--
2.9.3