Skip to content

Commit 52c28c2

Browse files
committed
Test: workaround for gcc 4.8 std::string problem
1 parent e176ab8 commit 52c28c2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/test_lib/test_engine.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ void test_expected_error_testsuite_from_yaml(ExpectedErrorType errtype, TestCase
4545
{
4646
(void)tcflags;
4747
ExpectError::check_error(errtype, [&]{
48-
std::string copy = parsed_yaml;
48+
std::vector<char> copy(parsed_yaml.begin(), parsed_yaml.end()); // g++ 4.8 fails with std::string
4949
extra::EventHandlerTestSuite::EventSink sink;
5050
extra::EventHandlerTestSuite handler(&sink);
5151
handler.reset();
@@ -58,7 +58,7 @@ void test_expected_error_ints_from_yaml(ExpectedErrorType errtype, TestCaseFlags
5858
{
5959
(void)tcflags;
6060
ExpectError::check_error(errtype, [&]{
61-
std::string copy = parsed_yaml;
61+
std::vector<char> copy(parsed_yaml.begin(), parsed_yaml.end()); // g++ 4.8 fails with std::string
6262
extra::EventHandlerInts handler{};
6363
handler.reset(to_csubstr(copy), substr{}, nullptr, 0);
6464
ParseEngine<extra::EventHandlerInts> parser(&handler);
@@ -74,7 +74,7 @@ void test_expected_error_tree_from_yaml(ExpectedErrorType errtype, TestCaseFlags
7474
{
7575
Tree tree = {};
7676
ExpectError::check_error(errtype, &tree, [&]{
77-
std::string copy = parsed_yaml;
77+
std::vector<char> copy(parsed_yaml.begin(), parsed_yaml.end()); // g++ 4.8 fails with std::string
7878
EventHandlerTree handler(&tree, tree.root_id());
7979
ASSERT_EQ(&tree, handler.m_tree);
8080
ParseEngine<EventHandlerTree> parser(&handler);
@@ -93,7 +93,7 @@ void test_engine_testsuite_from_yaml(EngineEvtTestCase const& test_case, std::st
9393
extra::EventHandlerTestSuite handler(&sink);
9494
handler.reset();
9595
ParseEngine<extra::EventHandlerTestSuite> parser(&handler, test_case.opts);
96-
std::string copy = parsed_yaml;
96+
std::vector<char> copy(parsed_yaml.begin(), parsed_yaml.end()); // g++ 4.8 fails with std::string
9797
parser.parse_in_place_ev("(testyaml)", to_substr(copy));
9898
csubstr result = sink;
9999
_c4dbgpf("~~~\n{}~~~\n", result);
@@ -180,7 +180,7 @@ void test_engine_tree_from_yaml(EngineEvtTestCase const& test_case, std::string
180180
ParseEngine<EventHandlerTree> parser(&handler, test_case.opts);
181181
ASSERT_EQ(&handler, parser.m_evt_handler);
182182
ASSERT_EQ(&tree, parser.m_evt_handler->m_tree);
183-
std::string copy = yaml;
183+
std::vector<char> copy(yaml.begin(), yaml.end()); // g++ 4.8 fails with std::string
184184
parser.parse_in_place_ev("(testyaml)", to_substr(copy));
185185
#ifdef RYML_DBG
186186
print_tree("parsed_tree", tree);

0 commit comments

Comments
 (0)