Remove outdated C++03 code.

This commit is contained in:
jzmaddock
2024-03-23 17:45:04 +00:00
parent b8e58068ff
commit 6579375f35
76 changed files with 19 additions and 25601 deletions

View File

@ -61,21 +61,6 @@ test_overloads.cpp
test_operators.cpp
;
lib boost_regex_recursive :
../src/posix_api.cpp
../src/regex.cpp
../src/regex_debug.cpp
../src/static_mutex.cpp
../src/wide_posix_api.cpp
../build//icu_options
:
<define>BOOST_REGEX_RECURSIVE=1
<define>BOOST_REGEX_CXX03=1
<link>shared:<define>BOOST_REGEX_DYN_LINK=1
:
;
local regress-sources = regress/$(R_SOURCE) ;
run regress/$(R_SOURCE) ../build//boost_regex ../build//icu_options
@ -105,26 +90,23 @@ regex-test posix_api_check : c_compiler_checks/posix_api_check.c ;
compile c_compiler_checks/wide_posix_api_check.c : : wide_posix_api_check_c ;
regex-test posix_api_check_cpp : c_compiler_checks/posix_api_check.cpp ;
regex-test wide_posix_api_check_cpp : c_compiler_checks/wide_posix_api_check.cpp ;
run pathology/bad_expression_test.cpp : : : [ check-target-builds ../build//is_legacy_03 : : <source>../build//boost_regex ] ;
run pathology/recursion_test.cpp : : : [ check-target-builds ../build//is_legacy_03 : : <source>../build//boost_regex ] ;
run named_subexpressions/named_subexpressions_test.cpp : : : [ check-target-builds ../build//is_legacy_03 : : <source>../build//boost_regex ] ;
run unicode/unicode_iterator_test.cpp : : : [ check-target-builds ../build//is_legacy_03 : : <source>../build//boost_regex ] release <define>TEST_UTF8 : unicode_iterator_test_utf8 ;
run unicode/unicode_iterator_test.cpp : : : [ check-target-builds ../build//is_legacy_03 : : <source>../build//boost_regex ] release <define>TEST_UTF16 : unicode_iterator_test_utf16 ;
run pathology/bad_expression_test.cpp ;
run pathology/recursion_test.cpp ;
run named_subexpressions/named_subexpressions_test.cpp ;
run unicode/unicode_iterator_test.cpp : : : release <define>TEST_UTF8 : unicode_iterator_test_utf8 ;
run unicode/unicode_iterator_test.cpp : : : release <define>TEST_UTF16 : unicode_iterator_test_utf16 ;
run unicode/unicode_casefold_test.cpp ../build//boost_regex ../build//icu_options ;
run static_mutex/static_mutex_test.cpp ../../thread/build//boost_thread ../build//boost_regex ;
run object_cache/object_cache_test.cpp : : : [ check-target-builds ../build//is_legacy_03 : : <source>../build//boost_regex ] ;
run object_cache/object_cache_test.cpp ;
run config_info/regex_config_info.cpp ../build//boost_regex/<link>static : : : <test-info>always_show_run_output ;
run config_info/regex_config_info.cpp ../build//boost_regex : : : <test-info>always_show_run_output : regex_dll_config_info ;
run collate_info/collate_info.cpp ../build//boost_regex : : : <test-info>always_show_run_output : test_collate_info ;
link concepts/concept_check.cpp : [ check-target-builds ../build//is_legacy_03 : : <source>../build//boost_regex ] <toolset>gcc:<cxxflags>-Wno-deprecated-copy ;
link concepts/concept_check.cpp : <define>BOOST_REGEX_STANDALONE [ check-target-builds ../build//is_legacy_03 : : <build>no ] <toolset>gcc:<cxxflags>-Wno-deprecated-copy : standalone_concept_check ;
link concepts/icu_concept_check.cpp : <define>BOOST_REGEX_STANDALONE [ check-target-builds ../build//is_legacy_03 : : <source>../build//boost_regex ] <toolset>gcc:<cxxflags>-Wno-deprecated-copy ;
link concepts/icu_concept_check.cpp : [ check-target-builds ../build//is_legacy_03 : : <build>no ] <toolset>gcc:<cxxflags>-Wno-deprecated-copy : standalone_icu_concept_check ;
link concepts/range_concept_check.cpp : [ check-target-builds ../build//is_legacy_03 : : <source>../build//boost_regex ] <toolset>gcc:<cxxflags>-Wno-deprecated-copy ;
run concepts/test_bug_11988.cpp : : : [ check-target-builds ../build//is_legacy_03 : : <source>../build//boost_regex ] ;
run captures/captures_test.cpp ../build//icu_options : : : <threading>multi <define>BOOST_REGEX_MATCH_EXTRA=1 <define>BOOST_REGEX_NO_LIB=1
[ check-target-builds ../build//is_legacy_03 : : <source>../build//boost_regex ] : captures_test ;
run regress/$(R_SOURCE) .//boost_regex_recursive ../build//icu_options : : : <define>BOOST_REGEX_RECURSIVE=1 <define>BOOST_REGEX_CXX03=1 : regex_regress_recursive ;
link concepts/concept_check.cpp : <toolset>gcc:<cxxflags>-Wno-deprecated-copy ;
link concepts/concept_check.cpp : <define>BOOST_REGEX_STANDALONE <toolset>gcc:<cxxflags>-Wno-deprecated-copy : standalone_concept_check ;
link concepts/icu_concept_check.cpp : <define>BOOST_REGEX_STANDALONE <toolset>gcc:<cxxflags>-Wno-deprecated-copy ;
link concepts/icu_concept_check.cpp : <toolset>gcc:<cxxflags>-Wno-deprecated-copy : standalone_icu_concept_check ;
link concepts/range_concept_check.cpp : <toolset>gcc:<cxxflags>-Wno-deprecated-copy ;
run concepts/test_bug_11988.cpp ;
run captures/captures_test.cpp ../build//icu_options : : : <threading>multi <define>BOOST_REGEX_MATCH_EXTRA=1 <define>BOOST_REGEX_NO_LIB=1 : captures_test ;
run regress/$(R_SOURCE) ./noeh_test//boost_regex_noeh ../build//icu_options : : : <define>BOOST_NO_EXCEPTIONS=1 <exception-handling>off <link>static <runtime-link>shared : regex_regress_noeh ;
compile test_consolidated.cpp ;
@ -142,7 +124,6 @@ compile test_warnings.cpp
<toolset>gcc:<warnings>all <toolset>gcc:<warnings-as-errors>on
<toolset>clang:<warnings>all <toolset>clang:<warnings-as-errors>on
<define>BOOST_REGEX_STANDALONE
[ check-target-builds ../build//is_legacy_03 : : <build>no ]
: test_warnings_standalone ;
compile test_windows_defs_1.cpp ;

View File

@ -9,9 +9,6 @@ project
EX_SOURCES =
posix_api.cpp
regex.cpp
regex_debug.cpp
static_mutex.cpp
wide_posix_api.cpp ;
lib boost_regex_extra : $(EX_SOURCES) ../../build//icu_options

View File

@ -11,7 +11,7 @@
// most of the workarounds and headers we need are already in here:
#include <boost/regex.hpp>
#include <boost/regex/v4/primary_transform.hpp>
#include <boost/regex/v5/primary_transform.hpp>
#include <assert.h>
#include <boost/detail/lightweight_main.hpp>
#include <iostream>
@ -21,15 +21,6 @@
#pragma warning(disable:1418 981 983 2259)
#endif
#ifdef BOOST_NO_STDC_NAMESPACE
namespace std{
using ::strxfrm;
#ifndef BOOST_NO_WREGEX
using ::wcsxfrm;
#endif
}
#endif
#include <iostream>
template <class charT>

View File

@ -44,8 +44,6 @@ int NEW_MAIN()
PRINT_MACRO(BOOST_REGEX_NO_FWD);
PRINT_MACRO(BOOST_REGEX_V3);
PRINT_MACRO(BOOST_REGEX_HAS_MS_STACK_GUARD);
PRINT_MACRO(BOOST_REGEX_RECURSIVE);
PRINT_MACRO(BOOST_REGEX_NON_RECURSIVE);
PRINT_MACRO(BOOST_REGEX_BLOCKSIZE);
PRINT_MACRO(BOOST_REGEX_MAX_BLOCKS);
PRINT_MACRO(BOOST_REGEX_MAX_CACHE_BLOCKS);

View File

@ -25,9 +25,6 @@ project
lib boost_regex_noeh :
../../src/posix_api.cpp
../../src/regex.cpp
../../src/regex_debug.cpp
../../src/static_mutex.cpp
../../src/wide_posix_api.cpp
../../build//icu_options
:

View File

@ -52,8 +52,6 @@ void test_alt()
TEST_REGEX_SEARCH("a\nb", egrep, "b", match_default, make_array(0, 1, -2, -2));
TEST_REGEX_SEARCH("a\nb", egrep, "a", match_default, make_array(0, 1, -2, -2));
// DOS protection:
#ifndef BOOST_REGEX_RECURSIVE
TEST_INVALID_REGEX("(|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||(?0))", perl);
#endif
}

View File

@ -64,8 +64,6 @@ void test_anchors()
TEST_REGEX_SEARCH_W(L".$", boost::regex::extended, L" \x2028 \x2028", match_default, make_array(0, 1, -2, 2, 3, -2, 3, 4, -2, -2));
#endif
// DOS attack prevention:
#ifndef BOOST_REGEX_RECURSIVE
TEST_INVALID_REGEX("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$", perl);
#endif
}

View File

@ -194,9 +194,7 @@ void test_replace()
TEST_REGEX_REPLACE("(a*)", perl, "aabb", match_default, "{$1}", "{aa}{}b{}b{}");
TEST_REGEX_REPLACE("(a*)", boost::regex::extended, "aabb", match_default, "{$1}", "{aa}{}b{}b{}");
TEST_REGEX_REPLACE("(a*)", boost::regex::extended, "aabb", match_default|match_posix, "{$1}", "{aa}b{}b{}");
#ifndef BOOST_REGEX_RECURSIVE
// DOS protection:
TEST_REGEX_REPLACE("foo", boost::regex::perl, "foobar", match_default|format_all, "(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((", "(((((((((((((((((((((bar");
#endif
}

View File

@ -1,213 +0,0 @@
/*
*
* Copyright (c) 2004
* John Maddock
*
* Use, modification and distribution are subject to the
* Boost Software License, Version 1.0. (See accompanying file
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
/*
* LOCATION: see http://www.boost.org for most recent version.
* FILE static_mutex_test.cpp
* VERSION see <boost/version.hpp>
* DESCRIPTION: test program for boost::static_mutex.
*/
#define BOOST_TIMER_ENABLE_DEPRECATED
#include <boost/regex/pending/static_mutex.hpp>
#include <boost/thread/thread.hpp>
#include <boost/timer.hpp>
#include <iostream>
#include <iomanip>
#ifdef BOOST_REGEX_CXX03
//
// we cannot use the regular Boost.Test in here: it is not thread safe
// and calls to BOOST_CHECK will eventually crash on some compilers
// (Borland certainly) due to race conditions inside the Boost.Test lib.
//
#define BOOST_CHECK(pred) if(!(pred)) failed_test(__FILE__, __LINE__, BOOST_STRINGIZE(pred));
int total_failures = 0;
void failed_test(const char* file, int line, const char* pred)
{
static boost::static_mutex mut = BOOST_STATIC_MUTEX_INIT ;
boost::static_mutex::scoped_lock guard(mut);
++total_failures;
std::cout << "Failed test in \"" << file << "\" at line " << line << ": " << pred << std::endl;
}
void print_cycles(int c)
{
static boost::static_mutex mut = BOOST_STATIC_MUTEX_INIT ;
boost::static_mutex::scoped_lock guard(mut);
std::cout << "Thread exited after " << c << " cycles." << std::endl;
}
bool sufficient_time()
{
// return true if enough time has passed since the tests began:
static boost::static_mutex mut = BOOST_STATIC_MUTEX_INIT ;
boost::static_mutex::scoped_lock guard(mut);
static boost::timer t;
// is 10 seconds enough?
return t.elapsed() >= 10.0;
}
// define three trivial test proceedures:
bool t1()
{
static boost::static_mutex mut = BOOST_STATIC_MUTEX_INIT ;
static int has_lock = 0;
static int data = 10000;
boost::static_mutex::scoped_lock guard(mut);
BOOST_CHECK(++has_lock == 1);
BOOST_CHECK(guard.locked());
BOOST_CHECK(guard);
bool result = (--data > 0) ? true : false;
BOOST_CHECK(--has_lock == 0);
return result;
}
bool t2()
{
static boost::static_mutex mut = BOOST_STATIC_MUTEX_INIT ;
static int has_lock = 0;
static int data = 10000;
boost::static_mutex::scoped_lock guard(mut, false);
BOOST_CHECK(0 == guard.locked());
BOOST_CHECK(!guard);
guard.lock();
BOOST_CHECK(++has_lock == 1);
BOOST_CHECK(guard.locked());
BOOST_CHECK(guard);
bool result = (--data > 0) ? true : false;
BOOST_CHECK(--has_lock == 0);
guard.unlock();
BOOST_CHECK(0 == guard.locked());
BOOST_CHECK(!guard);
return result;
}
bool t3()
{
static boost::static_mutex mut = BOOST_STATIC_MUTEX_INIT ;
static int has_lock = 0;
static int data = 10000;
boost::static_mutex::scoped_lock guard(mut);
BOOST_CHECK(++has_lock == 1);
BOOST_CHECK(guard.locked());
BOOST_CHECK(guard);
bool result = (--data > 0) ? true : false;
BOOST_CHECK(--has_lock == 0);
return result;
}
// define their thread procs:
void thread1_proc()
{
int cycles = 0;
while(!sufficient_time())
{
t1();
t2();
++cycles;
}
print_cycles(cycles);
}
void thread2_proc()
{
int cycles = 0;
while(!sufficient_time())
{
t2();
t3();
++cycles;
}
print_cycles(cycles);
}
void thread3_proc()
{
int cycles = 0;
while(!sufficient_time())
{
t1();
t3();
++cycles;
}
print_cycles(cycles);
}
// make sure that at least one of our test proceedures
// is called during program startup:
struct startup1
{
startup1()
{
t1();
}
~startup1()
{
t1();
}
};
startup1 up1;
int main()
{
(void)up1;
std::list<boost::shared_ptr<boost::thread> > threads;
for(int i = 0; i < 2; ++i)
{
try{
threads.push_back(boost::shared_ptr<boost::thread>(new boost::thread(&thread1_proc)));
}
catch(const std::exception& e)
{
std::cerr << "<note>Thread creation failed with message: " << e.what() << "</note>" << std::endl;
}
}
for(int i = 0; i < 2; ++i)
{
try{
threads.push_back(boost::shared_ptr<boost::thread>(new boost::thread(&thread2_proc)));
}
catch(const std::exception& e)
{
std::cerr << "<note>Thread creation failed with message: " << e.what() << "</note>" << std::endl;
}
}
for(int i = 0; i < 2; ++i)
{
try{
threads.push_back(boost::shared_ptr<boost::thread>(new boost::thread(&thread3_proc)));
}
catch(const std::exception& e)
{
std::cerr << "<note>Thread creation failed with message: " << e.what() << "</note>" << std::endl;
}
}
std::list<boost::shared_ptr<boost::thread> >::const_iterator a(threads.begin()), b(threads.end());
while(a != b)
{
(*a)->join();
++a;
}
return total_failures;
}
#else
int main() {}
#endif

View File

@ -11,7 +11,4 @@
#include <libs/regex/src/posix_api.cpp>
#include <libs/regex/src/regex.cpp>
#include <libs/regex/src/regex_debug.cpp>
#include <libs/regex/src/static_mutex.cpp>
#include <libs/regex/src/wide_posix_api.cpp>