Skip to content

Commit

Permalink
Rebase fix
Browse files Browse the repository at this point in the history
Signed-off-by: tempate <danieldiaz@eprosima.com>
  • Loading branch information
Tempate committed Jul 17, 2024
1 parent b6ae665 commit b4277d6
Show file tree
Hide file tree
Showing 12 changed files with 149 additions and 94 deletions.
2 changes: 1 addition & 1 deletion ddsrecorder/test/blackbox/FileCreationTest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#include "constants.hpp"

#include "../resources/types/hello_world/HelloWorld.hpp"
#include "../resources/types/hello_world/HelloWorldPubSubTypes.h"
#include "../resources/types/hello_world/HelloWorldPubSubTypes.hpp"

using namespace eprosima;
using DdsRecorderState = ddsrecorder::recorder::DdsRecorderStateCode;
Expand Down
29 changes: 2 additions & 27 deletions ddsrecorder/test/blackbox/mcap/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,9 @@ file(
"${PROJECT_SOURCE_DIR}/test/resources/types/hello_world/*.c*"
)

file(
GLOB_RECURSE TEST_LIBRARY_SOURCES
"${PROJECT_SOURCE_DIR}/src/cpp/*.c*"
set(TEST_LIBRARY_SOURCES
)

list(FILTER TEST_LIBRARY_SOURCES EXCLUDE REGEX "/main.cpp")

set(TEST_LIST
mcap_data_msgs
mcap_dds_topic
Expand Down Expand Up @@ -123,22 +119,9 @@ file(
"${PROJECT_SOURCE_DIR}/test/resources/types/hello_world/*.c*"
)

file(
GLOB_RECURSE TEST_LIBRARY_SOURCES
"${PROJECT_SOURCE_DIR}/src/cpp/*.c*"
set(TEST_LIBRARY_SOURCES
)

list(FILTER TEST_LIBRARY_SOURCES EXCLUDE REGEX "/main.cpp")

# Exclude types' files depending on the Fast DDS version
if ("${fastrtps_VERSION}" VERSION_LESS 2.13)
list(FILTER TEST_SOURCES EXCLUDE REGEX "v2/")
list(FILTER TEST_LIBRARY_SOURCES EXCLUDE REGEX "v2/")
else()
list(FILTER TEST_SOURCES EXCLUDE REGEX "v1/")
list(FILTER TEST_LIBRARY_SOURCES EXCLUDE REGEX "v1/")
endif()

set(TEST_LIST
max_file_size
max_size
Expand All @@ -149,16 +132,8 @@ set(TEST_NEEDED_SOURCES
)

set(TEST_EXTRA_HEADERS
${PROJECT_SOURCE_DIR}/test/resources/types/hello_world/
)

# Exclude types' files depending on the Fast DDS version
if ("${fastrtps_VERSION}" VERSION_LESS 2.13)
list(FILTER TEST_EXTRA_HEADERS EXCLUDE REGEX "v2/")
else()
list(FILTER TEST_EXTRA_HEADERS EXCLUDE REGEX "v1/")
endif()

add_blackbox_executable(
"${TEST_NAME}"
"${TEST_SOURCES}"
Expand Down
15 changes: 1 addition & 14 deletions ddsrecorder/test/blackbox/sql/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,9 @@ file(
"${PROJECT_SOURCE_DIR}/test/resources/types/hello_world/*.c*"
)

file(
GLOB_RECURSE TEST_LIBRARY_SOURCES
"${PROJECT_SOURCE_DIR}/src/cpp/*.c*"
set(TEST_LIBRARY_SOURCES
)

list(FILTER TEST_LIBRARY_SOURCES EXCLUDE REGEX "/main.cpp")

# Exclude types' files depending on the Fast DDS version
if ("${fastrtps_VERSION}" VERSION_LESS 2.13)
list(FILTER TEST_SOURCES EXCLUDE REGEX "v2/")
list(FILTER TEST_LIBRARY_SOURCES EXCLUDE REGEX "v2/")
else()
list(FILTER TEST_SOURCES EXCLUDE REGEX "v1/")
list(FILTER TEST_LIBRARY_SOURCES EXCLUDE REGEX "v1/")
endif()

set(TEST_LIST
sql_data_msgs
sql_dds_topic
Expand Down
133 changes: 133 additions & 0 deletions ddsrecorder/test/resources/types/hello_world/HelloWorldPubSubTypes.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/*!
* @file HelloWorldPubSubTypes.hpp
* This header file contains the declaration of the serialization functions.
*
* This file was generated by the tool fastddsgen.
*/


#ifndef FAST_DDS_GENERATED__HELLOWORLD_PUBSUBTYPES_HPP
#define FAST_DDS_GENERATED__HELLOWORLD_PUBSUBTYPES_HPP

#include <fastdds/dds/core/policy/QosPolicies.hpp>
#include <fastdds/dds/topic/TopicDataType.hpp>
#include <fastdds/rtps/common/InstanceHandle.hpp>
#include <fastdds/rtps/common/SerializedPayload.hpp>
#include <fastdds/utils/md5.hpp>

#include "HelloWorld.hpp"


#if !defined(GEN_API_VER) || (GEN_API_VER != 2)
#error \
Generated HelloWorld is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen.
#endif // GEN_API_VER


/*!
* @brief This class represents the TopicDataType of the type HelloWorld defined by the user in the IDL file.
* @ingroup HelloWorld
*/
class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType
{
public:

typedef HelloWorld type;

eProsima_user_DllExport HelloWorldPubSubType();

eProsima_user_DllExport ~HelloWorldPubSubType() override;

eProsima_user_DllExport bool serialize(
const void* const data,
eprosima::fastdds::rtps::SerializedPayload_t* payload) override
{
return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION);
}

eProsima_user_DllExport bool serialize(
const void* const data,
eprosima::fastdds::rtps::SerializedPayload_t* payload,
eprosima::fastdds::dds::DataRepresentationId_t data_representation) override;

eProsima_user_DllExport bool deserialize(
eprosima::fastdds::rtps::SerializedPayload_t* payload,
void* data) override;

eProsima_user_DllExport std::function<uint32_t()> getSerializedSizeProvider(
const void* const data) override
{
return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION);
}

eProsima_user_DllExport std::function<uint32_t()> getSerializedSizeProvider(
const void* const data,
eprosima::fastdds::dds::DataRepresentationId_t data_representation) override;

eProsima_user_DllExport bool getKey(
const void* const data,
eprosima::fastdds::rtps::InstanceHandle_t* ihandle,
bool force_md5 = false) override;

eProsima_user_DllExport void* createData() override;

eProsima_user_DllExport void deleteData(
void* data) override;

//Register TypeObject representation in Fast DDS TypeObjectRegistry
eProsima_user_DllExport void register_type_object_representation() override;

#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED
eProsima_user_DllExport inline bool is_bounded() const override
{
return false;
}

#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED

#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN
eProsima_user_DllExport inline bool is_plain() const override
{
return false;
}

eProsima_user_DllExport inline bool is_plain(
eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override
{
static_cast<void>(data_representation);
return false;
}

#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN

#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE
eProsima_user_DllExport inline bool construct_sample(
void* memory) const override
{
static_cast<void>(memory);
return false;
}

#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE

eprosima::fastdds::MD5 m_md5;
unsigned char* m_keyBuffer;

};

#endif // FAST_DDS_GENERATED__HELLOWORLD_PUBSUBTYPES_HPP

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <fastcdr/FastBuffer.h>

#include <fastdds/dds/topic/TypeSupport.hpp>
#include <fastdds/rtps/common/CDRMessage_t.h>
#include <fastdds/rtps/common/CDRMessage_t.hpp>
#include <fastdds/rtps/common/SerializedPayload.h>

namespace eprosima {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#include <mcap/types.hpp>

#include <fastdds/rtps/common/Time_t.h>
#include <fastdds/rtps/common/Time_t.hpp>

#include <cpp_utils/time/time_utils.hpp>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <ddsrecorder_participants/common/serialize/Serializer.hpp>
#include <ddsrecorder_participants/common/types/dynamic_types_collection/DynamicTypesCollection.hpp>
#include <ddsrecorder_participants/common/types/dynamic_types_collection/DynamicTypesCollectionPubSubTypes.h>
#include <ddsrecorder_participants/common/types/dynamic_types_collection/DynamicTypesCollectionPubSubTypes.hpp>
#include <ddsrecorder_participants/constants.hpp>

namespace eprosima {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

#include <mcap/reader.hpp>

#include <fastdds/dds/xtypes/utils.hpp>

#include <cpp_utils/exception/InconsistencyException.hpp>
#include <cpp_utils/ros2_mangling.hpp>

Expand Down Expand Up @@ -118,7 +120,7 @@ void McapHandler::add_schema(
encoding = "omgidl";

std::stringstream idl;
auto ret = idl_serialize(dynamic_type, idl);
auto ret = fastdds::dds::idl_serialize(dynamic_type, idl);
if (ret != fastdds::dds::RETCODE_OK)
{
logError(DDSRECORDER_MCAP_HANDLER, "MCAP_WRITE | Failed to serialize DynamicType to idl for type wth name: " << dynamic_type->get_name().to_string());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,12 @@ void SqlMessage::deserialize(
pub_sub_type.deserialize(&payload, &dynamic_data);

// Serialize the payload into a JSON
std::stringstream data_json_stream;

const auto ret = fastdds::dds::json_serialize(
dynamic_data, data_json, fastdds::dds::DynamicDataJsonFormat::EPROSIMA);
dynamic_data, fastdds::dds::DynamicDataJsonFormat::EPROSIMA, data_json_stream);

data_json = data_json_stream.str();

if (ret != fastdds::dds::RETCODE_OK)
{
Expand Down
7 changes: 1 addition & 6 deletions ddsrecorder_participants/src/cpp/recorder/sql/SqlWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,12 @@
#include <ddspipe_core/types/topic/dds/DdsTopic.hpp>

#include <ddsrecorder_participants/common/serialize/Serializer.hpp>
#include <ddsrecorder_participants/common/time_utils.hpp>
#include <ddsrecorder_participants/common/types/dynamic_types_collection/DynamicTypesCollection.hpp>
#include <ddsrecorder_participants/recorder/message/SqlMessage.hpp>
#include <ddsrecorder_participants/recorder/monitoring/producers/DdsRecorderStatusMonitorProducer.hpp>
#include <ddsrecorder_participants/recorder/sql/SqlHandlerConfiguration.hpp>
#include <ddsrecorder_participants/recorder/sql/SqlWriter.hpp>
#include <ddsrecorder_participants/common/time_utils.hpp>

#if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13
#else
#include <ddsrecorder_participants/common/types/dynamic_types_collection/v2/DynamicTypesCollection.hpp>
#endif // if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13

namespace eprosima {
namespace ddsrecorder {
Expand Down
32 changes: 0 additions & 32 deletions ddsreplayer/test/blackbox/sql/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,13 @@

set(TEST_NAME SqlFileReadTest)

# Determine Fast DDS version
if ("${fastrtps_VERSION}" VERSION_LESS 2.13)
set(DDS_TYPES_VERSION "v1")
else()
set(DDS_TYPES_VERSION "v2")
endif()

file(
GLOB_RECURSE TEST_SOURCES
SqlFileReadTest.cpp
"${PROJECT_SOURCE_DIR}/test/resources/dds/*.c*"
"${PROJECT_SOURCE_DIR}/test/resources/types/*.c*"
)

list(FILTER TEST_LIBRARY_SOURCES EXCLUDE REGEX "/main.cpp")

# Exclude types' files depending on the Fast DDS version
if ("${fastrtps_VERSION}" VERSION_LESS 2.13)
list(FILTER TEST_SOURCES EXCLUDE REGEX "v2/")
else()
list(FILTER TEST_SOURCES EXCLUDE REGEX "v1/")
endif()

set(TEST_LIST
trivial
data_to_check
Expand Down Expand Up @@ -78,29 +62,13 @@ add_blackbox_executable(

set(TEST_NAME SqlFileReadWithTypeTest)

# Determine Fast DDS version
if ("${fastrtps_VERSION}" VERSION_LESS 2.13)
set(DDS_TYPES_VERSION "v1")
else()
set(DDS_TYPES_VERSION "v2")
endif()

file(
GLOB_RECURSE TEST_SOURCES
SqlFileReadWithTypeTest.cpp
"${PROJECT_SOURCE_DIR}/test/resources/dds/*.c*"
"${PROJECT_SOURCE_DIR}/test/resources/types/*.c*"
)

list(FILTER TEST_LIBRARY_SOURCES EXCLUDE REGEX "/main.cpp")

# Exclude types' files depending on the Fast DDS version
if ("${fastrtps_VERSION}" VERSION_LESS 2.13)
list(FILTER TEST_SOURCES EXCLUDE REGEX "v2/")
else()
list(FILTER TEST_SOURCES EXCLUDE REGEX "v1/")
endif()

set(TEST_LIST
trivial
dds_data_to_check
Expand Down
9 changes: 0 additions & 9 deletions ddsreplayer/test/resources/dds/ConfigurationSubscriber.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,7 @@
#include <fastdds/dds/domain/DomainParticipantListener.hpp>
#include <fastdds/dds/subscriber/DataReaderListener.hpp>

<<<<<<< HEAD
<<<<<<< HEAD:ddsreplayer/test/blackbox/mcap/dds/ConfigurationSubscriber.h
#include "types/configuration/ConfigurationPubSubTypes.hpp"
=======
<<<<<<<< HEAD:ddsreplayer/test/resources/ConfigurationSubscriber.h
#include "types/configuration/ConfigurationPubSubTypes.h"
>>>>>>> b00497a (Strip replaying methods from McapFileReadTest & McapFileReadWithTypeTest):ddsreplayer/test/resources/dds/ConfigurationSubscriber.h
=======
#include "../types/configuration/Configuration.hpp"
>>>>>>> 8d371bc (Rebase fix)

#include "DataToCheck.hpp"

Expand Down

0 comments on commit b4277d6

Please sign in to comment.