Skip to content

Commit

Permalink
Fix windows tests
Browse files Browse the repository at this point in the history
Signed-off-by: Eugenio Collado <[email protected]>
  • Loading branch information
EugenioCollado committed Feb 11, 2025
1 parent c36fd7f commit 3c78a92
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
3 changes: 3 additions & 0 deletions ddsrecorder/test/blackbox/both/ResourceLimitsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ class ResourceLimitsTest : public testing::Test
yml_str +=
" log-rotation: true\n";
}
#if defined(_WIN32) // On windows, the path separator is '\', but the yaml parser expects '/'.
std::replace(yml_str.begin(), yml_str.end(), '\\', '/');
#endif // _WIN32
Yaml yml = YAML::Load(yml_str);

// Setting CommandLine arguments as if configured from CommandLine
Expand Down
12 changes: 10 additions & 2 deletions ddsreplayer/test/blackbox/FileReadTest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,20 @@ class FileReadTest : public testing::Test

// Configuration
const auto full_configuration_path = std::filesystem::current_path() / configuration_path;
ddsrecorder::yaml::ReplayerConfiguration configuration(full_configuration_path.string());
auto str_full_configuration_path = full_configuration_path.string();
#if defined(_WIN32) // On windows, the path separator is '\'
std::replace(str_full_configuration_path.begin(), str_full_configuration_path.end(), '\/', '\\');
#endif // _WIN32
ddsrecorder::yaml::ReplayerConfiguration configuration(str_full_configuration_path);
configuration.replayer_configuration->domain.domain_id = test::DOMAIN;

// Create replayer instance
const auto input_file_path = std::filesystem::current_path() / input_file;
auto replayer = std::make_unique<ddsrecorder::replayer::DdsReplayer>(configuration, input_file_path.string());
auto str_input_file_path = input_file_path.string();
#if defined(_WIN32) // On windows, the path separator is '\'
std::replace(str_input_file_path.begin(), str_input_file_path.end(), '\/', '\\');
#endif // _WIN32
auto replayer = std::make_unique<ddsrecorder::replayer::DdsReplayer>(configuration, str_input_file_path);

// Give time for replayer and subscriber to match.
// Waiting for the subscriber to match the replayer
Expand Down

0 comments on commit 3c78a92

Please sign in to comment.