Skip to content

Commit 42a69dc

Browse files
Fix windows testing
Signed-off-by: Eugenio Collado <eugeniocollado@eprosima.com>
1 parent 9134b9f commit 42a69dc

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

ddsenabler/test/DDSEnablerTester.hpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ static int write_delay_ms_ = 20;
4949
static int wait_for_ack_ns_ = 1000000000;
5050
static int wait_after_publication_ms_ = 200;
5151

52+
const auto input_file_path = std::filesystem::current_path() / "test_files";
53+
auto persistence_dir = input_file_path.string();
54+
#if defined(_WIN32) // On windows, the path separator is '\'
55+
std::replace(persistence_dir.begin(), persistence_dir.end(), '/', '\\');
56+
#endif // _WIN32
57+
5258
class DDSEnablerTester : public ::testing::Test
5359
{
5460
public:
@@ -357,7 +363,6 @@ class DDSEnablerTester : public ::testing::Test
357363
std::unique_ptr<const unsigned char []>& serialized_type_internal,
358364
uint32_t& serialized_type_internal_size)
359365
{
360-
constexpr char persistence_dir[] = "test_files";
361366
if (utils::load_type_from_file(
362367
persistence_dir,
363368
type_name,
@@ -433,7 +438,6 @@ class DDSEnablerTester : public ::testing::Test
433438
const char* service_name,
434439
eprosima::ddsenabler::participants::ServiceInfo& service_info)
435440
{
436-
constexpr char persistence_dir[] = "test_files";
437441
if (utils::load_service_from_file(
438442
persistence_dir,
439443
service_name,
@@ -475,7 +479,6 @@ class DDSEnablerTester : public ::testing::Test
475479
const char* action_name,
476480
eprosima::ddsenabler::participants::ActionInfo& action_info)
477481
{
478-
constexpr char persistence_dir[] = "test_files";
479482
if (!utils::load_action_from_file(
480483
persistence_dir,
481484
action_name,

0 commit comments

Comments
 (0)