Improved error messages generated for thrown exceptions.

Suppressed "gcc -Wall -Wextra -pedantic" and "msvc /W4" warnings.
Updated and rebuilt docs.


[SVN r57451]
This commit is contained in:
John Maddock
2009-11-07 15:32:45 +00:00
parent 898b49fa89
commit 6e1f3dcceb
60 changed files with 662 additions and 436 deletions

View File

@ -34,13 +34,13 @@ int flags = REG_EXTENDED | REG_BASIC | REG_NOSPEC | REG_ICASE | REG_NOSUB |
int main()
{
regex_tA re;
int result;
unsigned int result;
result = regcompA(&re, expression, REG_AWK);
if(result > REG_NOERROR)
{
char buf[256];
regerrorA(result, &re, buf, sizeof(buf));
printf(buf);
printf("%s", buf);
return result;
}
BOOST_TEST(re.re_nsub == 0);
@ -51,11 +51,11 @@ int main()
{
char buf[256];
regerrorA(result, &re, buf, sizeof(buf));
printf(buf);
printf("%s", buf);
regfreeA(&re);
return result;
}
BOOST_TEST(matches[0].rm_so == matches[0].rm_eo == 1);
BOOST_TEST(matches[0].rm_so == matches[0].rm_eo);
regfreeA(&re);
printf("no errors found\n");
return boost::report_errors();

View File

@ -40,7 +40,7 @@ int flags = REG_EXTENDED | REG_BASIC | REG_NOSPEC | REG_ICASE | REG_NOSUB |
int main()
{
regex_t re;
int result;
unsigned result;
result = regcomp(&re, expression, REG_AWK);
if(result > REG_NOERROR)
{
@ -48,8 +48,8 @@ int main()
regerror(result, &re, buf, sizeof(buf));
char nbuf[256];
for(int i = 0; i < 256; ++i)
nbuf[i] = buf[i];
printf(nbuf);
nbuf[i] = static_cast<char>(buf[i]);
printf("%s", nbuf);
return result;
}
if(re.re_nsub != 0)
@ -66,8 +66,8 @@ int main()
regerror(result, &re, buf, sizeof(buf));
char nbuf[256];
for(int i = 0; i < 256; ++i)
nbuf[i] = buf[i];
printf(nbuf);
nbuf[i] = static_cast<char>(buf[i]);
printf("%s", nbuf);
regfree(&re);
return result;
}
@ -77,7 +77,7 @@ int main()
exit(-1);
}
regfree(&re);
printf("no errors found\n");
printf("%s", "no errors found\n");
return 0;
}

View File

@ -137,7 +137,7 @@ void test_deprecated(const char&, const test_regex_search_tag&)
if(test_info<char>::syntax_options() & ~boost::regex::icase)
return;
try{
boost::RegEx e(expression, test_info<char>::syntax_options() & boost::regex::icase);
boost::RegEx e(expression, (test_info<char>::syntax_options() & boost::regex::icase) != 0);
if(e.error_code())
{
BOOST_REGEX_TEST_ERROR("Expression did not compile when it should have done, error code = " << e.error_code(), char);
@ -303,7 +303,7 @@ void test_deprecated(const char&, const test_invalid_regex_tag&)
return;
bool have_catch = false;
try{
boost::RegEx e(expression, test_info<char>::syntax_options() & boost::regex::icase);
boost::RegEx e(expression, (test_info<char>::syntax_options() & boost::regex::icase) != 0);
if(e.error_code())
have_catch = true;
}

View File

@ -12,7 +12,7 @@
#include "test.hpp"
#ifdef BOOST_MSVC
#pragma warning(disable:4127)
#pragma warning(disable:4127 4428)
#endif
void test_character_escapes()

View File

@ -172,6 +172,7 @@ void test_simple_repeats()
TEST_REGEX_SEARCH("^a{0,1}?$", perl, "aaaaa", match_default, make_array(-2, -2));
TEST_REGEX_SEARCH("^(?:a){0,1}?$", perl, "aaaaa", match_default, make_array(-2, -2));
TEST_REGEX_SEARCH("^a(?:bc)?", perl, "abcbc", match_any|match_all, make_array(-2, -2));
test_simple_repeats2();
}
void test_simple_repeats2()

View File

@ -161,7 +161,7 @@ startup1 up1;
int main()
{
BOOST_TEST(0 != &up1);
(void)up1;
std::list<boost::shared_ptr<boost::thread> > threads;
for(int i = 0; i < 2; ++i)