OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /openrisc/tags/gnu-src/newlib-1.18.0/newlib-1.18.0-or32-1.0rc1/newlib/testsuite/newlib.wctype
    from Rev 207 to Rev 345
    Reverse comparison

Rev 207 → Rev 345

/twctype.c
0,0 → 1,64
#include <wctype.h>
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <newlib.h>
#include <locale.h>
#include "check.h"
 
int main()
{
#if !defined(_ELIX_LEVEL) || _ELIX_LEVEL > 1
if (_MB_LEN_MAX == 1)
{
CHECK (iswalpha(L'a'));
CHECK (!iswalpha(L'3'));
CHECK (iswalnum(L'9'));
CHECK (!iswalnum(L'$'));
CHECK (iswcntrl(L'\n'));
CHECK (!iswcntrl(L'#'));
CHECK (iswdigit(L'2'));
CHECK (!iswdigit(L'a'));
CHECK (iswgraph(L'2'));
CHECK (!iswgraph(L' '));
CHECK (iswlower(L'g'));
CHECK (!iswlower(L'G'));
CHECK (iswprint(L'*'));
CHECK (!iswprint(L'\n'));
CHECK (iswpunct(L','));
CHECK (!iswpunct(L'\n'));
CHECK (iswspace(L'\t'));
CHECK (!iswspace(L':'));
CHECK (iswupper(L'G'));
CHECK (!iswupper(L'g'));
CHECK (iswxdigit(L'A'));
CHECK (!iswxdigit(L'g'));
}
else
{
setlocale (LC_CTYPE, "C-UTF-8");
CHECK (iswalpha(0x0967));
CHECK (!iswalpha(0x128e));
CHECK (iswalnum(0x1d7ce));
CHECK (!iswalnum(0x1d800));
CHECK (iswcntrl(0x007f));
CHECK (!iswcntrl(0x2027));
CHECK (iswdigit(L'2'));
CHECK (!iswdigit(0x0009));
CHECK (iswlower(0x03b3));
CHECK (!iswlower(0x04aa));
CHECK (iswprint(0x0b13));
CHECK (!iswprint(0x0ce2));
CHECK (iswpunct(0x002d));
CHECK (!iswpunct(0x0a84));
CHECK (iswspace(0x000a));
CHECK (!iswspace(0x2060));
CHECK (iswupper(0x01a4));
CHECK (!iswupper(0x1e6d));
CHECK (iswxdigit(L'A'));
CHECK (!iswxdigit(0x1f48));
}
#endif
 
exit (0);
}
twctype.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: twctrans.c =================================================================== --- twctrans.c (nonexistent) +++ twctrans.c (revision 345) @@ -0,0 +1,23 @@ +#include +#include +#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); +}
twctrans.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: wctype.exp =================================================================== --- wctype.exp (nonexistent) +++ wctype.exp (revision 345) @@ -0,0 +1,12 @@ +# Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved. +# +# Permission to use, copy, modify, and distribute this software +# is freely granted, provided that this notice is preserved. +# + +load_lib passfail.exp + +set exclude_list { +} + +newlib_pass_fail_all -x $exclude_list Index: tiswctype.c =================================================================== --- tiswctype.c (nonexistent) +++ tiswctype.c (revision 345) @@ -0,0 +1,61 @@ +#include +#include +#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); +}
tiswctype.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.