Skip to content

Commit d71db60

Browse files
author
tempate
committed
Tests - Inheritance in TK_STRUCT
Signed-off-by: tempate <danieldiaz@eprosima.com>
1 parent 99ded4a commit d71db60

10 files changed

Lines changed: 3981 additions & 0 deletions

test/unittest/dds/xtypes/type_conversion/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ configure_file(
4444
${CMAKE_CURRENT_SOURCE_DIR}/types/idls/complex_nested_arrays.idl
4545
${CMAKE_CURRENT_BINARY_DIR}/types/idls/complex_nested_arrays.idl
4646
COPYONLY)
47+
configure_file(
48+
${CMAKE_CURRENT_SOURCE_DIR}/types/idls/inheritance_struct.idl
49+
${CMAKE_CURRENT_BINARY_DIR}/types/idls/inheritance_struct.idl
50+
COPYONLY)
4751
configure_file(
4852
${CMAKE_CURRENT_SOURCE_DIR}/types/idls/enum_struct.idl
4953
${CMAKE_CURRENT_BINARY_DIR}/types/idls/enum_struct.idl

test/unittest/dds/xtypes/type_conversion/types/all_types.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@
5656
#include "type_objects/hello_world/hello_world.hpp"
5757
#include "type_objects/hello_world/hello_worldPubSubTypes.h"
5858

59+
#include "type_objects/inheritance_struct/inheritance_struct.hpp"
60+
#include "type_objects/inheritance_struct/inheritance_structPubSubTypes.h"
61+
5962
#include "type_objects/key_struct/key_struct.hpp"
6063
#include "type_objects/key_struct/key_structPubSubTypes.h"
6164

@@ -87,6 +90,7 @@ const std::string ENUM_STRUCT{"enum_struct"};
8790
const std::string EXTENSIBILITY_STRUCT{"extensibility_struct"};
8891
const std::string FLOAT_BOUNDED_SEQUENCE{"float_bounded_sequence"};
8992
const std::string HELLO_WORLD{"hello_world"};
93+
const std::string INHERITANCE_STRUCT{"inheritance_struct"};
9094
const std::string KEY_STRUCT{"key_struct"};
9195
const std::string MAP_STRUCT{"map_struct"};
9296
const std::string NESTED_STRUCT{"nested_struct"};
@@ -108,6 +112,7 @@ const std::vector<std::string> supported_types = {
108112
SupportedTypes::EXTENSIBILITY_STRUCT,
109113
SupportedTypes::FLOAT_BOUNDED_SEQUENCE,
110114
SupportedTypes::HELLO_WORLD,
115+
SupportedTypes::INHERITANCE_STRUCT,
111116
SupportedTypes::KEY_STRUCT,
112117
SupportedTypes::MAP_STRUCT,
113118
SupportedTypes::NESTED_STRUCT,
@@ -155,6 +160,9 @@ void register_dynamic_types()
155160
TypeSupport type_hello_world(new hello_worldPubSubType());
156161
type_hello_world->register_type_object_representation();
157162

163+
TypeSupport type_inheritance_struct(new inheritance_structPubSubType());
164+
type_inheritance_struct->register_type_object_representation();
165+
158166
TypeSupport type_key_struct(new key_structPubSubType());
159167
type_key_struct->register_type_object_representation();
160168

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
struct GreatgrandfatherStruct
2+
{
3+
long greatgrandfather;
4+
};
5+
6+
struct GrandfatherStruct : GreatgrandfatherStruct
7+
{
8+
long grandfather;
9+
};
10+
11+
struct FatherStruct : GrandfatherStruct
12+
{
13+
long father;
14+
};
15+
16+
struct SonStruct : FatherStruct
17+
{
18+
long son;
19+
};
20+
21+
struct GrandsonStruct : SonStruct
22+
{
23+
long grandson;
24+
};
25+
26+
struct inheritance_struct : GrandsonStruct
27+
{
28+
long value;
29+
};

0 commit comments

Comments
 (0)