diff --git a/test/unittest/dds/xtypes/dyndata_json/idl_to_json_Tests.cpp b/test/unittest/dds/xtypes/dyndata_json/idl_to_json_Tests.cpp index 5c00a895d62..db3af8ef1ae 100644 --- a/test/unittest/dds/xtypes/dyndata_json/idl_to_json_Tests.cpp +++ b/test/unittest/dds/xtypes/dyndata_json/idl_to_json_Tests.cpp @@ -30,10 +30,10 @@ #include "types/comprehensive_type/gen/ComprehensiveTypePubSubTypes.h" #include "types/comprehensive_type/gen/ComprehensiveTypeTypeObjectSupport.hpp" -#include "types/comprehensive_type/ComprehensiveType_OMG.hpp" -#include "types/comprehensive_type/ComprehensiveTypeFilled_OMG.hpp" -#include "types/comprehensive_type/ComprehensiveType_EPROSIMA.hpp" -#include "types/comprehensive_type/ComprehensiveTypeFilled_EPROSIMA.hpp" +#include "types/comprehensive_type/json/ComprehensiveType_OMG.hpp" +#include "types/comprehensive_type/json/ComprehensiveType_Filled_OMG.hpp" +#include "types/comprehensive_type/json/ComprehensiveType_EPROSIMA.hpp" +#include "types/comprehensive_type/json/ComprehensiveType_Filled_EPROSIMA.hpp" #include "types/types.hpp" @@ -74,17 +74,21 @@ TEST(idl_to_json_Tests, ComprehensiveType_EPROSIMA) TEST(idl_to_json_Tests, ComprehensiveTypeFilled_EPROSIMA) { auto dyn_type = create_dynamic_type(); - auto dyn_data = create_dynamic_data(dyn_type, true, 1); - std::stringstream generated_json; - generated_json << std::setw(4); - const auto ret = json_serialize( - dyn_data, - generated_json, - DynamicDataJsonFormat::EPROSIMA); + for (unsigned int i = 1; i < 3; i++) + { + auto dyn_data = create_dynamic_data(dyn_type, true, i); + std::stringstream generated_json; + generated_json << std::setw(4); - ASSERT_EQ(ret, RETCODE_OK); - ASSERT_EQ(generated_json.str(), expected_json_comprehensive_filled_eprosima); + const auto ret = json_serialize( + dyn_data, + generated_json, + DynamicDataJsonFormat::EPROSIMA); + + ASSERT_EQ(ret, RETCODE_OK); + ASSERT_EQ(generated_json.str(), expected_json_comprehensive_filled_eprosima[i]); + } } TEST(idl_to_json_Tests, ComprehensiveType_OMG) @@ -106,17 +110,20 @@ TEST(idl_to_json_Tests, ComprehensiveType_OMG) TEST(idl_to_json_Tests, ComprehensiveTypeFilled_OMG) { auto dyn_type = create_dynamic_type(); - auto dyn_data = create_dynamic_data(dyn_type, true, 1); - std::stringstream generated_json; - generated_json << std::setw(4); - const auto ret = json_serialize( - dyn_data, - generated_json, - DynamicDataJsonFormat::OMG); - - ASSERT_EQ(ret, RETCODE_OK); - ASSERT_EQ(generated_json.str(), expected_json_comprehensive_filled_omg); + for (unsigned int i = 1; i < 3; i++) + { + auto dyn_data = create_dynamic_data(dyn_type, true, i); + std::stringstream generated_json; + generated_json << std::setw(4); + const auto ret = json_serialize( + dyn_data, + generated_json, + DynamicDataJsonFormat::OMG); + + ASSERT_EQ(ret, RETCODE_OK); + ASSERT_EQ(generated_json.str(), expected_json_comprehensive_filled_omg[i]); + } } diff --git a/test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/ComprehensiveTypeFilled_EPROSIMA.hpp b/test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/ComprehensiveTypeFilled_EPROSIMA.hpp deleted file mode 100644 index a6b07dfe152..00000000000 --- a/test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/ComprehensiveTypeFilled_EPROSIMA.hpp +++ /dev/null @@ -1,758 +0,0 @@ -// Copyright 2024 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. - -#ifndef EXPECTED_JSON_COMPREHENSIVE_FILLED_EPROSIMA_HPP -#define EXPECTED_JSON_COMPREHENSIVE_FILLED_EPROSIMA_HPP - -#include - -std::string expected_json_comprehensive_filled_eprosima = R"({ - "complex_array": [ - { - "bitmask_sequence": [], - "complex_union": { - "fourth": { - "second": 0 - } - }, - "inner_union": { - "second": 0 - }, - "long_array": [ - [ - [ - 1, - 2, - 3, - 4 - ], - [ - 5, - 6, - 7, - 8 - ], - [ - 9, - 10, - 11, - 12 - ] - ], - [ - [ - 13, - 14, - 15, - 16 - ], - [ - 17, - 18, - 19, - 20 - ], - [ - 21, - 22, - 23, - 24 - ] - ] - ], - "my_aliased_bounded_string": "my_aliased_bounded_string", - "my_aliased_enum": { - "name": "A", - "value": 0 - }, - "my_aliased_struct": { - "my_bool": true, - "my_char": "e", - "my_double": 0.5, - "my_float": 0.5, - "my_int8": 1, - "my_long": 1, - "my_longdouble": 0.5, - "my_longlong": 1, - "my_octet": 0, - "my_short": 1, - "my_uint8": 1, - "my_ulong": 1, - "my_ulonglong": 1, - "my_ushort": 1, - "my_wchar": "e" - }, - "my_bitmask": { - "active": [], - "binary": "00000000000000000000000000000000", - "value": 0 - }, - "my_bitset": { - "a": 0, - "b": false, - "c": 0, - "d": 0 - }, - "my_bool": true, - "my_bounded_string": "my_bounded_string", - "my_bounded_wstring": "my_bounded_wstring", - "my_char": "e", - "my_double": 0.5, - "my_enum": { - "name": "A", - "value": 0 - }, - "my_float": 0.5, - "my_int8": 1, - "my_long": 1, - "my_longdouble": 0.5, - "my_longlong": 1, - "my_octet": 0, - "my_recursive_alias": { - "name": "A", - "value": 0 - }, - "my_short": 1, - "my_string": "my_string", - "my_uint8": 1, - "my_ulong": 1, - "my_ulonglong": 1, - "my_ushort": 1, - "my_wchar": "e", - "my_wstring": "my_string", - "short_long_map": { - "0": 1 - }, - "short_sequence": [ - 0, - 1 - ], - "string_alias_unbounded_map": null, - "string_unbounded_map": null - }, - { - "bitmask_sequence": [], - "complex_union": { - "fourth": { - "second": 0 - } - }, - "inner_union": { - "second": 0 - }, - "long_array": [ - [ - [ - 1, - 2, - 3, - 4 - ], - [ - 5, - 6, - 7, - 8 - ], - [ - 9, - 10, - 11, - 12 - ] - ], - [ - [ - 13, - 14, - 15, - 16 - ], - [ - 17, - 18, - 19, - 20 - ], - [ - 21, - 22, - 23, - 24 - ] - ] - ], - "my_aliased_bounded_string": "my_aliased_bounded_string", - "my_aliased_enum": { - "name": "A", - "value": 0 - }, - "my_aliased_struct": { - "my_bool": true, - "my_char": "e", - "my_double": 0.5, - "my_float": 0.5, - "my_int8": 1, - "my_long": 1, - "my_longdouble": 0.5, - "my_longlong": 1, - "my_octet": 0, - "my_short": 1, - "my_uint8": 1, - "my_ulong": 1, - "my_ulonglong": 1, - "my_ushort": 1, - "my_wchar": "e" - }, - "my_bitmask": { - "active": [], - "binary": "00000000000000000000000000000000", - "value": 0 - }, - "my_bitset": { - "a": 0, - "b": false, - "c": 0, - "d": 0 - }, - "my_bool": true, - "my_bounded_string": "my_bounded_string", - "my_bounded_wstring": "my_bounded_wstring", - "my_char": "e", - "my_double": 0.5, - "my_enum": { - "name": "A", - "value": 0 - }, - "my_float": 0.5, - "my_int8": 1, - "my_long": 1, - "my_longdouble": 0.5, - "my_longlong": 1, - "my_octet": 0, - "my_recursive_alias": { - "name": "A", - "value": 0 - }, - "my_short": 1, - "my_string": "my_string", - "my_uint8": 1, - "my_ulong": 1, - "my_ulonglong": 1, - "my_ushort": 1, - "my_wchar": "e", - "my_wstring": "my_string", - "short_long_map": { - "0": 1 - }, - "short_sequence": [ - 0, - 1 - ], - "string_alias_unbounded_map": null, - "string_unbounded_map": null - } - ], - "complex_map": { - "0": { - "bitmask_sequence": [], - "complex_union": { - "fourth": { - "second": 0 - } - }, - "inner_union": { - "second": 0 - }, - "long_array": [ - [ - [ - 0, - 0, - 0, - 0 - ], - [ - 0, - 0, - 0, - 0 - ], - [ - 0, - 0, - 0, - 0 - ] - ], - [ - [ - 0, - 0, - 0, - 0 - ], - [ - 0, - 0, - 0, - 0 - ], - [ - 0, - 0, - 0, - 0 - ] - ] - ], - "my_aliased_bounded_string": "", - "my_aliased_enum": { - "name": "A", - "value": 0 - }, - "my_aliased_struct": { - "my_bool": false, - "my_char": "\u0000", - "my_double": 0.0, - "my_float": 0.0, - "my_int8": 0, - "my_long": 0, - "my_longdouble": 0.0, - "my_longlong": 0, - "my_octet": 0, - "my_short": 0, - "my_uint8": 0, - "my_ulong": 0, - "my_ulonglong": 0, - "my_ushort": 0, - "my_wchar": "\u0000" - }, - "my_bitmask": { - "active": [], - "binary": "00000000000000000000000000000000", - "value": 0 - }, - "my_bitset": { - "a": 0, - "b": false, - "c": 0, - "d": 0 - }, - "my_bool": false, - "my_bounded_string": "", - "my_bounded_wstring": "", - "my_char": "\u0000", - "my_double": 0.0, - "my_enum": { - "name": "A", - "value": 0 - }, - "my_float": 0.0, - "my_int8": 0, - "my_long": 0, - "my_longdouble": 0.0, - "my_longlong": 0, - "my_octet": 0, - "my_recursive_alias": { - "name": "A", - "value": 0 - }, - "my_short": 0, - "my_string": "", - "my_uint8": 0, - "my_ulong": 0, - "my_ulonglong": 0, - "my_ushort": 0, - "my_wchar": "\u0000", - "my_wstring": "", - "short_long_map": null, - "short_sequence": [], - "string_alias_unbounded_map": null, - "string_unbounded_map": null - }, - "1": { - "bitmask_sequence": [], - "complex_union": { - "fourth": { - "second": 0 - } - }, - "inner_union": { - "second": 0 - }, - "long_array": [ - [ - [ - 1, - 2, - 3, - 4 - ], - [ - 5, - 6, - 7, - 8 - ], - [ - 9, - 10, - 11, - 12 - ] - ], - [ - [ - 13, - 14, - 15, - 16 - ], - [ - 17, - 18, - 19, - 20 - ], - [ - 21, - 22, - 23, - 24 - ] - ] - ], - "my_aliased_bounded_string": "my_aliased_bounded_string", - "my_aliased_enum": { - "name": "A", - "value": 0 - }, - "my_aliased_struct": { - "my_bool": true, - "my_char": "e", - "my_double": 0.5, - "my_float": 0.5, - "my_int8": 1, - "my_long": 1, - "my_longdouble": 0.5, - "my_longlong": 1, - "my_octet": 0, - "my_short": 1, - "my_uint8": 1, - "my_ulong": 1, - "my_ulonglong": 1, - "my_ushort": 1, - "my_wchar": "e" - }, - "my_bitmask": { - "active": [], - "binary": "00000000000000000000000000000000", - "value": 0 - }, - "my_bitset": { - "a": 0, - "b": false, - "c": 0, - "d": 0 - }, - "my_bool": true, - "my_bounded_string": "my_bounded_string", - "my_bounded_wstring": "my_bounded_wstring", - "my_char": "e", - "my_double": 0.5, - "my_enum": { - "name": "A", - "value": 0 - }, - "my_float": 0.5, - "my_int8": 1, - "my_long": 1, - "my_longdouble": 0.5, - "my_longlong": 1, - "my_octet": 0, - "my_recursive_alias": { - "name": "A", - "value": 0 - }, - "my_short": 1, - "my_string": "my_string", - "my_uint8": 1, - "my_ulong": 1, - "my_ulonglong": 1, - "my_ushort": 1, - "my_wchar": "e", - "my_wstring": "my_string", - "short_long_map": { - "0": 1 - }, - "short_sequence": [ - 0, - 1 - ], - "string_alias_unbounded_map": null, - "string_unbounded_map": null - } - }, - "complex_sequence": [ - { - "bitmask_sequence": [], - "complex_union": { - "fourth": { - "second": 0 - } - }, - "inner_union": { - "second": 0 - }, - "long_array": [ - [ - [ - 1, - 2, - 3, - 4 - ], - [ - 5, - 6, - 7, - 8 - ], - [ - 9, - 10, - 11, - 12 - ] - ], - [ - [ - 13, - 14, - 15, - 16 - ], - [ - 17, - 18, - 19, - 20 - ], - [ - 21, - 22, - 23, - 24 - ] - ] - ], - "my_aliased_bounded_string": "my_aliased_bounded_string", - "my_aliased_enum": { - "name": "A", - "value": 0 - }, - "my_aliased_struct": { - "my_bool": true, - "my_char": "e", - "my_double": 0.5, - "my_float": 0.5, - "my_int8": 1, - "my_long": 1, - "my_longdouble": 0.5, - "my_longlong": 1, - "my_octet": 0, - "my_short": 1, - "my_uint8": 1, - "my_ulong": 1, - "my_ulonglong": 1, - "my_ushort": 1, - "my_wchar": "e" - }, - "my_bitmask": { - "active": [], - "binary": "00000000000000000000000000000000", - "value": 0 - }, - "my_bitset": { - "a": 0, - "b": false, - "c": 0, - "d": 0 - }, - "my_bool": true, - "my_bounded_string": "my_bounded_string", - "my_bounded_wstring": "my_bounded_wstring", - "my_char": "e", - "my_double": 0.5, - "my_enum": { - "name": "A", - "value": 0 - }, - "my_float": 0.5, - "my_int8": 1, - "my_long": 1, - "my_longdouble": 0.5, - "my_longlong": 1, - "my_octet": 0, - "my_recursive_alias": { - "name": "A", - "value": 0 - }, - "my_short": 1, - "my_string": "my_string", - "my_uint8": 1, - "my_ulong": 1, - "my_ulonglong": 1, - "my_ushort": 1, - "my_wchar": "e", - "my_wstring": "my_string", - "short_long_map": { - "0": 1 - }, - "short_sequence": [ - 0, - 1 - ], - "string_alias_unbounded_map": null, - "string_unbounded_map": null - } - ], - "index": 1, - "inner_struct": { - "bitmask_sequence": [], - "complex_union": { - "fourth": { - "second": 0 - } - }, - "inner_union": { - "second": 0 - }, - "long_array": [ - [ - [ - 1, - 2, - 3, - 4 - ], - [ - 5, - 6, - 7, - 8 - ], - [ - 9, - 10, - 11, - 12 - ] - ], - [ - [ - 13, - 14, - 15, - 16 - ], - [ - 17, - 18, - 19, - 20 - ], - [ - 21, - 22, - 23, - 24 - ] - ] - ], - "my_aliased_bounded_string": "my_aliased_bounded_string", - "my_aliased_enum": { - "name": "A", - "value": 0 - }, - "my_aliased_struct": { - "my_bool": true, - "my_char": "e", - "my_double": 0.5, - "my_float": 0.5, - "my_int8": 1, - "my_long": 1, - "my_longdouble": 0.5, - "my_longlong": 1, - "my_octet": 0, - "my_short": 1, - "my_uint8": 1, - "my_ulong": 1, - "my_ulonglong": 1, - "my_ushort": 1, - "my_wchar": "e" - }, - "my_bitmask": { - "active": [], - "binary": "00000000000000000000000000000000", - "value": 0 - }, - "my_bitset": { - "a": 0, - "b": false, - "c": 0, - "d": 0 - }, - "my_bool": true, - "my_bounded_string": "my_bounded_string", - "my_bounded_wstring": "my_bounded_wstring", - "my_char": "e", - "my_double": 0.5, - "my_enum": { - "name": "A", - "value": 0 - }, - "my_float": 0.5, - "my_int8": 1, - "my_long": 1, - "my_longdouble": 0.5, - "my_longlong": 1, - "my_octet": 0, - "my_recursive_alias": { - "name": "A", - "value": 0 - }, - "my_short": 1, - "my_string": "my_string", - "my_uint8": 1, - "my_ulong": 1, - "my_ulonglong": 1, - "my_ushort": 1, - "my_wchar": "e", - "my_wstring": "my_string", - "short_long_map": { - "0": 1 - }, - "short_sequence": [ - 0, - 1 - ], - "string_alias_unbounded_map": null, - "string_unbounded_map": null - } -})"; - - -#endif // EXPECTED_JSON_COMPREHENSIVE_FILLED_EPROSIMA_HPP diff --git a/test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/ComprehensiveTypeFilled_OMG.hpp b/test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/ComprehensiveTypeFilled_OMG.hpp deleted file mode 100644 index 34af275ad90..00000000000 --- a/test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/ComprehensiveTypeFilled_OMG.hpp +++ /dev/null @@ -1,679 +0,0 @@ -// Copyright 2024 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. - -#ifndef EXPECTED_JSON_COMPREHENSIVE_FILLED_OMG_HPP -#define EXPECTED_JSON_COMPREHENSIVE_FILLED_OMG_HPP - -#include - -std::string expected_json_comprehensive_filled_omg = R"({ - "complex_array": [ - { - "bitmask_sequence": [], - "complex_union": { - "fourth": { - "second": 0 - } - }, - "inner_union": { - "second": 0 - }, - "long_array": [ - [ - [ - 1, - 2, - 3, - 4 - ], - [ - 5, - 6, - 7, - 8 - ], - [ - 9, - 10, - 11, - 12 - ] - ], - [ - [ - 13, - 14, - 15, - 16 - ], - [ - 17, - 18, - 19, - 20 - ], - [ - 21, - 22, - 23, - 24 - ] - ] - ], - "my_aliased_bounded_string": "my_aliased_bounded_string", - "my_aliased_enum": "A", - "my_aliased_struct": { - "my_bool": true, - "my_char": "e", - "my_double": 0.5, - "my_float": 0.5, - "my_int8": 1, - "my_long": 1, - "my_longdouble": 0.5, - "my_longlong": 1, - "my_octet": 0, - "my_short": 1, - "my_uint8": 1, - "my_ulong": 1, - "my_ulonglong": 1, - "my_ushort": 1, - "my_wchar": "e" - }, - "my_bitmask": 0, - "my_bitset": { - "a": 0, - "b": false, - "c": 0, - "d": 0 - }, - "my_bool": true, - "my_bounded_string": "my_bounded_string", - "my_bounded_wstring": "my_bounded_wstring", - "my_char": "e", - "my_double": 0.5, - "my_enum": "A", - "my_float": 0.5, - "my_int8": 1, - "my_long": 1, - "my_longdouble": 0.5, - "my_longlong": 1, - "my_octet": 0, - "my_recursive_alias": "A", - "my_short": 1, - "my_string": "my_string", - "my_uint8": 1, - "my_ulong": 1, - "my_ulonglong": 1, - "my_ushort": 1, - "my_wchar": "e", - "my_wstring": "my_string", - "short_long_map": { - "0": 1 - }, - "short_sequence": [ - 0, - 1 - ], - "string_alias_unbounded_map": null, - "string_unbounded_map": null - }, - { - "bitmask_sequence": [], - "complex_union": { - "fourth": { - "second": 0 - } - }, - "inner_union": { - "second": 0 - }, - "long_array": [ - [ - [ - 1, - 2, - 3, - 4 - ], - [ - 5, - 6, - 7, - 8 - ], - [ - 9, - 10, - 11, - 12 - ] - ], - [ - [ - 13, - 14, - 15, - 16 - ], - [ - 17, - 18, - 19, - 20 - ], - [ - 21, - 22, - 23, - 24 - ] - ] - ], - "my_aliased_bounded_string": "my_aliased_bounded_string", - "my_aliased_enum": "A", - "my_aliased_struct": { - "my_bool": true, - "my_char": "e", - "my_double": 0.5, - "my_float": 0.5, - "my_int8": 1, - "my_long": 1, - "my_longdouble": 0.5, - "my_longlong": 1, - "my_octet": 0, - "my_short": 1, - "my_uint8": 1, - "my_ulong": 1, - "my_ulonglong": 1, - "my_ushort": 1, - "my_wchar": "e" - }, - "my_bitmask": 0, - "my_bitset": { - "a": 0, - "b": false, - "c": 0, - "d": 0 - }, - "my_bool": true, - "my_bounded_string": "my_bounded_string", - "my_bounded_wstring": "my_bounded_wstring", - "my_char": "e", - "my_double": 0.5, - "my_enum": "A", - "my_float": 0.5, - "my_int8": 1, - "my_long": 1, - "my_longdouble": 0.5, - "my_longlong": 1, - "my_octet": 0, - "my_recursive_alias": "A", - "my_short": 1, - "my_string": "my_string", - "my_uint8": 1, - "my_ulong": 1, - "my_ulonglong": 1, - "my_ushort": 1, - "my_wchar": "e", - "my_wstring": "my_string", - "short_long_map": { - "0": 1 - }, - "short_sequence": [ - 0, - 1 - ], - "string_alias_unbounded_map": null, - "string_unbounded_map": null - } - ], - "complex_map": { - "0": { - "bitmask_sequence": [], - "complex_union": { - "fourth": { - "second": 0 - } - }, - "inner_union": { - "second": 0 - }, - "long_array": [ - [ - [ - 0, - 0, - 0, - 0 - ], - [ - 0, - 0, - 0, - 0 - ], - [ - 0, - 0, - 0, - 0 - ] - ], - [ - [ - 0, - 0, - 0, - 0 - ], - [ - 0, - 0, - 0, - 0 - ], - [ - 0, - 0, - 0, - 0 - ] - ] - ], - "my_aliased_bounded_string": "", - "my_aliased_enum": "A", - "my_aliased_struct": { - "my_bool": false, - "my_char": "\u0000", - "my_double": 0.0, - "my_float": 0.0, - "my_int8": 0, - "my_long": 0, - "my_longdouble": 0.0, - "my_longlong": 0, - "my_octet": 0, - "my_short": 0, - "my_uint8": 0, - "my_ulong": 0, - "my_ulonglong": 0, - "my_ushort": 0, - "my_wchar": "\u0000" - }, - "my_bitmask": 0, - "my_bitset": { - "a": 0, - "b": false, - "c": 0, - "d": 0 - }, - "my_bool": false, - "my_bounded_string": "", - "my_bounded_wstring": "", - "my_char": "\u0000", - "my_double": 0.0, - "my_enum": "A", - "my_float": 0.0, - "my_int8": 0, - "my_long": 0, - "my_longdouble": 0.0, - "my_longlong": 0, - "my_octet": 0, - "my_recursive_alias": "A", - "my_short": 0, - "my_string": "", - "my_uint8": 0, - "my_ulong": 0, - "my_ulonglong": 0, - "my_ushort": 0, - "my_wchar": "\u0000", - "my_wstring": "", - "short_long_map": null, - "short_sequence": [], - "string_alias_unbounded_map": null, - "string_unbounded_map": null - }, - "1": { - "bitmask_sequence": [], - "complex_union": { - "fourth": { - "second": 0 - } - }, - "inner_union": { - "second": 0 - }, - "long_array": [ - [ - [ - 1, - 2, - 3, - 4 - ], - [ - 5, - 6, - 7, - 8 - ], - [ - 9, - 10, - 11, - 12 - ] - ], - [ - [ - 13, - 14, - 15, - 16 - ], - [ - 17, - 18, - 19, - 20 - ], - [ - 21, - 22, - 23, - 24 - ] - ] - ], - "my_aliased_bounded_string": "my_aliased_bounded_string", - "my_aliased_enum": "A", - "my_aliased_struct": { - "my_bool": true, - "my_char": "e", - "my_double": 0.5, - "my_float": 0.5, - "my_int8": 1, - "my_long": 1, - "my_longdouble": 0.5, - "my_longlong": 1, - "my_octet": 0, - "my_short": 1, - "my_uint8": 1, - "my_ulong": 1, - "my_ulonglong": 1, - "my_ushort": 1, - "my_wchar": "e" - }, - "my_bitmask": 0, - "my_bitset": { - "a": 0, - "b": false, - "c": 0, - "d": 0 - }, - "my_bool": true, - "my_bounded_string": "my_bounded_string", - "my_bounded_wstring": "my_bounded_wstring", - "my_char": "e", - "my_double": 0.5, - "my_enum": "A", - "my_float": 0.5, - "my_int8": 1, - "my_long": 1, - "my_longdouble": 0.5, - "my_longlong": 1, - "my_octet": 0, - "my_recursive_alias": "A", - "my_short": 1, - "my_string": "my_string", - "my_uint8": 1, - "my_ulong": 1, - "my_ulonglong": 1, - "my_ushort": 1, - "my_wchar": "e", - "my_wstring": "my_string", - "short_long_map": { - "0": 1 - }, - "short_sequence": [ - 0, - 1 - ], - "string_alias_unbounded_map": null, - "string_unbounded_map": null - } - }, - "complex_sequence": [ - { - "bitmask_sequence": [], - "complex_union": { - "fourth": { - "second": 0 - } - }, - "inner_union": { - "second": 0 - }, - "long_array": [ - [ - [ - 1, - 2, - 3, - 4 - ], - [ - 5, - 6, - 7, - 8 - ], - [ - 9, - 10, - 11, - 12 - ] - ], - [ - [ - 13, - 14, - 15, - 16 - ], - [ - 17, - 18, - 19, - 20 - ], - [ - 21, - 22, - 23, - 24 - ] - ] - ], - "my_aliased_bounded_string": "my_aliased_bounded_string", - "my_aliased_enum": "A", - "my_aliased_struct": { - "my_bool": true, - "my_char": "e", - "my_double": 0.5, - "my_float": 0.5, - "my_int8": 1, - "my_long": 1, - "my_longdouble": 0.5, - "my_longlong": 1, - "my_octet": 0, - "my_short": 1, - "my_uint8": 1, - "my_ulong": 1, - "my_ulonglong": 1, - "my_ushort": 1, - "my_wchar": "e" - }, - "my_bitmask": 0, - "my_bitset": { - "a": 0, - "b": false, - "c": 0, - "d": 0 - }, - "my_bool": true, - "my_bounded_string": "my_bounded_string", - "my_bounded_wstring": "my_bounded_wstring", - "my_char": "e", - "my_double": 0.5, - "my_enum": "A", - "my_float": 0.5, - "my_int8": 1, - "my_long": 1, - "my_longdouble": 0.5, - "my_longlong": 1, - "my_octet": 0, - "my_recursive_alias": "A", - "my_short": 1, - "my_string": "my_string", - "my_uint8": 1, - "my_ulong": 1, - "my_ulonglong": 1, - "my_ushort": 1, - "my_wchar": "e", - "my_wstring": "my_string", - "short_long_map": { - "0": 1 - }, - "short_sequence": [ - 0, - 1 - ], - "string_alias_unbounded_map": null, - "string_unbounded_map": null - } - ], - "index": 1, - "inner_struct": { - "bitmask_sequence": [], - "complex_union": { - "fourth": { - "second": 0 - } - }, - "inner_union": { - "second": 0 - }, - "long_array": [ - [ - [ - 1, - 2, - 3, - 4 - ], - [ - 5, - 6, - 7, - 8 - ], - [ - 9, - 10, - 11, - 12 - ] - ], - [ - [ - 13, - 14, - 15, - 16 - ], - [ - 17, - 18, - 19, - 20 - ], - [ - 21, - 22, - 23, - 24 - ] - ] - ], - "my_aliased_bounded_string": "my_aliased_bounded_string", - "my_aliased_enum": "A", - "my_aliased_struct": { - "my_bool": true, - "my_char": "e", - "my_double": 0.5, - "my_float": 0.5, - "my_int8": 1, - "my_long": 1, - "my_longdouble": 0.5, - "my_longlong": 1, - "my_octet": 0, - "my_short": 1, - "my_uint8": 1, - "my_ulong": 1, - "my_ulonglong": 1, - "my_ushort": 1, - "my_wchar": "e" - }, - "my_bitmask": 0, - "my_bitset": { - "a": 0, - "b": false, - "c": 0, - "d": 0 - }, - "my_bool": true, - "my_bounded_string": "my_bounded_string", - "my_bounded_wstring": "my_bounded_wstring", - "my_char": "e", - "my_double": 0.5, - "my_enum": "A", - "my_float": 0.5, - "my_int8": 1, - "my_long": 1, - "my_longdouble": 0.5, - "my_longlong": 1, - "my_octet": 0, - "my_recursive_alias": "A", - "my_short": 1, - "my_string": "my_string", - "my_uint8": 1, - "my_ulong": 1, - "my_ulonglong": 1, - "my_ushort": 1, - "my_wchar": "e", - "my_wstring": "my_string", - "short_long_map": { - "0": 1 - }, - "short_sequence": [ - 0, - 1 - ], - "string_alias_unbounded_map": null, - "string_unbounded_map": null - } -})"; - -#endif // EXPECTED_JSON_COMPREHENSIVE_FILLED_OMG_HPP diff --git a/test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/common/ComprehensiveCommon.cpp b/test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/common/ComprehensiveCommon.cpp index 3c81600c7e9..98a4af9322c 100644 --- a/test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/common/ComprehensiveCommon.cpp +++ b/test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/common/ComprehensiveCommon.cpp @@ -71,13 +71,13 @@ void fill_my_enum( switch (index % 3) { case 0: - dyn_data->set_uint32_value(dyn_data->get_member_id_by_name(member_name), 0); + dyn_data->set_int32_value(dyn_data->get_member_id_by_name(member_name), 0); break; case 1: - dyn_data->set_uint32_value(dyn_data->get_member_id_by_name(member_name), 1); + dyn_data->set_int32_value(dyn_data->get_member_id_by_name(member_name), 1); break; case 2: - dyn_data->set_uint32_value(dyn_data->get_member_id_by_name(member_name), 2); + dyn_data->set_int32_value(dyn_data->get_member_id_by_name(member_name), 2); break; } } @@ -100,8 +100,12 @@ void fill_all_struct( // bitmask traits::ref_type dyn_data_my_bitmask = dyn_data->loan_value(dyn_data->get_member_id_by_name("my_bitmask")); - dyn_data_my_bitmask->set_uint32_value(dyn_data_my_bitmask->get_member_id_by_name("flag0"), static_cast(index)); + index % 2 ? dyn_data_my_bitmask->set_boolean_value(dyn_data_my_bitmask->get_member_id_by_name("flag0"), true) : + dyn_data_my_bitmask->set_boolean_value(dyn_data_my_bitmask->get_member_id_by_name("flag0"),false); + // traits::ref_type dyn_data_bitmask_sequence = dyn_data->loan_value(dyn_data->get_member_id_by_name("bitmask_sequence")); + // dyn_data_bitmask_sequence->set_complex_value(dyn_data_bitmask_sequence->get_member_id_by_name("my_bitmask"), dyn_data_my_bitmask); dyn_data->return_loaned_value(dyn_data_my_bitmask); + // dyn_data->return_loaned_value(dyn_data_bitmask_sequence); // alias traits::ref_type dyn_data_my_aliased_struct = dyn_data->loan_value(dyn_data->get_member_id_by_name("my_aliased_struct")); @@ -116,11 +120,9 @@ void fill_all_struct( // // sequences - // UInt32Seq bitmask_seq = {static_cast(index), 0, 0, static_cast(index)}; Int16Seq short_seq = {0, static_cast(index)}; - // dyn_data->set_uint32_values(dyn_data->get_member_id_by_name("bitmask_sequence"), bitmask_seq); dyn_data->set_int16_values(dyn_data->get_member_id_by_name("short_sequence"), short_seq); - // dyn_data->set_uint32_value(dyn_data->get_member_id_by_name("bitmask_sequence"), static_cast(index)); + // array Int32Seq long_array_seq = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24}; @@ -131,6 +133,19 @@ void fill_all_struct( int32_t key {1}; dyn_data_short_long_map->set_int32_value(dyn_data_short_long_map->get_member_id_by_name(std::to_string(key)), static_cast(index)); dyn_data->return_loaned_value(dyn_data_short_long_map); + + // union + traits::ref_type dyn_data_inner_union = dyn_data->loan_value(dyn_data->get_member_id_by_name("inner_union")); + dyn_data_inner_union->set_int64_value(dyn_data_inner_union->get_member_id_by_name("second"), static_cast(index)); + traits::ref_type dyn_data_complex_union = dyn_data->loan_value(dyn_data->get_member_id_by_name("complex_union")); + dyn_data_complex_union->set_complex_value(dyn_data_complex_union->get_member_id_by_name("fourth"), dyn_data_inner_union); + dyn_data->return_loaned_value(dyn_data_complex_union); + dyn_data->return_loaned_value(dyn_data_inner_union); + + // bitset + traits::ref_type dyn_data_my_bitset = dyn_data->loan_value(dyn_data->get_member_id_by_name("my_bitset")); + dyn_data_my_bitset->set_int16_value(dyn_data_my_bitset->get_member_id_by_name("d"), static_cast(index)); + dyn_data->return_loaned_value(dyn_data_my_bitset); } diff --git a/test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/gen/ComprehensiveType.hpp b/test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/gen/ComprehensiveType.hpp index 6d76a5f5a67..3d17f1e1e3e 100644 --- a/test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/gen/ComprehensiveType.hpp +++ b/test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/gen/ComprehensiveType.hpp @@ -703,7 +703,7 @@ class PrimitivesStruct * @brief This class represents the enumeration MyEnum defined by the user in the IDL file. * @ingroup ComprehensiveType */ -enum class MyEnum : uint32_t +enum class MyEnum : int32_t { A, B, diff --git a/test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/gen/ComprehensiveTypePubSubTypes.cxx b/test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/gen/ComprehensiveTypePubSubTypes.cxx index 066d8cec8bc..d8da9c1cd8a 100644 --- a/test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/gen/ComprehensiveTypePubSubTypes.cxx +++ b/test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/gen/ComprehensiveTypePubSubTypes.cxx @@ -57,11 +57,11 @@ PrimitivesStructPubSubType::~PrimitivesStructPubSubType() } bool PrimitivesStructPubSubType::serialize( - void* data, + const void* const data, SerializedPayload_t* payload, DataRepresentationId_t data_representation) { - PrimitivesStruct* p_type = static_cast(data); + const PrimitivesStruct* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); @@ -133,7 +133,7 @@ bool PrimitivesStructPubSubType::deserialize( } std::function PrimitivesStructPubSubType::getSerializedSizeProvider( - void* data, + const void* const data, DataRepresentationId_t data_representation) { return [data, data_representation]() -> uint32_t @@ -150,7 +150,7 @@ std::function PrimitivesStructPubSubType::getSerializedSizeProvider( eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); size_t current_alignment {0}; return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + + *static_cast(data), current_alignment)) + 4u /*encapsulation*/; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) @@ -173,7 +173,7 @@ void PrimitivesStructPubSubType::deleteData( } bool PrimitivesStructPubSubType::getKey( - void* data, + const void* const data, InstanceHandle_t* handle, bool force_md5) { @@ -182,7 +182,7 @@ bool PrimitivesStructPubSubType::getKey( return false; } - PrimitivesStruct* p_type = static_cast(data); + const PrimitivesStruct* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), @@ -259,11 +259,11 @@ AllStructPubSubType::~AllStructPubSubType() } bool AllStructPubSubType::serialize( - void* data, + const void* const data, SerializedPayload_t* payload, DataRepresentationId_t data_representation) { - AllStruct* p_type = static_cast(data); + const AllStruct* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); @@ -335,7 +335,7 @@ bool AllStructPubSubType::deserialize( } std::function AllStructPubSubType::getSerializedSizeProvider( - void* data, + const void* const data, DataRepresentationId_t data_representation) { return [data, data_representation]() -> uint32_t @@ -352,7 +352,7 @@ std::function AllStructPubSubType::getSerializedSizeProvider( eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); size_t current_alignment {0}; return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + + *static_cast(data), current_alignment)) + 4u /*encapsulation*/; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) @@ -375,7 +375,7 @@ void AllStructPubSubType::deleteData( } bool AllStructPubSubType::getKey( - void* data, + const void* const data, InstanceHandle_t* handle, bool force_md5) { @@ -384,7 +384,7 @@ bool AllStructPubSubType::getKey( return false; } - AllStruct* p_type = static_cast(data); + const AllStruct* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), @@ -452,11 +452,11 @@ ComprehensiveTypePubSubType::~ComprehensiveTypePubSubType() } bool ComprehensiveTypePubSubType::serialize( - void* data, + const void* const data, SerializedPayload_t* payload, DataRepresentationId_t data_representation) { - ComprehensiveType* p_type = static_cast(data); + const ComprehensiveType* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); @@ -528,7 +528,7 @@ bool ComprehensiveTypePubSubType::deserialize( } std::function ComprehensiveTypePubSubType::getSerializedSizeProvider( - void* data, + const void* const data, DataRepresentationId_t data_representation) { return [data, data_representation]() -> uint32_t @@ -545,7 +545,7 @@ std::function ComprehensiveTypePubSubType::getSerializedSizeProvider eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); size_t current_alignment {0}; return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + + *static_cast(data), current_alignment)) + 4u /*encapsulation*/; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) @@ -568,7 +568,7 @@ void ComprehensiveTypePubSubType::deleteData( } bool ComprehensiveTypePubSubType::getKey( - void* data, + const void* const data, InstanceHandle_t* handle, bool force_md5) { @@ -577,7 +577,7 @@ bool ComprehensiveTypePubSubType::getKey( return false; } - ComprehensiveType* p_type = static_cast(data); + const ComprehensiveType* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), diff --git a/test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/gen/ComprehensiveTypePubSubTypes.h b/test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/gen/ComprehensiveTypePubSubTypes.h index 27b45d49b24..cfaa2e755e2 100644 --- a/test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/gen/ComprehensiveTypePubSubTypes.h +++ b/test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/gen/ComprehensiveTypePubSubTypes.h @@ -53,14 +53,14 @@ class PrimitivesStructPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport ~PrimitivesStructPubSubType() override; eProsima_user_DllExport bool serialize( - void* data, + 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( - void* data, + const void* const data, eprosima::fastdds::rtps::SerializedPayload_t* payload, eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; @@ -69,17 +69,17 @@ class PrimitivesStructPubSubType : public eprosima::fastdds::dds::TopicDataType void* data) override; eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override + const void* const data) override { return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); } eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, + const void* const data, eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; eProsima_user_DllExport bool getKey( - void* data, + const void* const data, eprosima::fastdds::rtps::InstanceHandle_t* ihandle, bool force_md5 = false) override; @@ -153,14 +153,14 @@ class AllStructPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport ~AllStructPubSubType() override; eProsima_user_DllExport bool serialize( - void* data, + 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( - void* data, + const void* const data, eprosima::fastdds::rtps::SerializedPayload_t* payload, eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; @@ -169,17 +169,17 @@ class AllStructPubSubType : public eprosima::fastdds::dds::TopicDataType void* data) override; eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override + const void* const data) override { return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); } eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, + const void* const data, eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; eProsima_user_DllExport bool getKey( - void* data, + const void* const data, eprosima::fastdds::rtps::InstanceHandle_t* ihandle, bool force_md5 = false) override; @@ -244,14 +244,14 @@ class ComprehensiveTypePubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport ~ComprehensiveTypePubSubType() override; eProsima_user_DllExport bool serialize( - void* data, + 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( - void* data, + const void* const data, eprosima::fastdds::rtps::SerializedPayload_t* payload, eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; @@ -260,17 +260,17 @@ class ComprehensiveTypePubSubType : public eprosima::fastdds::dds::TopicDataType void* data) override; eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override + const void* const data) override { return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); } eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, + const void* const data, eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; eProsima_user_DllExport bool getKey( - void* data, + const void* const data, eprosima::fastdds::rtps::InstanceHandle_t* ihandle, bool force_md5 = false) override; diff --git a/test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/ComprehensiveType_EPROSIMA.hpp b/test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/json/ComprehensiveType_EPROSIMA.hpp similarity index 98% rename from test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/ComprehensiveType_EPROSIMA.hpp rename to test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/json/ComprehensiveType_EPROSIMA.hpp index c3728daaadb..c05f3560cd6 100644 --- a/test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/ComprehensiveType_EPROSIMA.hpp +++ b/test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/json/ComprehensiveType_EPROSIMA.hpp @@ -12,10 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. - -#ifndef EXPECTED_JSON_COMPREHENSIVE_EPROSIMA_HPP -#define EXPECTED_JSON_COMPREHENSIVE_EPROSIMA_HPP - #include std::string expected_json_comprehensive_eprosima = R"({ @@ -376,5 +372,3 @@ std::string expected_json_comprehensive_eprosima = R"({ "string_unbounded_map": null } })"; - -#endif // EXPECTED_JSON_COMPREHENSIVE_EPROSIMA_HPP diff --git a/test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/json/ComprehensiveType_Filled_EPROSIMA.hpp b/test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/json/ComprehensiveType_Filled_EPROSIMA.hpp new file mode 100644 index 00000000000..86a6570e19d --- /dev/null +++ b/test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/json/ComprehensiveType_Filled_EPROSIMA.hpp @@ -0,0 +1,2253 @@ +// Copyright 2024 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. + +#include +#include + +std::string expected_json_comprehensive_filled_eprosima_1 = R"({ + "complex_array": [ + { + "bitmask_sequence": [], + "complex_union": { + "fourth": { + "second": 1 + } + }, + "inner_union": { + "second": 1 + }, + "long_array": [ + [ + [ + 1, + 2, + 3, + 4 + ], + [ + 5, + 6, + 7, + 8 + ], + [ + 9, + 10, + 11, + 12 + ] + ], + [ + [ + 13, + 14, + 15, + 16 + ], + [ + 17, + 18, + 19, + 20 + ], + [ + 21, + 22, + 23, + 24 + ] + ] + ], + "my_aliased_bounded_string": "my_aliased_bounded_string", + "my_aliased_enum": { + "name": "B", + "value": 1 + }, + "my_aliased_struct": { + "my_bool": true, + "my_char": "e", + "my_double": 0.5, + "my_float": 0.5, + "my_int8": 1, + "my_long": 1, + "my_longdouble": 0.5, + "my_longlong": 1, + "my_octet": 0, + "my_short": 1, + "my_uint8": 1, + "my_ulong": 1, + "my_ulonglong": 1, + "my_ushort": 1, + "my_wchar": "e" + }, + "my_bitmask": { + "active": [ + "flag0" + ], + "binary": "00000000000000000000000000000001", + "value": 1 + }, + "my_bitset": { + "a": 0, + "b": false, + "c": 0, + "d": 1 + }, + "my_bool": true, + "my_bounded_string": "my_bounded_string", + "my_bounded_wstring": "my_bounded_wstring", + "my_char": "e", + "my_double": 0.5, + "my_enum": { + "name": "B", + "value": 1 + }, + "my_float": 0.5, + "my_int8": 1, + "my_long": 1, + "my_longdouble": 0.5, + "my_longlong": 1, + "my_octet": 0, + "my_recursive_alias": { + "name": "B", + "value": 1 + }, + "my_short": 1, + "my_string": "my_string", + "my_uint8": 1, + "my_ulong": 1, + "my_ulonglong": 1, + "my_ushort": 1, + "my_wchar": "e", + "my_wstring": "my_string", + "short_long_map": { + "0": 1 + }, + "short_sequence": [ + 0, + 1 + ], + "string_alias_unbounded_map": null, + "string_unbounded_map": null + }, + { + "bitmask_sequence": [], + "complex_union": { + "fourth": { + "second": 1 + } + }, + "inner_union": { + "second": 1 + }, + "long_array": [ + [ + [ + 1, + 2, + 3, + 4 + ], + [ + 5, + 6, + 7, + 8 + ], + [ + 9, + 10, + 11, + 12 + ] + ], + [ + [ + 13, + 14, + 15, + 16 + ], + [ + 17, + 18, + 19, + 20 + ], + [ + 21, + 22, + 23, + 24 + ] + ] + ], + "my_aliased_bounded_string": "my_aliased_bounded_string", + "my_aliased_enum": { + "name": "B", + "value": 1 + }, + "my_aliased_struct": { + "my_bool": true, + "my_char": "e", + "my_double": 0.5, + "my_float": 0.5, + "my_int8": 1, + "my_long": 1, + "my_longdouble": 0.5, + "my_longlong": 1, + "my_octet": 0, + "my_short": 1, + "my_uint8": 1, + "my_ulong": 1, + "my_ulonglong": 1, + "my_ushort": 1, + "my_wchar": "e" + }, + "my_bitmask": { + "active": [ + "flag0" + ], + "binary": "00000000000000000000000000000001", + "value": 1 + }, + "my_bitset": { + "a": 0, + "b": false, + "c": 0, + "d": 1 + }, + "my_bool": true, + "my_bounded_string": "my_bounded_string", + "my_bounded_wstring": "my_bounded_wstring", + "my_char": "e", + "my_double": 0.5, + "my_enum": { + "name": "B", + "value": 1 + }, + "my_float": 0.5, + "my_int8": 1, + "my_long": 1, + "my_longdouble": 0.5, + "my_longlong": 1, + "my_octet": 0, + "my_recursive_alias": { + "name": "B", + "value": 1 + }, + "my_short": 1, + "my_string": "my_string", + "my_uint8": 1, + "my_ulong": 1, + "my_ulonglong": 1, + "my_ushort": 1, + "my_wchar": "e", + "my_wstring": "my_string", + "short_long_map": { + "0": 1 + }, + "short_sequence": [ + 0, + 1 + ], + "string_alias_unbounded_map": null, + "string_unbounded_map": null + } + ], + "complex_map": { + "0": { + "bitmask_sequence": [], + "complex_union": { + "fourth": { + "second": 0 + } + }, + "inner_union": { + "second": 0 + }, + "long_array": [ + [ + [ + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0 + ] + ], + [ + [ + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0 + ] + ] + ], + "my_aliased_bounded_string": "", + "my_aliased_enum": { + "name": "A", + "value": 0 + }, + "my_aliased_struct": { + "my_bool": false, + "my_char": "\u0000", + "my_double": 0.0, + "my_float": 0.0, + "my_int8": 0, + "my_long": 0, + "my_longdouble": 0.0, + "my_longlong": 0, + "my_octet": 0, + "my_short": 0, + "my_uint8": 0, + "my_ulong": 0, + "my_ulonglong": 0, + "my_ushort": 0, + "my_wchar": "\u0000" + }, + "my_bitmask": { + "active": [], + "binary": "00000000000000000000000000000000", + "value": 0 + }, + "my_bitset": { + "a": 0, + "b": false, + "c": 0, + "d": 0 + }, + "my_bool": false, + "my_bounded_string": "", + "my_bounded_wstring": "", + "my_char": "\u0000", + "my_double": 0.0, + "my_enum": { + "name": "A", + "value": 0 + }, + "my_float": 0.0, + "my_int8": 0, + "my_long": 0, + "my_longdouble": 0.0, + "my_longlong": 0, + "my_octet": 0, + "my_recursive_alias": { + "name": "A", + "value": 0 + }, + "my_short": 0, + "my_string": "", + "my_uint8": 0, + "my_ulong": 0, + "my_ulonglong": 0, + "my_ushort": 0, + "my_wchar": "\u0000", + "my_wstring": "", + "short_long_map": null, + "short_sequence": [], + "string_alias_unbounded_map": null, + "string_unbounded_map": null + }, + "1": { + "bitmask_sequence": [], + "complex_union": { + "fourth": { + "second": 1 + } + }, + "inner_union": { + "second": 1 + }, + "long_array": [ + [ + [ + 1, + 2, + 3, + 4 + ], + [ + 5, + 6, + 7, + 8 + ], + [ + 9, + 10, + 11, + 12 + ] + ], + [ + [ + 13, + 14, + 15, + 16 + ], + [ + 17, + 18, + 19, + 20 + ], + [ + 21, + 22, + 23, + 24 + ] + ] + ], + "my_aliased_bounded_string": "my_aliased_bounded_string", + "my_aliased_enum": { + "name": "B", + "value": 1 + }, + "my_aliased_struct": { + "my_bool": true, + "my_char": "e", + "my_double": 0.5, + "my_float": 0.5, + "my_int8": 1, + "my_long": 1, + "my_longdouble": 0.5, + "my_longlong": 1, + "my_octet": 0, + "my_short": 1, + "my_uint8": 1, + "my_ulong": 1, + "my_ulonglong": 1, + "my_ushort": 1, + "my_wchar": "e" + }, + "my_bitmask": { + "active": [ + "flag0" + ], + "binary": "00000000000000000000000000000001", + "value": 1 + }, + "my_bitset": { + "a": 0, + "b": false, + "c": 0, + "d": 1 + }, + "my_bool": true, + "my_bounded_string": "my_bounded_string", + "my_bounded_wstring": "my_bounded_wstring", + "my_char": "e", + "my_double": 0.5, + "my_enum": { + "name": "B", + "value": 1 + }, + "my_float": 0.5, + "my_int8": 1, + "my_long": 1, + "my_longdouble": 0.5, + "my_longlong": 1, + "my_octet": 0, + "my_recursive_alias": { + "name": "B", + "value": 1 + }, + "my_short": 1, + "my_string": "my_string", + "my_uint8": 1, + "my_ulong": 1, + "my_ulonglong": 1, + "my_ushort": 1, + "my_wchar": "e", + "my_wstring": "my_string", + "short_long_map": { + "0": 1 + }, + "short_sequence": [ + 0, + 1 + ], + "string_alias_unbounded_map": null, + "string_unbounded_map": null + } + }, + "complex_sequence": [ + { + "bitmask_sequence": [], + "complex_union": { + "fourth": { + "second": 1 + } + }, + "inner_union": { + "second": 1 + }, + "long_array": [ + [ + [ + 1, + 2, + 3, + 4 + ], + [ + 5, + 6, + 7, + 8 + ], + [ + 9, + 10, + 11, + 12 + ] + ], + [ + [ + 13, + 14, + 15, + 16 + ], + [ + 17, + 18, + 19, + 20 + ], + [ + 21, + 22, + 23, + 24 + ] + ] + ], + "my_aliased_bounded_string": "my_aliased_bounded_string", + "my_aliased_enum": { + "name": "B", + "value": 1 + }, + "my_aliased_struct": { + "my_bool": true, + "my_char": "e", + "my_double": 0.5, + "my_float": 0.5, + "my_int8": 1, + "my_long": 1, + "my_longdouble": 0.5, + "my_longlong": 1, + "my_octet": 0, + "my_short": 1, + "my_uint8": 1, + "my_ulong": 1, + "my_ulonglong": 1, + "my_ushort": 1, + "my_wchar": "e" + }, + "my_bitmask": { + "active": [ + "flag0" + ], + "binary": "00000000000000000000000000000001", + "value": 1 + }, + "my_bitset": { + "a": 0, + "b": false, + "c": 0, + "d": 1 + }, + "my_bool": true, + "my_bounded_string": "my_bounded_string", + "my_bounded_wstring": "my_bounded_wstring", + "my_char": "e", + "my_double": 0.5, + "my_enum": { + "name": "B", + "value": 1 + }, + "my_float": 0.5, + "my_int8": 1, + "my_long": 1, + "my_longdouble": 0.5, + "my_longlong": 1, + "my_octet": 0, + "my_recursive_alias": { + "name": "B", + "value": 1 + }, + "my_short": 1, + "my_string": "my_string", + "my_uint8": 1, + "my_ulong": 1, + "my_ulonglong": 1, + "my_ushort": 1, + "my_wchar": "e", + "my_wstring": "my_string", + "short_long_map": { + "0": 1 + }, + "short_sequence": [ + 0, + 1 + ], + "string_alias_unbounded_map": null, + "string_unbounded_map": null + } + ], + "index": 1, + "inner_struct": { + "bitmask_sequence": [], + "complex_union": { + "fourth": { + "second": 1 + } + }, + "inner_union": { + "second": 1 + }, + "long_array": [ + [ + [ + 1, + 2, + 3, + 4 + ], + [ + 5, + 6, + 7, + 8 + ], + [ + 9, + 10, + 11, + 12 + ] + ], + [ + [ + 13, + 14, + 15, + 16 + ], + [ + 17, + 18, + 19, + 20 + ], + [ + 21, + 22, + 23, + 24 + ] + ] + ], + "my_aliased_bounded_string": "my_aliased_bounded_string", + "my_aliased_enum": { + "name": "B", + "value": 1 + }, + "my_aliased_struct": { + "my_bool": true, + "my_char": "e", + "my_double": 0.5, + "my_float": 0.5, + "my_int8": 1, + "my_long": 1, + "my_longdouble": 0.5, + "my_longlong": 1, + "my_octet": 0, + "my_short": 1, + "my_uint8": 1, + "my_ulong": 1, + "my_ulonglong": 1, + "my_ushort": 1, + "my_wchar": "e" + }, + "my_bitmask": { + "active": [ + "flag0" + ], + "binary": "00000000000000000000000000000001", + "value": 1 + }, + "my_bitset": { + "a": 0, + "b": false, + "c": 0, + "d": 1 + }, + "my_bool": true, + "my_bounded_string": "my_bounded_string", + "my_bounded_wstring": "my_bounded_wstring", + "my_char": "e", + "my_double": 0.5, + "my_enum": { + "name": "B", + "value": 1 + }, + "my_float": 0.5, + "my_int8": 1, + "my_long": 1, + "my_longdouble": 0.5, + "my_longlong": 1, + "my_octet": 0, + "my_recursive_alias": { + "name": "B", + "value": 1 + }, + "my_short": 1, + "my_string": "my_string", + "my_uint8": 1, + "my_ulong": 1, + "my_ulonglong": 1, + "my_ushort": 1, + "my_wchar": "e", + "my_wstring": "my_string", + "short_long_map": { + "0": 1 + }, + "short_sequence": [ + 0, + 1 + ], + "string_alias_unbounded_map": null, + "string_unbounded_map": null + } +})"; + +const std::string expected_json_comprehensive_filled_eprosima_2 = R"({ + "complex_array": [ + { + "bitmask_sequence": [], + "complex_union": { + "fourth": { + "second": 2 + } + }, + "inner_union": { + "second": 2 + }, + "long_array": [ + [ + [ + 1, + 2, + 3, + 4 + ], + [ + 5, + 6, + 7, + 8 + ], + [ + 9, + 10, + 11, + 12 + ] + ], + [ + [ + 13, + 14, + 15, + 16 + ], + [ + 17, + 18, + 19, + 20 + ], + [ + 21, + 22, + 23, + 24 + ] + ] + ], + "my_aliased_bounded_string": "my_aliased_bounded_string", + "my_aliased_enum": { + "name": "C", + "value": 2 + }, + "my_aliased_struct": { + "my_bool": false, + "my_char": "o", + "my_double": 1.0, + "my_float": 1.0, + "my_int8": 2, + "my_long": 2, + "my_longdouble": 1.0, + "my_longlong": 2, + "my_octet": 0, + "my_short": 2, + "my_uint8": 2, + "my_ulong": 2, + "my_ulonglong": 2, + "my_ushort": 2, + "my_wchar": "o" + }, + "my_bitmask": { + "active": [], + "binary": "00000000000000000000000000000000", + "value": 0 + }, + "my_bitset": { + "a": 0, + "b": false, + "c": 0, + "d": 2 + }, + "my_bool": false, + "my_bounded_string": "my_bounded_string", + "my_bounded_wstring": "my_bounded_wstring", + "my_char": "o", + "my_double": 1.0, + "my_enum": { + "name": "C", + "value": 2 + }, + "my_float": 1.0, + "my_int8": 2, + "my_long": 2, + "my_longdouble": 1.0, + "my_longlong": 2, + "my_octet": 0, + "my_recursive_alias": { + "name": "C", + "value": 2 + }, + "my_short": 2, + "my_string": "my_string", + "my_uint8": 2, + "my_ulong": 2, + "my_ulonglong": 2, + "my_ushort": 2, + "my_wchar": "o", + "my_wstring": "my_string", + "short_long_map": { + "0": 2 + }, + "short_sequence": [ + 0, + 2 + ], + "string_alias_unbounded_map": null, + "string_unbounded_map": null + }, + { + "bitmask_sequence": [], + "complex_union": { + "fourth": { + "second": 2 + } + }, + "inner_union": { + "second": 2 + }, + "long_array": [ + [ + [ + 1, + 2, + 3, + 4 + ], + [ + 5, + 6, + 7, + 8 + ], + [ + 9, + 10, + 11, + 12 + ] + ], + [ + [ + 13, + 14, + 15, + 16 + ], + [ + 17, + 18, + 19, + 20 + ], + [ + 21, + 22, + 23, + 24 + ] + ] + ], + "my_aliased_bounded_string": "my_aliased_bounded_string", + "my_aliased_enum": { + "name": "C", + "value": 2 + }, + "my_aliased_struct": { + "my_bool": false, + "my_char": "o", + "my_double": 1.0, + "my_float": 1.0, + "my_int8": 2, + "my_long": 2, + "my_longdouble": 1.0, + "my_longlong": 2, + "my_octet": 0, + "my_short": 2, + "my_uint8": 2, + "my_ulong": 2, + "my_ulonglong": 2, + "my_ushort": 2, + "my_wchar": "o" + }, + "my_bitmask": { + "active": [], + "binary": "00000000000000000000000000000000", + "value": 0 + }, + "my_bitset": { + "a": 0, + "b": false, + "c": 0, + "d": 2 + }, + "my_bool": false, + "my_bounded_string": "my_bounded_string", + "my_bounded_wstring": "my_bounded_wstring", + "my_char": "o", + "my_double": 1.0, + "my_enum": { + "name": "C", + "value": 2 + }, + "my_float": 1.0, + "my_int8": 2, + "my_long": 2, + "my_longdouble": 1.0, + "my_longlong": 2, + "my_octet": 0, + "my_recursive_alias": { + "name": "C", + "value": 2 + }, + "my_short": 2, + "my_string": "my_string", + "my_uint8": 2, + "my_ulong": 2, + "my_ulonglong": 2, + "my_ushort": 2, + "my_wchar": "o", + "my_wstring": "my_string", + "short_long_map": { + "0": 2 + }, + "short_sequence": [ + 0, + 2 + ], + "string_alias_unbounded_map": null, + "string_unbounded_map": null + } + ], + "complex_map": { + "0": { + "bitmask_sequence": [], + "complex_union": { + "fourth": { + "second": 0 + } + }, + "inner_union": { + "second": 0 + }, + "long_array": [ + [ + [ + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0 + ] + ], + [ + [ + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0 + ] + ] + ], + "my_aliased_bounded_string": "", + "my_aliased_enum": { + "name": "A", + "value": 0 + }, + "my_aliased_struct": { + "my_bool": false, + "my_char": "\u0000", + "my_double": 0.0, + "my_float": 0.0, + "my_int8": 0, + "my_long": 0, + "my_longdouble": 0.0, + "my_longlong": 0, + "my_octet": 0, + "my_short": 0, + "my_uint8": 0, + "my_ulong": 0, + "my_ulonglong": 0, + "my_ushort": 0, + "my_wchar": "\u0000" + }, + "my_bitmask": { + "active": [], + "binary": "00000000000000000000000000000000", + "value": 0 + }, + "my_bitset": { + "a": 0, + "b": false, + "c": 0, + "d": 0 + }, + "my_bool": false, + "my_bounded_string": "", + "my_bounded_wstring": "", + "my_char": "\u0000", + "my_double": 0.0, + "my_enum": { + "name": "A", + "value": 0 + }, + "my_float": 0.0, + "my_int8": 0, + "my_long": 0, + "my_longdouble": 0.0, + "my_longlong": 0, + "my_octet": 0, + "my_recursive_alias": { + "name": "A", + "value": 0 + }, + "my_short": 0, + "my_string": "", + "my_uint8": 0, + "my_ulong": 0, + "my_ulonglong": 0, + "my_ushort": 0, + "my_wchar": "\u0000", + "my_wstring": "", + "short_long_map": null, + "short_sequence": [], + "string_alias_unbounded_map": null, + "string_unbounded_map": null + }, + "1": { + "bitmask_sequence": [], + "complex_union": { + "fourth": { + "second": 2 + } + }, + "inner_union": { + "second": 2 + }, + "long_array": [ + [ + [ + 1, + 2, + 3, + 4 + ], + [ + 5, + 6, + 7, + 8 + ], + [ + 9, + 10, + 11, + 12 + ] + ], + [ + [ + 13, + 14, + 15, + 16 + ], + [ + 17, + 18, + 19, + 20 + ], + [ + 21, + 22, + 23, + 24 + ] + ] + ], + "my_aliased_bounded_string": "my_aliased_bounded_string", + "my_aliased_enum": { + "name": "C", + "value": 2 + }, + "my_aliased_struct": { + "my_bool": false, + "my_char": "o", + "my_double": 1.0, + "my_float": 1.0, + "my_int8": 2, + "my_long": 2, + "my_longdouble": 1.0, + "my_longlong": 2, + "my_octet": 0, + "my_short": 2, + "my_uint8": 2, + "my_ulong": 2, + "my_ulonglong": 2, + "my_ushort": 2, + "my_wchar": "o" + }, + "my_bitmask": { + "active": [], + "binary": "00000000000000000000000000000000", + "value": 0 + }, + "my_bitset": { + "a": 0, + "b": false, + "c": 0, + "d": 2 + }, + "my_bool": false, + "my_bounded_string": "my_bounded_string", + "my_bounded_wstring": "my_bounded_wstring", + "my_char": "o", + "my_double": 1.0, + "my_enum": { + "name": "C", + "value": 2 + }, + "my_float": 1.0, + "my_int8": 2, + "my_long": 2, + "my_longdouble": 1.0, + "my_longlong": 2, + "my_octet": 0, + "my_recursive_alias": { + "name": "C", + "value": 2 + }, + "my_short": 2, + "my_string": "my_string", + "my_uint8": 2, + "my_ulong": 2, + "my_ulonglong": 2, + "my_ushort": 2, + "my_wchar": "o", + "my_wstring": "my_string", + "short_long_map": { + "0": 2 + }, + "short_sequence": [ + 0, + 2 + ], + "string_alias_unbounded_map": null, + "string_unbounded_map": null + } + }, + "complex_sequence": [ + { + "bitmask_sequence": [], + "complex_union": { + "fourth": { + "second": 2 + } + }, + "inner_union": { + "second": 2 + }, + "long_array": [ + [ + [ + 1, + 2, + 3, + 4 + ], + [ + 5, + 6, + 7, + 8 + ], + [ + 9, + 10, + 11, + 12 + ] + ], + [ + [ + 13, + 14, + 15, + 16 + ], + [ + 17, + 18, + 19, + 20 + ], + [ + 21, + 22, + 23, + 24 + ] + ] + ], + "my_aliased_bounded_string": "my_aliased_bounded_string", + "my_aliased_enum": { + "name": "C", + "value": 2 + }, + "my_aliased_struct": { + "my_bool": false, + "my_char": "o", + "my_double": 1.0, + "my_float": 1.0, + "my_int8": 2, + "my_long": 2, + "my_longdouble": 1.0, + "my_longlong": 2, + "my_octet": 0, + "my_short": 2, + "my_uint8": 2, + "my_ulong": 2, + "my_ulonglong": 2, + "my_ushort": 2, + "my_wchar": "o" + }, + "my_bitmask": { + "active": [], + "binary": "00000000000000000000000000000000", + "value": 0 + }, + "my_bitset": { + "a": 0, + "b": false, + "c": 0, + "d": 2 + }, + "my_bool": false, + "my_bounded_string": "my_bounded_string", + "my_bounded_wstring": "my_bounded_wstring", + "my_char": "o", + "my_double": 1.0, + "my_enum": { + "name": "C", + "value": 2 + }, + "my_float": 1.0, + "my_int8": 2, + "my_long": 2, + "my_longdouble": 1.0, + "my_longlong": 2, + "my_octet": 0, + "my_recursive_alias": { + "name": "C", + "value": 2 + }, + "my_short": 2, + "my_string": "my_string", + "my_uint8": 2, + "my_ulong": 2, + "my_ulonglong": 2, + "my_ushort": 2, + "my_wchar": "o", + "my_wstring": "my_string", + "short_long_map": { + "0": 2 + }, + "short_sequence": [ + 0, + 2 + ], + "string_alias_unbounded_map": null, + "string_unbounded_map": null + } + ], + "index": 2, + "inner_struct": { + "bitmask_sequence": [], + "complex_union": { + "fourth": { + "second": 2 + } + }, + "inner_union": { + "second": 2 + }, + "long_array": [ + [ + [ + 1, + 2, + 3, + 4 + ], + [ + 5, + 6, + 7, + 8 + ], + [ + 9, + 10, + 11, + 12 + ] + ], + [ + [ + 13, + 14, + 15, + 16 + ], + [ + 17, + 18, + 19, + 20 + ], + [ + 21, + 22, + 23, + 24 + ] + ] + ], + "my_aliased_bounded_string": "my_aliased_bounded_string", + "my_aliased_enum": { + "name": "C", + "value": 2 + }, + "my_aliased_struct": { + "my_bool": false, + "my_char": "o", + "my_double": 1.0, + "my_float": 1.0, + "my_int8": 2, + "my_long": 2, + "my_longdouble": 1.0, + "my_longlong": 2, + "my_octet": 0, + "my_short": 2, + "my_uint8": 2, + "my_ulong": 2, + "my_ulonglong": 2, + "my_ushort": 2, + "my_wchar": "o" + }, + "my_bitmask": { + "active": [], + "binary": "00000000000000000000000000000000", + "value": 0 + }, + "my_bitset": { + "a": 0, + "b": false, + "c": 0, + "d": 2 + }, + "my_bool": false, + "my_bounded_string": "my_bounded_string", + "my_bounded_wstring": "my_bounded_wstring", + "my_char": "o", + "my_double": 1.0, + "my_enum": { + "name": "C", + "value": 2 + }, + "my_float": 1.0, + "my_int8": 2, + "my_long": 2, + "my_longdouble": 1.0, + "my_longlong": 2, + "my_octet": 0, + "my_recursive_alias": { + "name": "C", + "value": 2 + }, + "my_short": 2, + "my_string": "my_string", + "my_uint8": 2, + "my_ulong": 2, + "my_ulonglong": 2, + "my_ushort": 2, + "my_wchar": "o", + "my_wstring": "my_string", + "short_long_map": { + "0": 2 + }, + "short_sequence": [ + 0, + 2 + ], + "string_alias_unbounded_map": null, + "string_unbounded_map": null + } +})"; + +const std::string expected_json_comprehensive_filled_eprosima_3 = R"({ + "complex_array": [ + { + "bitmask_sequence": [], + "complex_union": { + "fourth": { + "second": 3 + } + }, + "inner_union": { + "second": 3 + }, + "long_array": [ + [ + [ + 1, + 2, + 3, + 4 + ], + [ + 5, + 6, + 7, + 8 + ], + [ + 9, + 10, + 11, + 12 + ] + ], + [ + [ + 13, + 14, + 15, + 16 + ], + [ + 17, + 18, + 19, + 20 + ], + [ + 21, + 22, + 23, + 24 + ] + ] + ], + "my_aliased_bounded_string": "my_aliased_bounded_string", + "my_aliased_enum": { + "name": "A", + "value": 0 + }, + "my_aliased_struct": { + "my_bool": true, + "my_char": "e", + "my_double": 1.5, + "my_float": 1.5, + "my_int8": 3, + "my_long": 3, + "my_longdouble": 1.5, + "my_longlong": 3, + "my_octet": 0, + "my_short": 3, + "my_uint8": 3, + "my_ulong": 3, + "my_ulonglong": 3, + "my_ushort": 3, + "my_wchar": "e" + }, + "my_bitmask": { + "active": [ + "flag0" + ], + "binary": "00000000000000000000000000000001", + "value": 1 + }, + "my_bitset": { + "a": 0, + "b": false, + "c": 0, + "d": 3 + }, + "my_bool": true, + "my_bounded_string": "my_bounded_string", + "my_bounded_wstring": "my_bounded_wstring", + "my_char": "e", + "my_double": 1.5, + "my_enum": { + "name": "A", + "value": 0 + }, + "my_float": 1.5, + "my_int8": 3, + "my_long": 3, + "my_longdouble": 1.5, + "my_longlong": 3, + "my_octet": 0, + "my_recursive_alias": { + "name": "A", + "value": 0 + }, + "my_short": 3, + "my_string": "my_string", + "my_uint8": 3, + "my_ulong": 3, + "my_ulonglong": 3, + "my_ushort": 3, + "my_wchar": "e", + "my_wstring": "my_string", + "short_long_map": { + "0": 3 + }, + "short_sequence": [ + 0, + 3 + ], + "string_alias_unbounded_map": null, + "string_unbounded_map": null + }, + { + "bitmask_sequence": [], + "complex_union": { + "fourth": { + "second": 3 + } + }, + "inner_union": { + "second": 3 + }, + "long_array": [ + [ + [ + 1, + 2, + 3, + 4 + ], + [ + 5, + 6, + 7, + 8 + ], + [ + 9, + 10, + 11, + 12 + ] + ], + [ + [ + 13, + 14, + 15, + 16 + ], + [ + 17, + 18, + 19, + 20 + ], + [ + 21, + 22, + 23, + 24 + ] + ] + ], + "my_aliased_bounded_string": "my_aliased_bounded_string", + "my_aliased_enum": { + "name": "A", + "value": 0 + }, + "my_aliased_struct": { + "my_bool": true, + "my_char": "e", + "my_double": 1.5, + "my_float": 1.5, + "my_int8": 3, + "my_long": 3, + "my_longdouble": 1.5, + "my_longlong": 3, + "my_octet": 0, + "my_short": 3, + "my_uint8": 3, + "my_ulong": 3, + "my_ulonglong": 3, + "my_ushort": 3, + "my_wchar": "e" + }, + "my_bitmask": { + "active": [ + "flag0" + ], + "binary": "00000000000000000000000000000001", + "value": 1 + }, + "my_bitset": { + "a": 0, + "b": false, + "c": 0, + "d": 3 + }, + "my_bool": true, + "my_bounded_string": "my_bounded_string", + "my_bounded_wstring": "my_bounded_wstring", + "my_char": "e", + "my_double": 1.5, + "my_enum": { + "name": "A", + "value": 0 + }, + "my_float": 1.5, + "my_int8": 3, + "my_long": 3, + "my_longdouble": 1.5, + "my_longlong": 3, + "my_octet": 0, + "my_recursive_alias": { + "name": "A", + "value": 0 + }, + "my_short": 3, + "my_string": "my_string", + "my_uint8": 3, + "my_ulong": 3, + "my_ulonglong": 3, + "my_ushort": 3, + "my_wchar": "e", + "my_wstring": "my_string", + "short_long_map": { + "0": 3 + }, + "short_sequence": [ + 0, + 3 + ], + "string_alias_unbounded_map": null, + "string_unbounded_map": null + } + ], + "complex_map": { + "0": { + "bitmask_sequence": [], + "complex_union": { + "fourth": { + "second": 0 + } + }, + "inner_union": { + "second": 0 + }, + "long_array": [ + [ + [ + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0 + ] + ], + [ + [ + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0 + ] + ] + ], + "my_aliased_bounded_string": "", + "my_aliased_enum": { + "name": "A", + "value": 0 + }, + "my_aliased_struct": { + "my_bool": false, + "my_char": "\u0000", + "my_double": 0.0, + "my_float": 0.0, + "my_int8": 0, + "my_long": 0, + "my_longdouble": 0.0, + "my_longlong": 0, + "my_octet": 0, + "my_short": 0, + "my_uint8": 0, + "my_ulong": 0, + "my_ulonglong": 0, + "my_ushort": 0, + "my_wchar": "\u0000" + }, + "my_bitmask": { + "active": [], + "binary": "00000000000000000000000000000000", + "value": 0 + }, + "my_bitset": { + "a": 0, + "b": false, + "c": 0, + "d": 0 + }, + "my_bool": false, + "my_bounded_string": "", + "my_bounded_wstring": "", + "my_char": "\u0000", + "my_double": 0.0, + "my_enum": { + "name": "A", + "value": 0 + }, + "my_float": 0.0, + "my_int8": 0, + "my_long": 0, + "my_longdouble": 0.0, + "my_longlong": 0, + "my_octet": 0, + "my_recursive_alias": { + "name": "A", + "value": 0 + }, + "my_short": 0, + "my_string": "", + "my_uint8": 0, + "my_ulong": 0, + "my_ulonglong": 0, + "my_ushort": 0, + "my_wchar": "\u0000", + "my_wstring": "", + "short_long_map": null, + "short_sequence": [], + "string_alias_unbounded_map": null, + "string_unbounded_map": null + }, + "1": { + "bitmask_sequence": [], + "complex_union": { + "fourth": { + "second": 3 + } + }, + "inner_union": { + "second": 3 + }, + "long_array": [ + [ + [ + 1, + 2, + 3, + 4 + ], + [ + 5, + 6, + 7, + 8 + ], + [ + 9, + 10, + 11, + 12 + ] + ], + [ + [ + 13, + 14, + 15, + 16 + ], + [ + 17, + 18, + 19, + 20 + ], + [ + 21, + 22, + 23, + 24 + ] + ] + ], + "my_aliased_bounded_string": "my_aliased_bounded_string", + "my_aliased_enum": { + "name": "A", + "value": 0 + }, + "my_aliased_struct": { + "my_bool": true, + "my_char": "e", + "my_double": 1.5, + "my_float": 1.5, + "my_int8": 3, + "my_long": 3, + "my_longdouble": 1.5, + "my_longlong": 3, + "my_octet": 0, + "my_short": 3, + "my_uint8": 3, + "my_ulong": 3, + "my_ulonglong": 3, + "my_ushort": 3, + "my_wchar": "e" + }, + "my_bitmask": { + "active": [ + "flag0" + ], + "binary": "00000000000000000000000000000001", + "value": 1 + }, + "my_bitset": { + "a": 0, + "b": false, + "c": 0, + "d": 3 + }, + "my_bool": true, + "my_bounded_string": "my_bounded_string", + "my_bounded_wstring": "my_bounded_wstring", + "my_char": "e", + "my_double": 1.5, + "my_enum": { + "name": "A", + "value": 0 + }, + "my_float": 1.5, + "my_int8": 3, + "my_long": 3, + "my_longdouble": 1.5, + "my_longlong": 3, + "my_octet": 0, + "my_recursive_alias": { + "name": "A", + "value": 0 + }, + "my_short": 3, + "my_string": "my_string", + "my_uint8": 3, + "my_ulong": 3, + "my_ulonglong": 3, + "my_ushort": 3, + "my_wchar": "e", + "my_wstring": "my_string", + "short_long_map": { + "0": 3 + }, + "short_sequence": [ + 0, + 3 + ], + "string_alias_unbounded_map": null, + "string_unbounded_map": null + } + }, + "complex_sequence": [ + { + "bitmask_sequence": [], + "complex_union": { + "fourth": { + "second": 3 + } + }, + "inner_union": { + "second": 3 + }, + "long_array": [ + [ + [ + 1, + 2, + 3, + 4 + ], + [ + 5, + 6, + 7, + 8 + ], + [ + 9, + 10, + 11, + 12 + ] + ], + [ + [ + 13, + 14, + 15, + 16 + ], + [ + 17, + 18, + 19, + 20 + ], + [ + 21, + 22, + 23, + 24 + ] + ] + ], + "my_aliased_bounded_string": "my_aliased_bounded_string", + "my_aliased_enum": { + "name": "A", + "value": 0 + }, + "my_aliased_struct": { + "my_bool": true, + "my_char": "e", + "my_double": 1.5, + "my_float": 1.5, + "my_int8": 3, + "my_long": 3, + "my_longdouble": 1.5, + "my_longlong": 3, + "my_octet": 0, + "my_short": 3, + "my_uint8": 3, + "my_ulong": 3, + "my_ulonglong": 3, + "my_ushort": 3, + "my_wchar": "e" + }, + "my_bitmask": { + "active": [ + "flag0" + ], + "binary": "00000000000000000000000000000001", + "value": 1 + }, + "my_bitset": { + "a": 0, + "b": false, + "c": 0, + "d": 3 + }, + "my_bool": true, + "my_bounded_string": "my_bounded_string", + "my_bounded_wstring": "my_bounded_wstring", + "my_char": "e", + "my_double": 1.5, + "my_enum": { + "name": "A", + "value": 0 + }, + "my_float": 1.5, + "my_int8": 3, + "my_long": 3, + "my_longdouble": 1.5, + "my_longlong": 3, + "my_octet": 0, + "my_recursive_alias": { + "name": "A", + "value": 0 + }, + "my_short": 3, + "my_string": "my_string", + "my_uint8": 3, + "my_ulong": 3, + "my_ulonglong": 3, + "my_ushort": 3, + "my_wchar": "e", + "my_wstring": "my_string", + "short_long_map": { + "0": 3 + }, + "short_sequence": [ + 0, + 3 + ], + "string_alias_unbounded_map": null, + "string_unbounded_map": null + } + ], + "index": 3, + "inner_struct": { + "bitmask_sequence": [], + "complex_union": { + "fourth": { + "second": 3 + } + }, + "inner_union": { + "second": 3 + }, + "long_array": [ + [ + [ + 1, + 2, + 3, + 4 + ], + [ + 5, + 6, + 7, + 8 + ], + [ + 9, + 10, + 11, + 12 + ] + ], + [ + [ + 13, + 14, + 15, + 16 + ], + [ + 17, + 18, + 19, + 20 + ], + [ + 21, + 22, + 23, + 24 + ] + ] + ], + "my_aliased_bounded_string": "my_aliased_bounded_string", + "my_aliased_enum": { + "name": "A", + "value": 0 + }, + "my_aliased_struct": { + "my_bool": true, + "my_char": "e", + "my_double": 1.5, + "my_float": 1.5, + "my_int8": 3, + "my_long": 3, + "my_longdouble": 1.5, + "my_longlong": 3, + "my_octet": 0, + "my_short": 3, + "my_uint8": 3, + "my_ulong": 3, + "my_ulonglong": 3, + "my_ushort": 3, + "my_wchar": "e" + }, + "my_bitmask": { + "active": [ + "flag0" + ], + "binary": "00000000000000000000000000000001", + "value": 1 + }, + "my_bitset": { + "a": 0, + "b": false, + "c": 0, + "d": 3 + }, + "my_bool": true, + "my_bounded_string": "my_bounded_string", + "my_bounded_wstring": "my_bounded_wstring", + "my_char": "e", + "my_double": 1.5, + "my_enum": { + "name": "A", + "value": 0 + }, + "my_float": 1.5, + "my_int8": 3, + "my_long": 3, + "my_longdouble": 1.5, + "my_longlong": 3, + "my_octet": 0, + "my_recursive_alias": { + "name": "A", + "value": 0 + }, + "my_short": 3, + "my_string": "my_string", + "my_uint8": 3, + "my_ulong": 3, + "my_ulonglong": 3, + "my_ushort": 3, + "my_wchar": "e", + "my_wstring": "my_string", + "short_long_map": { + "0": 3 + }, + "short_sequence": [ + 0, + 3 + ], + "string_alias_unbounded_map": null, + "string_unbounded_map": null + } +})"; + +std::map expected_json_comprehensive_filled_eprosima = { + {1, expected_json_comprehensive_filled_eprosima_1}, + {2, expected_json_comprehensive_filled_eprosima_2}, + {3, expected_json_comprehensive_filled_eprosima_3}}; + diff --git a/test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/json/ComprehensiveType_Filled_OMG.hpp b/test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/json/ComprehensiveType_Filled_OMG.hpp new file mode 100644 index 00000000000..ef2e744fc18 --- /dev/null +++ b/test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/json/ComprehensiveType_Filled_OMG.hpp @@ -0,0 +1,1998 @@ +// Copyright 2024 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. + +#include +#include + +const std::string expected_json_comprehensive_filled_omg_1 = R"({ + "complex_array": [ + { + "bitmask_sequence": [], + "complex_union": { + "fourth": { + "second": 1 + } + }, + "inner_union": { + "second": 1 + }, + "long_array": [ + [ + [ + 1, + 2, + 3, + 4 + ], + [ + 5, + 6, + 7, + 8 + ], + [ + 9, + 10, + 11, + 12 + ] + ], + [ + [ + 13, + 14, + 15, + 16 + ], + [ + 17, + 18, + 19, + 20 + ], + [ + 21, + 22, + 23, + 24 + ] + ] + ], + "my_aliased_bounded_string": "my_aliased_bounded_string", + "my_aliased_enum": "B", + "my_aliased_struct": { + "my_bool": true, + "my_char": "e", + "my_double": 0.5, + "my_float": 0.5, + "my_int8": 1, + "my_long": 1, + "my_longdouble": 0.5, + "my_longlong": 1, + "my_octet": 0, + "my_short": 1, + "my_uint8": 1, + "my_ulong": 1, + "my_ulonglong": 1, + "my_ushort": 1, + "my_wchar": "e" + }, + "my_bitmask": 1, + "my_bitset": { + "a": 0, + "b": false, + "c": 0, + "d": 1 + }, + "my_bool": true, + "my_bounded_string": "my_bounded_string", + "my_bounded_wstring": "my_bounded_wstring", + "my_char": "e", + "my_double": 0.5, + "my_enum": "B", + "my_float": 0.5, + "my_int8": 1, + "my_long": 1, + "my_longdouble": 0.5, + "my_longlong": 1, + "my_octet": 0, + "my_recursive_alias": "B", + "my_short": 1, + "my_string": "my_string", + "my_uint8": 1, + "my_ulong": 1, + "my_ulonglong": 1, + "my_ushort": 1, + "my_wchar": "e", + "my_wstring": "my_string", + "short_long_map": { + "0": 1 + }, + "short_sequence": [ + 0, + 1 + ], + "string_alias_unbounded_map": null, + "string_unbounded_map": null + }, + { + "bitmask_sequence": [], + "complex_union": { + "fourth": { + "second": 1 + } + }, + "inner_union": { + "second": 1 + }, + "long_array": [ + [ + [ + 1, + 2, + 3, + 4 + ], + [ + 5, + 6, + 7, + 8 + ], + [ + 9, + 10, + 11, + 12 + ] + ], + [ + [ + 13, + 14, + 15, + 16 + ], + [ + 17, + 18, + 19, + 20 + ], + [ + 21, + 22, + 23, + 24 + ] + ] + ], + "my_aliased_bounded_string": "my_aliased_bounded_string", + "my_aliased_enum": "B", + "my_aliased_struct": { + "my_bool": true, + "my_char": "e", + "my_double": 0.5, + "my_float": 0.5, + "my_int8": 1, + "my_long": 1, + "my_longdouble": 0.5, + "my_longlong": 1, + "my_octet": 0, + "my_short": 1, + "my_uint8": 1, + "my_ulong": 1, + "my_ulonglong": 1, + "my_ushort": 1, + "my_wchar": "e" + }, + "my_bitmask": 1, + "my_bitset": { + "a": 0, + "b": false, + "c": 0, + "d": 1 + }, + "my_bool": true, + "my_bounded_string": "my_bounded_string", + "my_bounded_wstring": "my_bounded_wstring", + "my_char": "e", + "my_double": 0.5, + "my_enum": "B", + "my_float": 0.5, + "my_int8": 1, + "my_long": 1, + "my_longdouble": 0.5, + "my_longlong": 1, + "my_octet": 0, + "my_recursive_alias": "B", + "my_short": 1, + "my_string": "my_string", + "my_uint8": 1, + "my_ulong": 1, + "my_ulonglong": 1, + "my_ushort": 1, + "my_wchar": "e", + "my_wstring": "my_string", + "short_long_map": { + "0": 1 + }, + "short_sequence": [ + 0, + 1 + ], + "string_alias_unbounded_map": null, + "string_unbounded_map": null + } + ], + "complex_map": { + "0": { + "bitmask_sequence": [], + "complex_union": { + "fourth": { + "second": 0 + } + }, + "inner_union": { + "second": 0 + }, + "long_array": [ + [ + [ + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0 + ] + ], + [ + [ + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0 + ] + ] + ], + "my_aliased_bounded_string": "", + "my_aliased_enum": "A", + "my_aliased_struct": { + "my_bool": false, + "my_char": "\u0000", + "my_double": 0.0, + "my_float": 0.0, + "my_int8": 0, + "my_long": 0, + "my_longdouble": 0.0, + "my_longlong": 0, + "my_octet": 0, + "my_short": 0, + "my_uint8": 0, + "my_ulong": 0, + "my_ulonglong": 0, + "my_ushort": 0, + "my_wchar": "\u0000" + }, + "my_bitmask": 0, + "my_bitset": { + "a": 0, + "b": false, + "c": 0, + "d": 0 + }, + "my_bool": false, + "my_bounded_string": "", + "my_bounded_wstring": "", + "my_char": "\u0000", + "my_double": 0.0, + "my_enum": "A", + "my_float": 0.0, + "my_int8": 0, + "my_long": 0, + "my_longdouble": 0.0, + "my_longlong": 0, + "my_octet": 0, + "my_recursive_alias": "A", + "my_short": 0, + "my_string": "", + "my_uint8": 0, + "my_ulong": 0, + "my_ulonglong": 0, + "my_ushort": 0, + "my_wchar": "\u0000", + "my_wstring": "", + "short_long_map": null, + "short_sequence": [], + "string_alias_unbounded_map": null, + "string_unbounded_map": null + }, + "1": { + "bitmask_sequence": [], + "complex_union": { + "fourth": { + "second": 1 + } + }, + "inner_union": { + "second": 1 + }, + "long_array": [ + [ + [ + 1, + 2, + 3, + 4 + ], + [ + 5, + 6, + 7, + 8 + ], + [ + 9, + 10, + 11, + 12 + ] + ], + [ + [ + 13, + 14, + 15, + 16 + ], + [ + 17, + 18, + 19, + 20 + ], + [ + 21, + 22, + 23, + 24 + ] + ] + ], + "my_aliased_bounded_string": "my_aliased_bounded_string", + "my_aliased_enum": "B", + "my_aliased_struct": { + "my_bool": true, + "my_char": "e", + "my_double": 0.5, + "my_float": 0.5, + "my_int8": 1, + "my_long": 1, + "my_longdouble": 0.5, + "my_longlong": 1, + "my_octet": 0, + "my_short": 1, + "my_uint8": 1, + "my_ulong": 1, + "my_ulonglong": 1, + "my_ushort": 1, + "my_wchar": "e" + }, + "my_bitmask": 1, + "my_bitset": { + "a": 0, + "b": false, + "c": 0, + "d": 1 + }, + "my_bool": true, + "my_bounded_string": "my_bounded_string", + "my_bounded_wstring": "my_bounded_wstring", + "my_char": "e", + "my_double": 0.5, + "my_enum": "B", + "my_float": 0.5, + "my_int8": 1, + "my_long": 1, + "my_longdouble": 0.5, + "my_longlong": 1, + "my_octet": 0, + "my_recursive_alias": "B", + "my_short": 1, + "my_string": "my_string", + "my_uint8": 1, + "my_ulong": 1, + "my_ulonglong": 1, + "my_ushort": 1, + "my_wchar": "e", + "my_wstring": "my_string", + "short_long_map": { + "0": 1 + }, + "short_sequence": [ + 0, + 1 + ], + "string_alias_unbounded_map": null, + "string_unbounded_map": null + } + }, + "complex_sequence": [ + { + "bitmask_sequence": [], + "complex_union": { + "fourth": { + "second": 1 + } + }, + "inner_union": { + "second": 1 + }, + "long_array": [ + [ + [ + 1, + 2, + 3, + 4 + ], + [ + 5, + 6, + 7, + 8 + ], + [ + 9, + 10, + 11, + 12 + ] + ], + [ + [ + 13, + 14, + 15, + 16 + ], + [ + 17, + 18, + 19, + 20 + ], + [ + 21, + 22, + 23, + 24 + ] + ] + ], + "my_aliased_bounded_string": "my_aliased_bounded_string", + "my_aliased_enum": "B", + "my_aliased_struct": { + "my_bool": true, + "my_char": "e", + "my_double": 0.5, + "my_float": 0.5, + "my_int8": 1, + "my_long": 1, + "my_longdouble": 0.5, + "my_longlong": 1, + "my_octet": 0, + "my_short": 1, + "my_uint8": 1, + "my_ulong": 1, + "my_ulonglong": 1, + "my_ushort": 1, + "my_wchar": "e" + }, + "my_bitmask": 1, + "my_bitset": { + "a": 0, + "b": false, + "c": 0, + "d": 1 + }, + "my_bool": true, + "my_bounded_string": "my_bounded_string", + "my_bounded_wstring": "my_bounded_wstring", + "my_char": "e", + "my_double": 0.5, + "my_enum": "B", + "my_float": 0.5, + "my_int8": 1, + "my_long": 1, + "my_longdouble": 0.5, + "my_longlong": 1, + "my_octet": 0, + "my_recursive_alias": "B", + "my_short": 1, + "my_string": "my_string", + "my_uint8": 1, + "my_ulong": 1, + "my_ulonglong": 1, + "my_ushort": 1, + "my_wchar": "e", + "my_wstring": "my_string", + "short_long_map": { + "0": 1 + }, + "short_sequence": [ + 0, + 1 + ], + "string_alias_unbounded_map": null, + "string_unbounded_map": null + } + ], + "index": 1, + "inner_struct": { + "bitmask_sequence": [], + "complex_union": { + "fourth": { + "second": 1 + } + }, + "inner_union": { + "second": 1 + }, + "long_array": [ + [ + [ + 1, + 2, + 3, + 4 + ], + [ + 5, + 6, + 7, + 8 + ], + [ + 9, + 10, + 11, + 12 + ] + ], + [ + [ + 13, + 14, + 15, + 16 + ], + [ + 17, + 18, + 19, + 20 + ], + [ + 21, + 22, + 23, + 24 + ] + ] + ], + "my_aliased_bounded_string": "my_aliased_bounded_string", + "my_aliased_enum": "B", + "my_aliased_struct": { + "my_bool": true, + "my_char": "e", + "my_double": 0.5, + "my_float": 0.5, + "my_int8": 1, + "my_long": 1, + "my_longdouble": 0.5, + "my_longlong": 1, + "my_octet": 0, + "my_short": 1, + "my_uint8": 1, + "my_ulong": 1, + "my_ulonglong": 1, + "my_ushort": 1, + "my_wchar": "e" + }, + "my_bitmask": 1, + "my_bitset": { + "a": 0, + "b": false, + "c": 0, + "d": 1 + }, + "my_bool": true, + "my_bounded_string": "my_bounded_string", + "my_bounded_wstring": "my_bounded_wstring", + "my_char": "e", + "my_double": 0.5, + "my_enum": "B", + "my_float": 0.5, + "my_int8": 1, + "my_long": 1, + "my_longdouble": 0.5, + "my_longlong": 1, + "my_octet": 0, + "my_recursive_alias": "B", + "my_short": 1, + "my_string": "my_string", + "my_uint8": 1, + "my_ulong": 1, + "my_ulonglong": 1, + "my_ushort": 1, + "my_wchar": "e", + "my_wstring": "my_string", + "short_long_map": { + "0": 1 + }, + "short_sequence": [ + 0, + 1 + ], + "string_alias_unbounded_map": null, + "string_unbounded_map": null + } +})"; + +const std::string expected_json_comprehensive_filled_omg_2 = R"({ + "complex_array": [ + { + "bitmask_sequence": [], + "complex_union": { + "fourth": { + "second": 2 + } + }, + "inner_union": { + "second": 2 + }, + "long_array": [ + [ + [ + 1, + 2, + 3, + 4 + ], + [ + 5, + 6, + 7, + 8 + ], + [ + 9, + 10, + 11, + 12 + ] + ], + [ + [ + 13, + 14, + 15, + 16 + ], + [ + 17, + 18, + 19, + 20 + ], + [ + 21, + 22, + 23, + 24 + ] + ] + ], + "my_aliased_bounded_string": "my_aliased_bounded_string", + "my_aliased_enum": "C", + "my_aliased_struct": { + "my_bool": false, + "my_char": "o", + "my_double": 1.0, + "my_float": 1.0, + "my_int8": 2, + "my_long": 2, + "my_longdouble": 1.0, + "my_longlong": 2, + "my_octet": 0, + "my_short": 2, + "my_uint8": 2, + "my_ulong": 2, + "my_ulonglong": 2, + "my_ushort": 2, + "my_wchar": "o" + }, + "my_bitmask": 0, + "my_bitset": { + "a": 0, + "b": false, + "c": 0, + "d": 2 + }, + "my_bool": false, + "my_bounded_string": "my_bounded_string", + "my_bounded_wstring": "my_bounded_wstring", + "my_char": "o", + "my_double": 1.0, + "my_enum": "C", + "my_float": 1.0, + "my_int8": 2, + "my_long": 2, + "my_longdouble": 1.0, + "my_longlong": 2, + "my_octet": 0, + "my_recursive_alias": "C", + "my_short": 2, + "my_string": "my_string", + "my_uint8": 2, + "my_ulong": 2, + "my_ulonglong": 2, + "my_ushort": 2, + "my_wchar": "o", + "my_wstring": "my_string", + "short_long_map": { + "0": 2 + }, + "short_sequence": [ + 0, + 2 + ], + "string_alias_unbounded_map": null, + "string_unbounded_map": null + }, + { + "bitmask_sequence": [], + "complex_union": { + "fourth": { + "second": 2 + } + }, + "inner_union": { + "second": 2 + }, + "long_array": [ + [ + [ + 1, + 2, + 3, + 4 + ], + [ + 5, + 6, + 7, + 8 + ], + [ + 9, + 10, + 11, + 12 + ] + ], + [ + [ + 13, + 14, + 15, + 16 + ], + [ + 17, + 18, + 19, + 20 + ], + [ + 21, + 22, + 23, + 24 + ] + ] + ], + "my_aliased_bounded_string": "my_aliased_bounded_string", + "my_aliased_enum": "C", + "my_aliased_struct": { + "my_bool": false, + "my_char": "o", + "my_double": 1.0, + "my_float": 1.0, + "my_int8": 2, + "my_long": 2, + "my_longdouble": 1.0, + "my_longlong": 2, + "my_octet": 0, + "my_short": 2, + "my_uint8": 2, + "my_ulong": 2, + "my_ulonglong": 2, + "my_ushort": 2, + "my_wchar": "o" + }, + "my_bitmask": 0, + "my_bitset": { + "a": 0, + "b": false, + "c": 0, + "d": 2 + }, + "my_bool": false, + "my_bounded_string": "my_bounded_string", + "my_bounded_wstring": "my_bounded_wstring", + "my_char": "o", + "my_double": 1.0, + "my_enum": "C", + "my_float": 1.0, + "my_int8": 2, + "my_long": 2, + "my_longdouble": 1.0, + "my_longlong": 2, + "my_octet": 0, + "my_recursive_alias": "C", + "my_short": 2, + "my_string": "my_string", + "my_uint8": 2, + "my_ulong": 2, + "my_ulonglong": 2, + "my_ushort": 2, + "my_wchar": "o", + "my_wstring": "my_string", + "short_long_map": { + "0": 2 + }, + "short_sequence": [ + 0, + 2 + ], + "string_alias_unbounded_map": null, + "string_unbounded_map": null + } + ], + "complex_map": { + "0": { + "bitmask_sequence": [], + "complex_union": { + "fourth": { + "second": 0 + } + }, + "inner_union": { + "second": 0 + }, + "long_array": [ + [ + [ + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0 + ] + ], + [ + [ + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0 + ] + ] + ], + "my_aliased_bounded_string": "", + "my_aliased_enum": "A", + "my_aliased_struct": { + "my_bool": false, + "my_char": "\u0000", + "my_double": 0.0, + "my_float": 0.0, + "my_int8": 0, + "my_long": 0, + "my_longdouble": 0.0, + "my_longlong": 0, + "my_octet": 0, + "my_short": 0, + "my_uint8": 0, + "my_ulong": 0, + "my_ulonglong": 0, + "my_ushort": 0, + "my_wchar": "\u0000" + }, + "my_bitmask": 0, + "my_bitset": { + "a": 0, + "b": false, + "c": 0, + "d": 0 + }, + "my_bool": false, + "my_bounded_string": "", + "my_bounded_wstring": "", + "my_char": "\u0000", + "my_double": 0.0, + "my_enum": "A", + "my_float": 0.0, + "my_int8": 0, + "my_long": 0, + "my_longdouble": 0.0, + "my_longlong": 0, + "my_octet": 0, + "my_recursive_alias": "A", + "my_short": 0, + "my_string": "", + "my_uint8": 0, + "my_ulong": 0, + "my_ulonglong": 0, + "my_ushort": 0, + "my_wchar": "\u0000", + "my_wstring": "", + "short_long_map": null, + "short_sequence": [], + "string_alias_unbounded_map": null, + "string_unbounded_map": null + }, + "1": { + "bitmask_sequence": [], + "complex_union": { + "fourth": { + "second": 2 + } + }, + "inner_union": { + "second": 2 + }, + "long_array": [ + [ + [ + 1, + 2, + 3, + 4 + ], + [ + 5, + 6, + 7, + 8 + ], + [ + 9, + 10, + 11, + 12 + ] + ], + [ + [ + 13, + 14, + 15, + 16 + ], + [ + 17, + 18, + 19, + 20 + ], + [ + 21, + 22, + 23, + 24 + ] + ] + ], + "my_aliased_bounded_string": "my_aliased_bounded_string", + "my_aliased_enum": "C", + "my_aliased_struct": { + "my_bool": false, + "my_char": "o", + "my_double": 1.0, + "my_float": 1.0, + "my_int8": 2, + "my_long": 2, + "my_longdouble": 1.0, + "my_longlong": 2, + "my_octet": 0, + "my_short": 2, + "my_uint8": 2, + "my_ulong": 2, + "my_ulonglong": 2, + "my_ushort": 2, + "my_wchar": "o" + }, + "my_bitmask": 0, + "my_bitset": { + "a": 0, + "b": false, + "c": 0, + "d": 2 + }, + "my_bool": false, + "my_bounded_string": "my_bounded_string", + "my_bounded_wstring": "my_bounded_wstring", + "my_char": "o", + "my_double": 1.0, + "my_enum": "C", + "my_float": 1.0, + "my_int8": 2, + "my_long": 2, + "my_longdouble": 1.0, + "my_longlong": 2, + "my_octet": 0, + "my_recursive_alias": "C", + "my_short": 2, + "my_string": "my_string", + "my_uint8": 2, + "my_ulong": 2, + "my_ulonglong": 2, + "my_ushort": 2, + "my_wchar": "o", + "my_wstring": "my_string", + "short_long_map": { + "0": 2 + }, + "short_sequence": [ + 0, + 2 + ], + "string_alias_unbounded_map": null, + "string_unbounded_map": null + } + }, + "complex_sequence": [ + { + "bitmask_sequence": [], + "complex_union": { + "fourth": { + "second": 2 + } + }, + "inner_union": { + "second": 2 + }, + "long_array": [ + [ + [ + 1, + 2, + 3, + 4 + ], + [ + 5, + 6, + 7, + 8 + ], + [ + 9, + 10, + 11, + 12 + ] + ], + [ + [ + 13, + 14, + 15, + 16 + ], + [ + 17, + 18, + 19, + 20 + ], + [ + 21, + 22, + 23, + 24 + ] + ] + ], + "my_aliased_bounded_string": "my_aliased_bounded_string", + "my_aliased_enum": "C", + "my_aliased_struct": { + "my_bool": false, + "my_char": "o", + "my_double": 1.0, + "my_float": 1.0, + "my_int8": 2, + "my_long": 2, + "my_longdouble": 1.0, + "my_longlong": 2, + "my_octet": 0, + "my_short": 2, + "my_uint8": 2, + "my_ulong": 2, + "my_ulonglong": 2, + "my_ushort": 2, + "my_wchar": "o" + }, + "my_bitmask": 0, + "my_bitset": { + "a": 0, + "b": false, + "c": 0, + "d": 2 + }, + "my_bool": false, + "my_bounded_string": "my_bounded_string", + "my_bounded_wstring": "my_bounded_wstring", + "my_char": "o", + "my_double": 1.0, + "my_enum": "C", + "my_float": 1.0, + "my_int8": 2, + "my_long": 2, + "my_longdouble": 1.0, + "my_longlong": 2, + "my_octet": 0, + "my_recursive_alias": "C", + "my_short": 2, + "my_string": "my_string", + "my_uint8": 2, + "my_ulong": 2, + "my_ulonglong": 2, + "my_ushort": 2, + "my_wchar": "o", + "my_wstring": "my_string", + "short_long_map": { + "0": 2 + }, + "short_sequence": [ + 0, + 2 + ], + "string_alias_unbounded_map": null, + "string_unbounded_map": null + } + ], + "index": 2, + "inner_struct": { + "bitmask_sequence": [], + "complex_union": { + "fourth": { + "second": 2 + } + }, + "inner_union": { + "second": 2 + }, + "long_array": [ + [ + [ + 1, + 2, + 3, + 4 + ], + [ + 5, + 6, + 7, + 8 + ], + [ + 9, + 10, + 11, + 12 + ] + ], + [ + [ + 13, + 14, + 15, + 16 + ], + [ + 17, + 18, + 19, + 20 + ], + [ + 21, + 22, + 23, + 24 + ] + ] + ], + "my_aliased_bounded_string": "my_aliased_bounded_string", + "my_aliased_enum": "C", + "my_aliased_struct": { + "my_bool": false, + "my_char": "o", + "my_double": 1.0, + "my_float": 1.0, + "my_int8": 2, + "my_long": 2, + "my_longdouble": 1.0, + "my_longlong": 2, + "my_octet": 0, + "my_short": 2, + "my_uint8": 2, + "my_ulong": 2, + "my_ulonglong": 2, + "my_ushort": 2, + "my_wchar": "o" + }, + "my_bitmask": 0, + "my_bitset": { + "a": 0, + "b": false, + "c": 0, + "d": 2 + }, + "my_bool": false, + "my_bounded_string": "my_bounded_string", + "my_bounded_wstring": "my_bounded_wstring", + "my_char": "o", + "my_double": 1.0, + "my_enum": "C", + "my_float": 1.0, + "my_int8": 2, + "my_long": 2, + "my_longdouble": 1.0, + "my_longlong": 2, + "my_octet": 0, + "my_recursive_alias": "C", + "my_short": 2, + "my_string": "my_string", + "my_uint8": 2, + "my_ulong": 2, + "my_ulonglong": 2, + "my_ushort": 2, + "my_wchar": "o", + "my_wstring": "my_string", + "short_long_map": { + "0": 2 + }, + "short_sequence": [ + 0, + 2 + ], + "string_alias_unbounded_map": null, + "string_unbounded_map": null + } +})"; + +const std::string expected_json_comprehensive_filled_omg_3 = R"({ + "complex_array": [ + { + "bitmask_sequence": [], + "complex_union": { + "fourth": { + "second": 3 + } + }, + "inner_union": { + "second": 3 + }, + "long_array": [ + [ + [ + 1, + 2, + 3, + 4 + ], + [ + 5, + 6, + 7, + 8 + ], + [ + 9, + 10, + 11, + 12 + ] + ], + [ + [ + 13, + 14, + 15, + 16 + ], + [ + 17, + 18, + 19, + 20 + ], + [ + 21, + 22, + 23, + 24 + ] + ] + ], + "my_aliased_bounded_string": "my_aliased_bounded_string", + "my_aliased_enum": "A", + "my_aliased_struct": { + "my_bool": true, + "my_char": "e", + "my_double": 1.5, + "my_float": 1.5, + "my_int8": 3, + "my_long": 3, + "my_longdouble": 1.5, + "my_longlong": 3, + "my_octet": 0, + "my_short": 3, + "my_uint8": 3, + "my_ulong": 3, + "my_ulonglong": 3, + "my_ushort": 3, + "my_wchar": "e" + }, + "my_bitmask": 1, + "my_bitset": { + "a": 0, + "b": false, + "c": 0, + "d": 3 + }, + "my_bool": true, + "my_bounded_string": "my_bounded_string", + "my_bounded_wstring": "my_bounded_wstring", + "my_char": "e", + "my_double": 1.5, + "my_enum": "A", + "my_float": 1.5, + "my_int8": 3, + "my_long": 3, + "my_longdouble": 1.5, + "my_longlong": 3, + "my_octet": 0, + "my_recursive_alias": "A", + "my_short": 3, + "my_string": "my_string", + "my_uint8": 3, + "my_ulong": 3, + "my_ulonglong": 3, + "my_ushort": 3, + "my_wchar": "e", + "my_wstring": "my_string", + "short_long_map": { + "0": 3 + }, + "short_sequence": [ + 0, + 3 + ], + "string_alias_unbounded_map": null, + "string_unbounded_map": null + }, + { + "bitmask_sequence": [], + "complex_union": { + "fourth": { + "second": 3 + } + }, + "inner_union": { + "second": 3 + }, + "long_array": [ + [ + [ + 1, + 2, + 3, + 4 + ], + [ + 5, + 6, + 7, + 8 + ], + [ + 9, + 10, + 11, + 12 + ] + ], + [ + [ + 13, + 14, + 15, + 16 + ], + [ + 17, + 18, + 19, + 20 + ], + [ + 21, + 22, + 23, + 24 + ] + ] + ], + "my_aliased_bounded_string": "my_aliased_bounded_string", + "my_aliased_enum": "A", + "my_aliased_struct": { + "my_bool": true, + "my_char": "e", + "my_double": 1.5, + "my_float": 1.5, + "my_int8": 3, + "my_long": 3, + "my_longdouble": 1.5, + "my_longlong": 3, + "my_octet": 0, + "my_short": 3, + "my_uint8": 3, + "my_ulong": 3, + "my_ulonglong": 3, + "my_ushort": 3, + "my_wchar": "e" + }, + "my_bitmask": 1, + "my_bitset": { + "a": 0, + "b": false, + "c": 0, + "d": 3 + }, + "my_bool": true, + "my_bounded_string": "my_bounded_string", + "my_bounded_wstring": "my_bounded_wstring", + "my_char": "e", + "my_double": 1.5, + "my_enum": "A", + "my_float": 1.5, + "my_int8": 3, + "my_long": 3, + "my_longdouble": 1.5, + "my_longlong": 3, + "my_octet": 0, + "my_recursive_alias": "A", + "my_short": 3, + "my_string": "my_string", + "my_uint8": 3, + "my_ulong": 3, + "my_ulonglong": 3, + "my_ushort": 3, + "my_wchar": "e", + "my_wstring": "my_string", + "short_long_map": { + "0": 3 + }, + "short_sequence": [ + 0, + 3 + ], + "string_alias_unbounded_map": null, + "string_unbounded_map": null + } + ], + "complex_map": { + "0": { + "bitmask_sequence": [], + "complex_union": { + "fourth": { + "second": 0 + } + }, + "inner_union": { + "second": 0 + }, + "long_array": [ + [ + [ + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0 + ] + ], + [ + [ + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0 + ] + ] + ], + "my_aliased_bounded_string": "", + "my_aliased_enum": "A", + "my_aliased_struct": { + "my_bool": false, + "my_char": "\u0000", + "my_double": 0.0, + "my_float": 0.0, + "my_int8": 0, + "my_long": 0, + "my_longdouble": 0.0, + "my_longlong": 0, + "my_octet": 0, + "my_short": 0, + "my_uint8": 0, + "my_ulong": 0, + "my_ulonglong": 0, + "my_ushort": 0, + "my_wchar": "\u0000" + }, + "my_bitmask": 0, + "my_bitset": { + "a": 0, + "b": false, + "c": 0, + "d": 0 + }, + "my_bool": false, + "my_bounded_string": "", + "my_bounded_wstring": "", + "my_char": "\u0000", + "my_double": 0.0, + "my_enum": "A", + "my_float": 0.0, + "my_int8": 0, + "my_long": 0, + "my_longdouble": 0.0, + "my_longlong": 0, + "my_octet": 0, + "my_recursive_alias": "A", + "my_short": 0, + "my_string": "", + "my_uint8": 0, + "my_ulong": 0, + "my_ulonglong": 0, + "my_ushort": 0, + "my_wchar": "\u0000", + "my_wstring": "", + "short_long_map": null, + "short_sequence": [], + "string_alias_unbounded_map": null, + "string_unbounded_map": null + }, + "1": { + "bitmask_sequence": [], + "complex_union": { + "fourth": { + "second": 3 + } + }, + "inner_union": { + "second": 3 + }, + "long_array": [ + [ + [ + 1, + 2, + 3, + 4 + ], + [ + 5, + 6, + 7, + 8 + ], + [ + 9, + 10, + 11, + 12 + ] + ], + [ + [ + 13, + 14, + 15, + 16 + ], + [ + 17, + 18, + 19, + 20 + ], + [ + 21, + 22, + 23, + 24 + ] + ] + ], + "my_aliased_bounded_string": "my_aliased_bounded_string", + "my_aliased_enum": "A", + "my_aliased_struct": { + "my_bool": true, + "my_char": "e", + "my_double": 1.5, + "my_float": 1.5, + "my_int8": 3, + "my_long": 3, + "my_longdouble": 1.5, + "my_longlong": 3, + "my_octet": 0, + "my_short": 3, + "my_uint8": 3, + "my_ulong": 3, + "my_ulonglong": 3, + "my_ushort": 3, + "my_wchar": "e" + }, + "my_bitmask": 1, + "my_bitset": { + "a": 0, + "b": false, + "c": 0, + "d": 3 + }, + "my_bool": true, + "my_bounded_string": "my_bounded_string", + "my_bounded_wstring": "my_bounded_wstring", + "my_char": "e", + "my_double": 1.5, + "my_enum": "A", + "my_float": 1.5, + "my_int8": 3, + "my_long": 3, + "my_longdouble": 1.5, + "my_longlong": 3, + "my_octet": 0, + "my_recursive_alias": "A", + "my_short": 3, + "my_string": "my_string", + "my_uint8": 3, + "my_ulong": 3, + "my_ulonglong": 3, + "my_ushort": 3, + "my_wchar": "e", + "my_wstring": "my_string", + "short_long_map": { + "0": 3 + }, + "short_sequence": [ + 0, + 3 + ], + "string_alias_unbounded_map": null, + "string_unbounded_map": null + } + }, + "complex_sequence": [ + { + "bitmask_sequence": [], + "complex_union": { + "fourth": { + "second": 3 + } + }, + "inner_union": { + "second": 3 + }, + "long_array": [ + [ + [ + 1, + 2, + 3, + 4 + ], + [ + 5, + 6, + 7, + 8 + ], + [ + 9, + 10, + 11, + 12 + ] + ], + [ + [ + 13, + 14, + 15, + 16 + ], + [ + 17, + 18, + 19, + 20 + ], + [ + 21, + 22, + 23, + 24 + ] + ] + ], + "my_aliased_bounded_string": "my_aliased_bounded_string", + "my_aliased_enum": "A", + "my_aliased_struct": { + "my_bool": true, + "my_char": "e", + "my_double": 1.5, + "my_float": 1.5, + "my_int8": 3, + "my_long": 3, + "my_longdouble": 1.5, + "my_longlong": 3, + "my_octet": 0, + "my_short": 3, + "my_uint8": 3, + "my_ulong": 3, + "my_ulonglong": 3, + "my_ushort": 3, + "my_wchar": "e" + }, + "my_bitmask": 1, + "my_bitset": { + "a": 0, + "b": false, + "c": 0, + "d": 3 + }, + "my_bool": true, + "my_bounded_string": "my_bounded_string", + "my_bounded_wstring": "my_bounded_wstring", + "my_char": "e", + "my_double": 1.5, + "my_enum": "A", + "my_float": 1.5, + "my_int8": 3, + "my_long": 3, + "my_longdouble": 1.5, + "my_longlong": 3, + "my_octet": 0, + "my_recursive_alias": "A", + "my_short": 3, + "my_string": "my_string", + "my_uint8": 3, + "my_ulong": 3, + "my_ulonglong": 3, + "my_ushort": 3, + "my_wchar": "e", + "my_wstring": "my_string", + "short_long_map": { + "0": 3 + }, + "short_sequence": [ + 0, + 3 + ], + "string_alias_unbounded_map": null, + "string_unbounded_map": null + } + ], + "index": 3, + "inner_struct": { + "bitmask_sequence": [], + "complex_union": { + "fourth": { + "second": 3 + } + }, + "inner_union": { + "second": 3 + }, + "long_array": [ + [ + [ + 1, + 2, + 3, + 4 + ], + [ + 5, + 6, + 7, + 8 + ], + [ + 9, + 10, + 11, + 12 + ] + ], + [ + [ + 13, + 14, + 15, + 16 + ], + [ + 17, + 18, + 19, + 20 + ], + [ + 21, + 22, + 23, + 24 + ] + ] + ], + "my_aliased_bounded_string": "my_aliased_bounded_string", + "my_aliased_enum": "A", + "my_aliased_struct": { + "my_bool": true, + "my_char": "e", + "my_double": 1.5, + "my_float": 1.5, + "my_int8": 3, + "my_long": 3, + "my_longdouble": 1.5, + "my_longlong": 3, + "my_octet": 0, + "my_short": 3, + "my_uint8": 3, + "my_ulong": 3, + "my_ulonglong": 3, + "my_ushort": 3, + "my_wchar": "e" + }, + "my_bitmask": 1, + "my_bitset": { + "a": 0, + "b": false, + "c": 0, + "d": 3 + }, + "my_bool": true, + "my_bounded_string": "my_bounded_string", + "my_bounded_wstring": "my_bounded_wstring", + "my_char": "e", + "my_double": 1.5, + "my_enum": "A", + "my_float": 1.5, + "my_int8": 3, + "my_long": 3, + "my_longdouble": 1.5, + "my_longlong": 3, + "my_octet": 0, + "my_recursive_alias": "A", + "my_short": 3, + "my_string": "my_string", + "my_uint8": 3, + "my_ulong": 3, + "my_ulonglong": 3, + "my_ushort": 3, + "my_wchar": "e", + "my_wstring": "my_string", + "short_long_map": { + "0": 3 + }, + "short_sequence": [ + 0, + 3 + ], + "string_alias_unbounded_map": null, + "string_unbounded_map": null + } +})"; + +std::map expected_json_comprehensive_filled_omg = { + {1, expected_json_comprehensive_filled_omg_1}, + {2, expected_json_comprehensive_filled_omg_2}, + {3, expected_json_comprehensive_filled_omg_3}}; diff --git a/test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/ComprehensiveType_OMG.hpp b/test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/json/ComprehensiveType_OMG.hpp similarity index 98% rename from test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/ComprehensiveType_OMG.hpp rename to test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/json/ComprehensiveType_OMG.hpp index b0c0b87633c..94c4db0c345 100644 --- a/test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/ComprehensiveType_OMG.hpp +++ b/test/unittest/dds/xtypes/dyndata_json/types/comprehensive_type/json/ComprehensiveType_OMG.hpp @@ -14,9 +14,6 @@ #include -#ifndef EXPECTED_JSON_COMPREHENSIVE_OMG_HPP -#define EXPECTED_JSON_COMPREHENSIVE_OMG_HPP - std::string expected_json_comprehensive_omg = R"({ "complex_array": [ { @@ -337,5 +334,3 @@ std::string expected_json_comprehensive_omg = R"({ } })"; - -#endif // EXPECTED_JSON_COMPREHENSIVE_OMG_HPP