fix compilation issue in src/test/main.cpp (#6835)

Fixes this error with gcc called via codeblocks:

src\tests\main.cpp:78 error: no matching function for call to 'std::basic_ofstream<char>::open(const value_type*)'
note: candidate: 'void std::basic_ofstream<_CharT, _Traits>::open(const char*, std::ios_base::openmode)
    [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::_Ios_Openmode]'
note: no known conversion for argument 1 from 'const value_type*' {aka 'const wchar_t*'} to 'const char*'
This commit is contained in:
newfrenchy83 2022-07-03 20:09:56 +02:00 committed by GitHub
parent 6ed684af73
commit 159d5286bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -61,7 +61,8 @@ std::ofstream reporter;
struct wesnoth_global_fixture {
wesnoth_global_fixture()
{
using namespace boost::unit_test; using namespace std::literals;
using namespace boost::unit_test;
using namespace std::literals;
boost::filesystem::path file("boost_test_result.xml");
for(int i = 1; i < framework::master_test_suite().argc; i++) {
if(framework::master_test_suite().argv[i - 1] == "--output_file"s) {
@ -70,7 +71,7 @@ struct wesnoth_global_fixture {
}
}
reporter.open(file.c_str());
reporter.open(file.string());
assert( reporter.is_open() );
results_reporter::set_stream(reporter);