From f5e72a82b75ca40649c9a5d19b3054dbe270dd3d Mon Sep 17 00:00:00 2001 From: Yangbo Long Date: Wed, 4 Dec 2024 23:26:12 -0500 Subject: [PATCH] Try fixing ci/cd errors Signed-off-by: Yangbo Long --- .../xtypes/dynamic_types/idl_parser/IdlParser.hpp | 14 +++++++------- .../dynamic_types/idl_parser/IdlPreprocessor.hpp | 3 ++- test/feature/idl_parser/CMakeLists.txt | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/cpp/fastdds/xtypes/dynamic_types/idl_parser/IdlParser.hpp b/src/cpp/fastdds/xtypes/dynamic_types/idl_parser/IdlParser.hpp index c146e043333..37380df0213 100644 --- a/src/cpp/fastdds/xtypes/dynamic_types/idl_parser/IdlParser.hpp +++ b/src/cpp/fastdds/xtypes/dynamic_types/idl_parser/IdlParser.hpp @@ -973,7 +973,7 @@ struct action } \ }; -#define bool_op_action(Rule, id, operation) \ +#define bool_op_action(Rule, id, operation, logical_op) \ template<> \ struct action \ { \ @@ -1011,10 +1011,10 @@ struct action } \ else if (TK_BOOLEAN == pt) \ { \ - bool value = promote(s2) operation promote(s1); \ + bool value = promote(s2) logical_op promote(s1); \ xdata->set_boolean_value(MEMBER_ID_INVALID, value); \ std::cout << "=========" << std::endl; \ - std::cout << #operation << ": " << value << std::endl; \ + std::cout << #logical_op << ": " << value << std::endl; \ std::cout << "=========" << std::endl; \ } \ else \ @@ -1034,9 +1034,9 @@ struct action } \ }; -bool_op_action(or_exec, or, |) -bool_op_action(xor_exec, xor, ^) -bool_op_action(and_exec, and, &) +bool_op_action(or_exec, or, |, ||) +bool_op_action(xor_exec, xor, ^, !=) +bool_op_action(and_exec, and, &, &&) int_op_action(rshift_exec, >>, >>) int_op_action(lshift_exec, <<, <<) int_op_action(mod_exec, mod, %) @@ -1586,7 +1586,7 @@ struct action else { EPROSIMA_LOG_ERROR(IDLPARSER, "Unsupported case label data type: " << xtype->get_kind()); - throw std::runtime_error("Unsupported case label data type: " + xtype->get_kind()); + throw std::runtime_error("Unsupported case label data type: " + std::to_string(xtype->get_kind())); } if (state["union_labels"].empty() || state["union_labels"].back() == ';') diff --git a/src/cpp/fastdds/xtypes/dynamic_types/idl_parser/IdlPreprocessor.hpp b/src/cpp/fastdds/xtypes/dynamic_types/idl_parser/IdlPreprocessor.hpp index 8e78fdcb809..ca3710c88bd 100644 --- a/src/cpp/fastdds/xtypes/dynamic_types/idl_parser/IdlPreprocessor.hpp +++ b/src/cpp/fastdds/xtypes/dynamic_types/idl_parser/IdlPreprocessor.hpp @@ -128,7 +128,8 @@ class PreprocessorContext std::pair get_temporary_file() const { // Create a temporary filename template - std::vector filename_template("/tmp/xtypes_XXXXXX", "/tmp/xtypes_XXXXXX" + 18); + const char* literal = "/tmp/xtypes_XXXXXX"; + std::vector filename_template(literal, literal + 18); // Create and open a temporary file securely int fd = mkstemp(filename_template.data()); diff --git a/test/feature/idl_parser/CMakeLists.txt b/test/feature/idl_parser/CMakeLists.txt index a81d5dbab6f..29aededadda 100644 --- a/test/feature/idl_parser/CMakeLists.txt +++ b/test/feature/idl_parser/CMakeLists.txt @@ -40,5 +40,5 @@ gtest_discover_tests(IdlParserTests) message(STATUS "Copying IDL directory from ${PROJECT_SOURCE_DIR}/thirdparty/dds-types-test/IDL for idl_parser testing") add_custom_command( TARGET IdlParserTests POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_SOURCE_DIR}/thirdparty/dds-types-test/IDL $/IDL + COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_SOURCE_DIR}/thirdparty/dds-types-test/IDL ${CMAKE_CURRENT_BINARY_DIR}/IDL )