mirror of
https://github.com/boostorg/regex.git
synced 2025-07-19 15:22:09 +02:00
Merge fixes from Trunk - mainly warning suppression.
[SVN r65720]
This commit is contained in:
@ -13,8 +13,7 @@ project
|
||||
# There are unidentified linker problems on these platforms:
|
||||
<toolset>mipspro-7.4:<link>static
|
||||
<toolset>sun-5.9:<link>static
|
||||
<toolset>msvc:<warnings>all
|
||||
<toolset>gcc:<warnings>all
|
||||
<warnings>all
|
||||
<toolset>gcc:<cxxflags>-Wextra
|
||||
<toolset>gcc:<cxxflags>-Wshadow
|
||||
<define>U_USING_ICU_NAMESPACE=0
|
||||
@ -60,6 +59,31 @@ test_overloads.cpp
|
||||
test_operators.cpp
|
||||
;
|
||||
|
||||
lib boost_regex_recursive :
|
||||
../src/c_regex_traits.cpp
|
||||
../src/cpp_regex_traits.cpp
|
||||
../src/cregex.cpp
|
||||
../src/fileiter.cpp
|
||||
../src/icu.cpp
|
||||
../src/instances.cpp
|
||||
../src/posix_api.cpp
|
||||
../src/regex.cpp
|
||||
../src/regex_debug.cpp
|
||||
../src/regex_raw_buffer.cpp
|
||||
../src/regex_traits_defaults.cpp
|
||||
../src/static_mutex.cpp
|
||||
../src/w32_regex_traits.cpp
|
||||
../src/wc_regex_traits.cpp
|
||||
../src/wide_posix_api.cpp
|
||||
../src/winstances.cpp
|
||||
../src/usinstances.cpp
|
||||
../build//icu_options
|
||||
:
|
||||
<define>BOOST_REGEX_RECURSIVE=1
|
||||
<link>shared:<define>BOOST_REGEX_DYN_LINK=1
|
||||
:
|
||||
;
|
||||
|
||||
local regress-sources = regress/$(R_SOURCE) ;
|
||||
|
||||
test-suite regex
|
||||
@ -142,6 +166,14 @@ test-suite regex
|
||||
: # test name
|
||||
captures_test
|
||||
]
|
||||
|
||||
[ run regress/$(R_SOURCE) .//boost_regex_recursive
|
||||
../build//icu_options
|
||||
: # command line
|
||||
: # input files
|
||||
: # requirements
|
||||
<define>BOOST_REGEX_RECURSIVE=1
|
||||
: regex_regress_recursive ]
|
||||
;
|
||||
|
||||
|
||||
build-project ../example ;
|
||||
|
@ -14,6 +14,10 @@
|
||||
#include <boost/regex/v4/primary_transform.hpp>
|
||||
#include <assert.h>
|
||||
|
||||
#ifdef BOOST_INTEL
|
||||
#pragma warning(disable:1418 981 983 2259)
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_NO_STDC_NAMESPACE
|
||||
namespace std{
|
||||
using ::strxfrm;
|
||||
|
@ -18,6 +18,10 @@
|
||||
#ifdef __BORLANDC__
|
||||
#pragma option -w-8019 -w-8004 -w-8008
|
||||
#endif
|
||||
#ifdef BOOST_INTEL
|
||||
#pragma warning(disable:1418 981 983 595 383)
|
||||
#endif
|
||||
|
||||
#include <boost/regex.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#if !BOOST_WORKAROUND(_MSC_VER, < 1310) && !defined(BOOST_NO_MEMBER_TEMPLATES) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__GNUC__, < 3)
|
||||
|
@ -12,6 +12,9 @@
|
||||
#include <boost/regex.hpp>
|
||||
#include <boost/test/test_tools.hpp>
|
||||
|
||||
#ifdef BOOST_INTEL
|
||||
#pragma warning(disable:1418 981 983 383)
|
||||
#endif
|
||||
|
||||
template <class charT>
|
||||
void test_named_subexpressions(charT)
|
||||
|
@ -20,6 +20,10 @@
|
||||
#include <boost/regex.hpp>
|
||||
#include <boost/test/test_tools.hpp>
|
||||
|
||||
#ifdef BOOST_INTEL
|
||||
#pragma warning(disable:1418 981 983 383)
|
||||
#endif
|
||||
|
||||
int test_main( int , char* [] )
|
||||
{
|
||||
std::string bad_text(1024, ' ');
|
||||
|
@ -20,6 +20,10 @@
|
||||
#include <boost/regex.hpp>
|
||||
#include <boost/test/test_tools.hpp>
|
||||
|
||||
#ifdef BOOST_INTEL
|
||||
#pragma warning(disable:1418 981 983 383)
|
||||
#endif
|
||||
|
||||
int test_main( int , char* [] )
|
||||
{
|
||||
// this regex will recurse twice for each whitespace character matched:
|
||||
|
@ -19,6 +19,14 @@
|
||||
|
||||
#ifndef BOOST_REGEX_REGRESS_TEST_HPP
|
||||
#define BOOST_REGEX_REGRESS_TEST_HPP
|
||||
|
||||
#include <boost/regex.hpp>
|
||||
|
||||
#ifdef BOOST_INTEL
|
||||
// disable Intel's "remarks":
|
||||
#pragma warning(disable:1418 981 383 1419 7)
|
||||
#endif
|
||||
|
||||
#include <typeinfo>
|
||||
#include "test_not_regex.hpp"
|
||||
#include "test_regex_search.hpp"
|
||||
@ -28,6 +36,9 @@
|
||||
#include "test_icu.hpp"
|
||||
#include "test_locale.hpp"
|
||||
|
||||
#ifdef TEST_THREADS
|
||||
#include <boost/thread/once.hpp>
|
||||
#endif
|
||||
|
||||
//
|
||||
// define test entry proc, this forwards on to the appropriate
|
||||
@ -54,6 +65,16 @@ void test(const wchar_t&, const test_regex_search_tag&);
|
||||
void test(const wchar_t&, const test_invalid_regex_tag&);
|
||||
#endif
|
||||
|
||||
template <class Regex>
|
||||
struct call_once_func
|
||||
{
|
||||
Regex* pregex;
|
||||
void operator()()const
|
||||
{
|
||||
return test_empty(*pregex);
|
||||
}
|
||||
};
|
||||
|
||||
template <class charT, class tagT>
|
||||
void do_test(const charT& c, const tagT& tag)
|
||||
{
|
||||
@ -65,12 +86,18 @@ void do_test(const charT& c, const tagT& tag)
|
||||
test_info<charT>::set_typename(typeid(boost::basic_regex<charT, boost::cpp_regex_traits<charT> >).name());
|
||||
#endif
|
||||
boost::basic_regex<charT, boost::cpp_regex_traits<charT> > e1;
|
||||
#ifndef TEST_THREADS
|
||||
static bool done_empty_test = false;
|
||||
if(done_empty_test == false)
|
||||
{
|
||||
test_empty(e1);
|
||||
done_empty_test = true;
|
||||
}
|
||||
#else
|
||||
boost::once_flag f = BOOST_ONCE_INIT;
|
||||
call_once_func<boost::basic_regex<charT, boost::cpp_regex_traits<charT> > > proc = { &e1 };
|
||||
boost::call_once(f, proc);
|
||||
#endif
|
||||
if(test_locale::cpp_locale_state() == test_locale::test_with_locale)
|
||||
e1.imbue(test_locale::cpp_locale());
|
||||
if(test_locale::cpp_locale_state() != test_locale::no_test)
|
||||
|
@ -342,13 +342,13 @@ void test_icu(const wchar_t&, const test_regex_search_tag& )
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Expression did not compile when it should have done: " << e.what(), UChar32);
|
||||
}
|
||||
catch(const std::runtime_error& r)
|
||||
catch(const std::runtime_error& e)
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Received an unexpected std::runtime_error: " << r.what(), UChar32);
|
||||
BOOST_REGEX_TEST_ERROR("Received an unexpected std::runtime_error: " << e.what(), UChar32);
|
||||
}
|
||||
catch(const std::exception& r)
|
||||
catch(const std::exception& e)
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Received an unexpected std::exception: " << r.what(), UChar32);
|
||||
BOOST_REGEX_TEST_ERROR("Received an unexpected std::exception: " << e.what(), UChar32);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
@ -418,15 +418,15 @@ void test_icu(const wchar_t&, const test_invalid_regex_tag&)
|
||||
{
|
||||
have_catch = true;
|
||||
}
|
||||
catch(const std::runtime_error& r)
|
||||
catch(const std::runtime_error& e)
|
||||
{
|
||||
have_catch = true;
|
||||
BOOST_REGEX_TEST_ERROR("Expected a bad_expression exception, but a std::runtime_error instead: " << r.what(), wchar_t);
|
||||
BOOST_REGEX_TEST_ERROR("Expected a bad_expression exception, but a std::runtime_error instead: " << e.what(), wchar_t);
|
||||
}
|
||||
catch(const std::exception& r)
|
||||
catch(const std::exception& e)
|
||||
{
|
||||
have_catch = true;
|
||||
BOOST_REGEX_TEST_ERROR("Expected a bad_expression exception, but a std::exception instead: " << r.what(), wchar_t);
|
||||
BOOST_REGEX_TEST_ERROR("Expected a bad_expression exception, but a std::exception instead: " << e.what(), wchar_t);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
@ -624,13 +624,13 @@ void test_icu(const wchar_t&, const test_regex_replace_tag&)
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Expression did not compile when it should have done: " << e.what(), UChar32);
|
||||
}
|
||||
catch(const std::runtime_error& r)
|
||||
catch(const std::runtime_error& e)
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Received an unexpected std::runtime_error: " << r.what(), UChar32);
|
||||
BOOST_REGEX_TEST_ERROR("Received an unexpected std::runtime_error: " << e.what(), UChar32);
|
||||
}
|
||||
catch(const std::exception& r)
|
||||
catch(const std::exception& e)
|
||||
{
|
||||
BOOST_REGEX_TEST_ERROR("Received an unexpected std::exception: " << r.what(), UChar32);
|
||||
BOOST_REGEX_TEST_ERROR("Received an unexpected std::exception: " << e.what(), UChar32);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
|
@ -476,5 +476,9 @@ void test_pocessive_repeats()
|
||||
TEST_REGEX_SEARCH("x{1,5}+\\w", perl, "xxxxxa", match_default, make_array(0, 6, -2, -2));
|
||||
TEST_REGEX_SEARCH("x{1,4}+\\w", perl, "xxxxxa", match_default, make_array(0, 5, -2, -2));
|
||||
TEST_REGEX_SEARCH("x{1,3}+\\w", perl, "xxxxxa", match_default, make_array(0, 4, -2, 4, 6, -2, -2));
|
||||
TEST_INVALID_REGEX("\\d+++", perl);
|
||||
TEST_INVALID_REGEX("\\d*++", perl);
|
||||
TEST_INVALID_REGEX("\\d?++", perl);
|
||||
TEST_INVALID_REGEX("\\d{1,2}++", perl);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user