Skip to content

Commit

Permalink
Refs #10173: Use DEFAULT_FASTDDS_PROFILES for windows
Browse files Browse the repository at this point in the history
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
  • Loading branch information
Mario-DL committed May 16, 2024
1 parent a9b4033 commit 9055759
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/cpp/xmlparser/XMLParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ XMLP_ret XMLParser::loadDefaultXMLFile(
}
else
{
strcat_s(current_directory, MAX_PATH, DEFAULT_FASTRTPS_PROFILES);
strcat_s(current_directory, MAX_PATH, DEFAULT_FASTDDS_PROFILES);
return loadXML(current_directory, root, true);
}
#else
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/xmlparser/XMLProfileManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ void XMLProfileManager::loadDefaultXMLFile()
else
{
strcat_s(current_directory, MAX_PATH, "\\");
strcat_s(current_directory, MAX_PATH, DEFAULT_FASTRTPS_PROFILES);
strcat_s(current_directory, MAX_PATH, DEFAULT_FASTDDS_PROFILES);
loadXMLFile(current_directory, true);
}
}
Expand Down
10 changes: 5 additions & 5 deletions test/unittest/xmlparser/XMLLoadFileTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ class XMLLoadFileTests : public ::testing::Test
};

/*
* This test checks that the default XML file is loaded only once when there is a DEFAULT_FASTRTPS_PROFILES.xml file
* This test checks that the default XML file is loaded only once when there is a DEFAULT_FASTDDS_PROFILES.xml file
* in the current directory and the environment variable FASTRTPS_DEFAULT_PROFILES_FILE is set pointing to the same
* file.
* 1. Initialize Mock Consumer to consume the LogInfo entry that the library generates when the file has been already
* parsed. Set filters to consume only the desired entry.
* 2. Get current path to set the environment variable to the DEFAULT_FASTRTPS_PROFILES.xml file.
* 3. Write the DEFAULT_FASTRTPS_PROFILES.xml file in the current directory.
* 2. Get current path to set the environment variable to the DEFAULT_FASTDDS_PROFILES.xml file.
* 3. Write the DEFAULT_FASTDDS_PROFILES.xml file in the current directory.
* 4. Load the default XML file.
* 5. Wait for the log entry to be consumed.
*/
Expand All @@ -92,7 +92,7 @@ TEST_F(XMLLoadFileTests, load_twice_default_xml)
uint32_t ret = GetCurrentDirectory(MAX_PATH, current_directory);
ASSERT_NE(ret, 0u);
strcat_s(current_directory, MAX_PATH, "\\");
strcat_s(current_directory, MAX_PATH, DEFAULT_FASTRTPS_PROFILES);
strcat_s(current_directory, MAX_PATH, DEFAULT_FASTDDS_PROFILES);
// Set environment variable
_putenv_s("FASTRTPS_DEFAULT_PROFILES_FILE", current_directory);
#else
Expand All @@ -104,7 +104,7 @@ TEST_F(XMLLoadFileTests, load_twice_default_xml)
setenv("FASTDDS_DEFAULT_PROFILES_FILE", current_directory, 1);
#endif // _WIN32

// Write DEFAULT_FASTRTPS_PROFILES.xml
// Write DEFAULT_FASTDDS_PROFILES.xml
std::ofstream xmlFile;
xmlFile.open("DEFAULT_FASTDDS_PROFILES.xml");
xmlFile << "<dds xmlns=\"http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles\">";
Expand Down

0 comments on commit 9055759

Please sign in to comment.