Merge branch 'develop'

This commit is contained in:
jzmaddock
2020-04-28 17:41:58 +01:00
34 changed files with 436 additions and 139 deletions

View File

@ -112,7 +112,7 @@ private:
boost::call_once(f,&init_data);
return do_get_data();
#else
static data_type d;
static data_type d = {};
return d;
#endif
}

View File

@ -139,10 +139,10 @@ int cpp_main(int /*argc*/, char * /*argv*/[])
int* get_array_data()
{
static boost::thread_specific_ptr<boost::array<int, 200> > tp;
static boost::thread_specific_ptr<boost::array<int, 800> > tp;
if(tp.get() == 0)
tp.reset(new boost::array<int, 200>);
tp.reset(new boost::array<int, 800>);
return tp.get()->data();
}
@ -160,9 +160,9 @@ const int* make_array(int first, ...)
#ifdef TEST_THREADS
int* data = get_array_data();
#else
static int data[200];
static int data[800];
#endif
std::fill_n(data, 200, -2);
std::fill_n(data, 800, -2);
va_list ap;
va_start(ap, first);
//

View File

@ -99,7 +99,7 @@ void do_test(const charT& c, const tagT& tag)
boost::call_once(f, proc);
#endif
if(test_locale::cpp_locale_state() == test_locale::test_with_locale)
e1.imbue(test_locale::cpp_locale());
(void)e1.imbue(test_locale::cpp_locale());
if(test_locale::cpp_locale_state() != test_locale::no_test)
test(e1, tag);
#endif

View File

@ -103,5 +103,10 @@ void test_backrefs()
TEST_REGEX_SEARCH("a(?'foo'(?'bar'(?'bb'(?'aa'b*))))c\\g{foo}d", perl, "abbcbbbd", match_default, make_array(-2, -2));
TEST_REGEX_SEARCH("^(?'foo'.)\\g{foo}", perl, "abc", match_default, make_array(-2, -2));
TEST_REGEX_SEARCH("a(?'foo'[bc])\\g{foo}d", perl, "abcdabbd", match_default, make_array(4, 8, 5, 6, -2, -2));
// Bug cases from https://github.com/boostorg/regex/issues/75
TEST_REGEX_SEARCH("(?:(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)\\g{-1}|WORKING)", perl, "WORKING", match_default, make_array(0, 7, -2, -2));
TEST_REGEX_SEARCH("(?:(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)(z)\\g{-1}|WORKING)", perl, "WORKING", match_default, make_array(0, 7, -2, -2));
}

View File

@ -935,6 +935,7 @@ void test_recursion()
TEST_REGEX_SEARCH("namespace\\s+(\\w+)\\s+(\\{(?:[^{}]*(?:(?2)[^{}]*)*)?\\})", perl, "namespace one { namespace two { int foo(){} } { {{{ } } } } {}}", match_default, make_array(0, 64, 10, 13, 14, 64, -2, -2));
TEST_INVALID_REGEX("((?1)|a)", perl);
TEST_REGEX_SEARCH("a(?0)?", perl, "aaaaa", match_default, make_array(0, 5, -2, -2));
TEST_REGEX_SEARCH("((?(DEFINE)(?'a'A)(?'b'(?&a)?(?&a)))(?&b)?)", perl, "AA", match_default, make_array(0, 2, 0, 2, -1, -1, -2, 2, 2, 2, 2, -1, -1, -2, -2));
// Recursion to a named sub with a name that is used multiple times:
TEST_REGEX_SEARCH("(?:(?<A>a+)|(?<A>b+))\\.(?&A)", perl, "aaaa.aa", match_default, make_array(0, 7, 0, 4, -1, -1, -2, -2));