diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2002-10-18 23:39:07 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2002-10-18 23:39:07 +0000 |
commit | 978ea3cf1c7b0e06791df78ade33d3c8201d7a15 (patch) | |
tree | 5822b82f02041e5961bcac7ad9aea09a61786777 /newlib | |
parent | a42cf80a9d49ee5101f3ef09b10ebe4c4094a465 (diff) | |
download | cygnal-978ea3cf1c7b0e06791df78ade33d3c8201d7a15.tar.gz cygnal-978ea3cf1c7b0e06791df78ade33d3c8201d7a15.tar.bz2 cygnal-978ea3cf1c7b0e06791df78ade33d3c8201d7a15.zip |
2002-10-18 Jeff Johnston <jjohnstn@redhat.com>
* testsuite/newlib.wctype/tiswctype.c: New test case.
* testsuite/newlib.wctype/twctrans.c: Ditto.
Diffstat (limited to 'newlib')
-rw-r--r-- | newlib/ChangeLog | 5 | ||||
-rw-r--r-- | newlib/testsuite/newlib.wctype/tiswctype.c | 61 | ||||
-rw-r--r-- | newlib/testsuite/newlib.wctype/twctrans.c | 23 |
3 files changed, 89 insertions, 0 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 46616f35e..6bf29c493 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,5 +1,10 @@ 2002-10-18 Jeff Johnston <jjohnstn@redhat.com> + * testsuite/newlib.wctype/tiswctype.c: New test case. + * testsuite/newlib.wctype/twctrans.c: Ditto. + +2002-10-18 Jeff Johnston <jjohnstn@redhat.com> + * libc/sys/linux/machine/i386/include/endian.h: New file. * libc/sys/linux/machine/i386/include/param.h: Ditto. diff --git a/newlib/testsuite/newlib.wctype/tiswctype.c b/newlib/testsuite/newlib.wctype/tiswctype.c new file mode 100644 index 000000000..da48fbb77 --- /dev/null +++ b/newlib/testsuite/newlib.wctype/tiswctype.c @@ -0,0 +1,61 @@ +#include <wctype.h> +#include <newlib.h> +#include "check.h" + +int main() +{ + wctype_t x; + + x = wctype ("alpha"); + CHECK (x != 0); + CHECK (iswctype (L'a', x) && isalpha ('a')); + + x = wctype ("alnum"); + CHECK (x != 0); + CHECK (iswctype (L'0', x) && isalnum ('0')); + + x = wctype ("blank"); + CHECK (x != 0); + CHECK (iswctype (L' ', x) && isblank (' ')); + + x = wctype ("cntrl"); + CHECK (x != 0); + CHECK (iswctype (L'\n', x) && iscntrl ('\n')); + + x = wctype ("digit"); + CHECK (x != 0); + CHECK (iswctype (L'7', x) && isdigit ('7')); + + x = wctype ("graph"); + CHECK (x != 0); + CHECK (iswctype (L'!', x) && isgraph ('!')); + + x = wctype ("lower"); + CHECK (x != 0); + CHECK (iswctype (L'k', x) && islower ('k')); + + x = wctype ("print"); + CHECK (x != 0); + CHECK (iswctype (L'@', x) && isprint ('@')); + + x = wctype ("punct"); + CHECK (x != 0); + CHECK (iswctype (L'.', x) && ispunct ('.')); + + x = wctype ("space"); + CHECK (x != 0); + CHECK (iswctype (L'\t', x) && isspace ('\t')); + + x = wctype ("upper"); + CHECK (x != 0); + CHECK (iswctype (L'T', x) && isupper ('T')); + + x = wctype ("xdigit"); + CHECK (x != 0); + CHECK (iswctype (L'B', x) && isxdigit ('B')); + + x = wctype ("unknown"); + CHECK (x == 0); + + exit (0); +} diff --git a/newlib/testsuite/newlib.wctype/twctrans.c b/newlib/testsuite/newlib.wctype/twctrans.c new file mode 100644 index 000000000..a70e00175 --- /dev/null +++ b/newlib/testsuite/newlib.wctype/twctrans.c @@ -0,0 +1,23 @@ +#include <wctype.h> +#include <newlib.h> +#include "check.h" + +int main() +{ + wctrans_t x; + + x = wctrans ("tolower"); + CHECK (x != 0); + CHECK (towctrans (L'A', x) == tolower ('A')); + CHECK (towctrans (L'5', x) == tolower ('5')); + + x = wctrans ("toupper"); + CHECK (x != 0); + CHECK (towctrans (L'c', x) == toupper ('c')); + CHECK (towctrans (L'9', x) == toupper ('9')); + + x = wctrans ("unknown"); + CHECK (x == 0); + + exit (0); +} |