File tree Expand file tree Collapse file tree
test/unittest/dds/xtypes/serializers/idl Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ namespace utils {
3232 *
3333 * @param [in] st String to convert
3434 */
35- inline void to_uppercase (
35+ void to_uppercase (
3636 std::string& st) noexcept ;
3737
3838/* *
Original file line number Diff line number Diff line change @@ -66,7 +66,8 @@ configure_file(
6666 COPYONLY )
6767
6868set (RESOURCEDYNTYPETOIDLTESTS_SOURCE
69- DynTypeIDLTests.cpp)
69+ DynTypeIDLTests.cpp
70+ ${PROJECT_SOURCE_DIR } /src/cpp/utils/UnitsParser.cpp)
7071
7172file (GLOB DATATYPE_SOURCES "types/**/gen/*.cxx" )
7273
Original file line number Diff line number Diff line change 1919
2020#include < gtest/gtest.h>
2121
22+ #include < utils/UnitsParser.hpp>
23+
2224#include < fastdds/dds/core/ReturnCode.hpp>
2325#include < fastdds/dds/domain/DomainParticipantFactory.hpp>
2426#include < fastdds/dds/xtypes/dynamic_types/DynamicType.hpp>
@@ -58,15 +60,17 @@ class DynTypeIDLTests : public ::testing::TestWithParam<std::string>
5860 std::string camel_case;
5961 bool to_upper = true ;
6062
61- for (char ch : snake_case)
63+ for (const auto & ch : snake_case)
6264 {
6365 if (ch == ' _' )
6466 {
6567 to_upper = true ;
6668 }
6769 else if (to_upper)
6870 {
69- camel_case += std::toupper (ch);
71+ std::string ch_str (1 , ch);
72+ utils::to_uppercase (ch_str);
73+ camel_case += ch_str;
7074 to_upper = false ;
7175 }
7276 else
You can’t perform that action at this time.
0 commit comments