forked from boostorg/regex
removed calls to wprintf: Linux doesn't have that API.
removed calls to assert: MWCW can't cope with it when UNICODE is defined. [SVN r16392]
This commit is contained in:
@ -44,27 +44,40 @@ int main()
|
||||
{
|
||||
regex_t re;
|
||||
int result;
|
||||
wchar_t buf[256];
|
||||
char nbuf[256];
|
||||
int i;
|
||||
result = regcomp(&re, expression, REG_AWK);
|
||||
if(result > REG_NOERROR)
|
||||
{
|
||||
wchar_t buf[256];
|
||||
regerror(result, &re, buf, sizeof(buf));
|
||||
wprintf(buf);
|
||||
for(i = 0; i < 256; ++i)
|
||||
nbuf[i] = buf[i];
|
||||
printf(nbuf);
|
||||
return result;
|
||||
}
|
||||
assert(re.re_nsub == 0);
|
||||
if(re.re_nsub != 0)
|
||||
{
|
||||
regfree(&re);
|
||||
exit(-1);
|
||||
}
|
||||
matches[0].rm_so = 0;
|
||||
matches[0].rm_eo = wcslen(text);
|
||||
result = regexec(&re, text, 1, matches, REG_NOTBOL | REG_NOTEOL | REG_STARTEND);
|
||||
if(result > REG_NOERROR)
|
||||
{
|
||||
wchar_t buf[256];
|
||||
regerror(result, &re, buf, sizeof(buf));
|
||||
wprintf(buf);
|
||||
for(i = 0; i < 256; ++i)
|
||||
nbuf[i] = buf[i];
|
||||
printf(nbuf);
|
||||
regfree(&re);
|
||||
return result;
|
||||
}
|
||||
assert(matches[0].rm_so == matches[0].rm_eo == 1);
|
||||
if((matches[0].rm_so != matches[0].rm_eo) || (matches[0].rm_eo != 1))
|
||||
{
|
||||
regfree(&re);
|
||||
exit(-1);
|
||||
}
|
||||
regfree(&re);
|
||||
printf("no errors found\n");
|
||||
return 0;
|
||||
@ -74,3 +87,5 @@ int main()
|
||||
# error "This library has not been configured for wide character support"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
@ -49,10 +49,17 @@ int main()
|
||||
{
|
||||
wchar_t buf[256];
|
||||
regerror(result, &re, buf, sizeof(buf));
|
||||
wprintf(buf);
|
||||
char nbuf[256];
|
||||
for(int i = 0; i < 256; ++i)
|
||||
nbuf[i] = buf[i];
|
||||
printf(nbuf);
|
||||
return result;
|
||||
}
|
||||
assert(re.re_nsub == 0);
|
||||
if(re.re_nsub != 0)
|
||||
{
|
||||
regfree(&re);
|
||||
exit(-1);
|
||||
}
|
||||
matches[0].rm_so = 0;
|
||||
matches[0].rm_eo = wcslen(text);
|
||||
result = regexec(&re, text, 1, matches, REG_NOTBOL | REG_NOTEOL | REG_STARTEND);
|
||||
@ -60,11 +67,18 @@ int main()
|
||||
{
|
||||
wchar_t buf[256];
|
||||
regerror(result, &re, buf, sizeof(buf));
|
||||
wprintf(buf);
|
||||
char nbuf[256];
|
||||
for(int i = 0; i < 256; ++i)
|
||||
nbuf[i] = buf[i];
|
||||
printf(nbuf);
|
||||
regfree(&re);
|
||||
return result;
|
||||
}
|
||||
assert(matches[0].rm_so == matches[0].rm_eo == 1);
|
||||
if((matches[0].rm_so != matches[0].rm_eo) || (matches[0].rm_eo != 1))
|
||||
{
|
||||
regfree(&re);
|
||||
exit(-1);
|
||||
}
|
||||
regfree(&re);
|
||||
printf("no errors found\n");
|
||||
return 0;
|
||||
@ -75,3 +89,4 @@ int main()
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user