From 86b4bf7d3194a06281f053be341031d9196874c2 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Wed, 24 Nov 2010 20:51:46 +0100 Subject: wchar: bug #1471: fix cornercase in mbrtowc Signed-off-by: Bernhard Reutner-Fischer --- test/locale-mbwc/tst2_mbrtowc.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/locale-mbwc/tst2_mbrtowc.c (limited to 'test/locale-mbwc/tst2_mbrtowc.c') diff --git a/test/locale-mbwc/tst2_mbrtowc.c b/test/locale-mbwc/tst2_mbrtowc.c new file mode 100644 index 000000000..92e12838c --- /dev/null +++ b/test/locale-mbwc/tst2_mbrtowc.c @@ -0,0 +1,21 @@ +#include +#include +#include + +/* bugs.uclibc.org/1471 : make sure output is 0 */ +static int +do_test(void) +{ + wchar_t output; + int result; + + output = L'A'; /* anything other than 0 will do... */ + result = mbrtowc (&output, "", 1, 0); + + assert (result == 0); + assert (output == 0); + + return EXIT_SUCCESS; +} +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" -- cgit v1.2.3