Skip to content

Commit

Permalink
Tests - Inheritance in TK_STRUCT
Browse files Browse the repository at this point in the history
Signed-off-by: tempate <danieldiaz@eprosima.com>
  • Loading branch information
Tempate committed Jun 25, 2024
1 parent 99ded4a commit d71db60
Show file tree
Hide file tree
Showing 10 changed files with 3,981 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/unittest/dds/xtypes/type_conversion/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/types/idls/complex_nested_arrays.idl
${CMAKE_CURRENT_BINARY_DIR}/types/idls/complex_nested_arrays.idl
COPYONLY)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/types/idls/inheritance_struct.idl
${CMAKE_CURRENT_BINARY_DIR}/types/idls/inheritance_struct.idl
COPYONLY)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/types/idls/enum_struct.idl
${CMAKE_CURRENT_BINARY_DIR}/types/idls/enum_struct.idl
Expand Down
8 changes: 8 additions & 0 deletions test/unittest/dds/xtypes/type_conversion/types/all_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
#include "type_objects/hello_world/hello_world.hpp"
#include "type_objects/hello_world/hello_worldPubSubTypes.h"

#include "type_objects/inheritance_struct/inheritance_struct.hpp"
#include "type_objects/inheritance_struct/inheritance_structPubSubTypes.h"

#include "type_objects/key_struct/key_struct.hpp"
#include "type_objects/key_struct/key_structPubSubTypes.h"

Expand Down Expand Up @@ -87,6 +90,7 @@ const std::string ENUM_STRUCT{"enum_struct"};
const std::string EXTENSIBILITY_STRUCT{"extensibility_struct"};
const std::string FLOAT_BOUNDED_SEQUENCE{"float_bounded_sequence"};
const std::string HELLO_WORLD{"hello_world"};
const std::string INHERITANCE_STRUCT{"inheritance_struct"};
const std::string KEY_STRUCT{"key_struct"};
const std::string MAP_STRUCT{"map_struct"};
const std::string NESTED_STRUCT{"nested_struct"};
Expand All @@ -108,6 +112,7 @@ const std::vector<std::string> supported_types = {
SupportedTypes::EXTENSIBILITY_STRUCT,
SupportedTypes::FLOAT_BOUNDED_SEQUENCE,
SupportedTypes::HELLO_WORLD,
SupportedTypes::INHERITANCE_STRUCT,
SupportedTypes::KEY_STRUCT,
SupportedTypes::MAP_STRUCT,
SupportedTypes::NESTED_STRUCT,
Expand Down Expand Up @@ -155,6 +160,9 @@ void register_dynamic_types()
TypeSupport type_hello_world(new hello_worldPubSubType());
type_hello_world->register_type_object_representation();

TypeSupport type_inheritance_struct(new inheritance_structPubSubType());
type_inheritance_struct->register_type_object_representation();

TypeSupport type_key_struct(new key_structPubSubType());
type_key_struct->register_type_object_representation();

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
struct GreatgrandfatherStruct
{
long greatgrandfather;
};

struct GrandfatherStruct : GreatgrandfatherStruct
{
long grandfather;
};

struct FatherStruct : GrandfatherStruct
{
long father;
};

struct SonStruct : FatherStruct
{
long son;
};

struct GrandsonStruct : SonStruct
{
long grandson;
};

struct inheritance_struct : GrandsonStruct
{
long value;
};
Loading

0 comments on commit d71db60

Please sign in to comment.