From 5a1dd450f8d247d096b870d402c48e20cf21bd1b Mon Sep 17 00:00:00 2001 From: Eduardo Ponz Segrelles Date: Mon, 25 Mar 2024 22:38:47 +0100 Subject: [PATCH 01/33] Do not build test if CMake < 3.22 (#204) Signed-off-by: EduPonz --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 729d47da..f3d9428f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -132,7 +132,11 @@ enable_testing() include(CTest) if (BUILD_TESTING) - add_subdirectory(test) + if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.22) + add_subdirectory(test) + else() + message(INFO "Tests are disabled because the version of CMake is less than 3.22") + endif() endif() ############################################################################### From 444f0a10c9e87dc97bad6e8648d79651123a3471 Mon Sep 17 00:00:00 2001 From: Miguel Company Date: Tue, 26 Mar 2024 12:34:23 +0100 Subject: [PATCH 02/33] Bump version to v2.2.1 (#205) * Refs #20693. Bump version in CMakeLists.txt Signed-off-by: Miguel Company * Refs #20693. Bump version in package.xml Signed-off-by: Miguel Company --------- Signed-off-by: Miguel Company --- CMakeLists.txt | 2 +- package.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f3d9428f..0455331c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,7 @@ endif() ############################################################################### # Project # ############################################################################### -project(fastcdr VERSION 2.2.0 LANGUAGES CXX) +project(fastcdr VERSION 2.2.1 LANGUAGES CXX) set(PROJECT_NAME_STYLED "FastCDR") set(PROJECT_NAME_LARGE "Fast CDR") diff --git a/package.xml b/package.xml index 21ef2c69..7853ff87 100644 --- a/package.xml +++ b/package.xml @@ -2,7 +2,7 @@ fastcdr - 2.2.0 + 2.2.1 *eProsima Fast CDR* is a C++ serialization library implementing the Common Data Representation (CDR) mechanism defined by the Object Management Group (OMG) consortium. CDR is the serialization mechanism used in DDS for the DDS Interoperability Wire Protocol (DDSI-RTPS). From f44cbf67c10dc3438e9dd96ded8d1b28c9abc075 Mon Sep 17 00:00:00 2001 From: Miguel Company Date: Tue, 26 Mar 2024 14:59:31 +0100 Subject: [PATCH 03/33] Change version in package.xml format (#206) Signed-off-by: Miguel Company --- package.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.xml b/package.xml index 7853ff87..a42ac774 100644 --- a/package.xml +++ b/package.xml @@ -1,6 +1,6 @@ - + fastcdr 2.2.1 From 75b2be7d6ee208e635a3451c46dc075e5d1c97e3 Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Fri, 29 Mar 2024 06:45:11 -0400 Subject: [PATCH 04/33] Fix a compile warning with g++ 13.2.0. (#207) * Fix a compile warning with g++ 13.2.0. When building the tests with g++ 13.2.0, it complains that the EXPECT_LONG_DOUBLE_EQ macro has no effect. That ends up being true; because it is just a x == y, with no EXPECT statement around it, it actually does nothing. Here, I just remove this macro because it is unnecessary; we can just do EXPECT_TRUE(x == y) and get the same effect with less code. Signed-off-by: Chris Lalancette * Revert "Fix a compile warning with g++ 13.2.0." This reverts commit 28b32def439aa891aceda784f786100f6a59c280. Signed-off-by: Miguel Company * Refactor EXPECT_LONG_DOUBLE_EQ. Signed-off-by: Miguel Company * Make expectations be checked. Signed-off-by: Miguel Company --------- Signed-off-by: Chris Lalancette Signed-off-by: Miguel Company Co-authored-by: Miguel Company --- test/cdr/ResizeTest.cpp | 9 +++++++-- test/cdr/SimpleTest.cpp | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/test/cdr/ResizeTest.cpp b/test/cdr/ResizeTest.cpp index 18aa337f..559e948c 100644 --- a/test/cdr/ResizeTest.cpp +++ b/test/cdr/ResizeTest.cpp @@ -22,8 +22,6 @@ #include -#define EXPECT_LONG_DOUBLE_EQ(val1, val2) (val1 == val2) - using namespace eprosima::fastcdr; using namespace ::exception; @@ -180,6 +178,13 @@ static void EXPECT_ARRAY_DOUBLE_EQ( } } +static void EXPECT_LONG_DOUBLE_EQ( + const long double val1, + const long double val2) +{ + EXPECT_TRUE(val1 == val2); +} + static void EXPECT_ARRAY_LONG_DOUBLE_EQ( long double* array1, const long double* array2, diff --git a/test/cdr/SimpleTest.cpp b/test/cdr/SimpleTest.cpp index 9a9b70a5..29807edf 100644 --- a/test/cdr/SimpleTest.cpp +++ b/test/cdr/SimpleTest.cpp @@ -25,8 +25,6 @@ #include -#define EXPECT_LONG_DOUBLE_EQ(val1, val2) (val1 == val2) - using namespace eprosima::fastcdr; using namespace ::exception; @@ -194,6 +192,13 @@ static void EXPECT_ARRAY_DOUBLE_EQ( } } +static void EXPECT_LONG_DOUBLE_EQ( + const long double val1, + const long double val2) +{ + EXPECT_TRUE(val1 == val2); +} + static void EXPECT_ARRAY_LONG_DOUBLE_EQ( long double* array1, const long double* array2, From f889eee5880f521931214a1f8aa11efcd003b421 Mon Sep 17 00:00:00 2001 From: Eduardo Ponz Segrelles Date: Tue, 14 May 2024 08:22:36 +0200 Subject: [PATCH 05/33] Extend mirror workflow to also mirror in major branches (#208) * Refs #20893: Extend mirror workflow to also mirror in major branches Signed-off-by: eduponz * Refs #20893: Apply Miguel's suggestion Signed-off-by: eduponz --------- Signed-off-by: eduponz --- .github/workflows/mirror.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/mirror.yml b/.github/workflows/mirror.yml index 8675bb8f..6308eafd 100644 --- a/.github/workflows/mirror.yml +++ b/.github/workflows/mirror.yml @@ -3,8 +3,10 @@ on: push: branches: - 'master' + - '1.1.x' jobs: - mirror_job: + mirror_job_master: + if: github.ref == 'refs/heads/master' runs-on: ubuntu-latest name: Mirror master branch to API & ABI compatible minor version branches strategy: @@ -12,6 +14,7 @@ jobs: matrix: dest_branch: - '2.2.x' + - '2.x' steps: - name: Mirror action step id: mirror @@ -20,3 +23,20 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} source: 'master' dest: ${{ matrix.dest_branch }} + mirror_job_1_x: + if: github.ref == 'refs/heads/1.1.x' + runs-on: ubuntu-latest + name: Mirror 1.1.x branch to API & ABI compatible minor version branches + strategy: + fail-fast: false + matrix: + dest_branch: + - '1.x' + steps: + - name: Mirror action step + id: mirror + uses: eProsima/eProsima-CI/external/mirror-branch-action@v0 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + source: '1.1.x' + dest: ${{ matrix.dest_branch }} From 24d9e72f3aa8aab91d2e5e6422f2b5ce90490cb6 Mon Sep 17 00:00:00 2001 From: Eduardo Ponz Segrelles Date: Fri, 21 Jun 2024 08:16:08 +0200 Subject: [PATCH 06/33] Bump version to 2.2.2 (#212) Signed-off-by: eduponz --- CMakeLists.txt | 2 +- package.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0455331c..72a11756 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,7 @@ endif() ############################################################################### # Project # ############################################################################### -project(fastcdr VERSION 2.2.1 LANGUAGES CXX) +project(fastcdr VERSION 2.2.2 LANGUAGES CXX) set(PROJECT_NAME_STYLED "FastCDR") set(PROJECT_NAME_LARGE "Fast CDR") diff --git a/package.xml b/package.xml index a42ac774..0a742ac5 100644 --- a/package.xml +++ b/package.xml @@ -2,7 +2,7 @@ fastcdr - 2.2.1 + 2.2.2 *eProsima Fast CDR* is a C++ serialization library implementing the Common Data Representation (CDR) mechanism defined by the Object Management Group (OMG) consortium. CDR is the serialization mechanism used in DDS for the DDS Interoperability Wire Protocol (DDSI-RTPS). From 88d524b1ac400ec1c05ef05bffa1c2f24de291f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Poderoso?= <120394830+JesusPoderoso@users.noreply.github.com> Date: Tue, 9 Jul 2024 10:28:11 +0200 Subject: [PATCH 07/33] Add PR template (#203) * Refs #20414: Add PR template Signed-off-by: JesusPoderoso * Refs #20414: Apply rev suggestions Signed-off-by: JesusPoderoso * Refs #20414: Apply rev suggestions (2) Signed-off-by: JesusPoderoso --------- Signed-off-by: JesusPoderoso --- .github/pull_request_template.md | 50 ++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..93e41fcb --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,50 @@ + + + + + +## Description + + + + + + + + + + + +## Contributor Checklist + + + +- [ ] Commit messages follow the project guidelines. +- [ ] The code follows the style guidelines of this project. +- [ ] Tests that thoroughly check the new feature have been added/Regression tests checking the bug and its fix have been added; the added tests pass locally +- [ ] Any new/modified methods have been properly documented using Doxygen. +- [ ] Changes are ABI compatible. +- [ ] Changes are API compatible. +- [ ] New feature has been added to the `versions.md` file (if applicable). +- [ ] Applicable backports have been included in the description. + +## Reviewer Checklist + +- [ ] The PR has a milestone assigned. +- [ ] The title and description correctly express the PR's purpose. +- [ ] Check contributor checklist is correct. +- [ ] Check CI results: changes do not issue any warning. +- [ ] Check CI results: CI pass and failing tests are unrelated with the changes. From 0aa63eb104fdca2749add976451129daf2c63ed2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Dom=C3=ADnguez=20L=C3=B3pez?= <116071334+Mario-DL@users.noreply.github.com> Date: Wed, 10 Jul 2024 10:15:49 +0200 Subject: [PATCH 08/33] Update references to Fast DDS (#215) * Refs #21323: Update references to Fast RTPS Signed-off-by: Mario Dominguez * Refs #21323: Rename to FASTCDR Signed-off-by: Mario Dominguez --------- Signed-off-by: Mario Dominguez --- cmake/packaging/Config.cmake.in | 2 +- doc/README.html.in | 2 +- src/cpp/CMakeLists.txt | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmake/packaging/Config.cmake.in b/cmake/packaging/Config.cmake.in index 510075a5..aeb8179c 100644 --- a/cmake/packaging/Config.cmake.in +++ b/cmake/packaging/Config.cmake.in @@ -16,7 +16,7 @@ set(@PROJECT_NAME@_VERSION @PROJECT_VERSION@) @PACKAGE_INIT@ -@FASTRTPS_PACKAGE_OPT_BIN_DIR_CONDITION@ +@FASTCDR_PACKAGE_OPT_BIN_DIR_CONDITION@ set_and_check(@PROJECT_NAME@_BIN_DIR "@PACKAGE_BIN_INSTALL_DIR@") endif() set_and_check(@PROJECT_NAME@_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@") diff --git a/doc/README.html.in b/doc/README.html.in index 1f29da40..68336b3e 100644 --- a/doc/README.html.in +++ b/doc/README.html.in @@ -1259,7 +1259,7 @@




diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt index 7ac643b6..7ed04422 100644 --- a/src/cpp/CMakeLists.txt +++ b/src/cpp/CMakeLists.txt @@ -173,9 +173,9 @@ endif() include(CMakePackageConfigHelpers) if(BUILD_SHARED_LIBS) - set(FASTRTPS_PACKAGE_OPT_BIN_DIR_CONDITION "if(MSVC OR MSVC_IDE)") + set(FASTCDR_PACKAGE_OPT_BIN_DIR_CONDITION "if(MSVC OR MSVC_IDE)") else() - set(FASTRTPS_PACKAGE_OPT_BIN_DIR_CONDITION "if(0)") + set(FASTCDR_PACKAGE_OPT_BIN_DIR_CONDITION "if(0)") endif() configure_package_config_file(${PROJECT_SOURCE_DIR}/cmake/packaging/Config.cmake.in From 203725d86441b1effe927d3d0cd9449dfd07952a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Poderoso?= <120394830+JesusPoderoso@users.noreply.github.com> Date: Thu, 11 Jul 2024 16:24:37 +0200 Subject: [PATCH 09/33] Improve CI workflows in master (#216) * Refs #21286: Add Ubuntu CI Signed-off-by: JesusPoderoso * Refs #21286: Add Windows CI Signed-off-by: JesusPoderoso * Refs #21286: Add MacOS CI Signed-off-by: JesusPoderoso * Refs #21286: Remove previous job Signed-off-by: JesusPoderoso * Refs #21286: Update PR template Signed-off-by: JesusPoderoso * Refs #21286: Add missing dependency Signed-off-by: JesusPoderoso * Refs #21286: Fix colcon test warning Signed-off-by: JesusPoderoso * Refs #21286: Add RELEASE_SUPPORT.md Signed-off-by: JesusPoderoso * Refs #21286: Apply rev suggestions Signed-off-by: JesusPoderoso * Refs #21286: Fix labels Signed-off-by: JesusPoderoso * Refs #21286: Try to fix windows CI Signed-off-by: JesusPoderoso * Refs #21286: Include GitHub CI badges in readme Signed-off-by: JesusPoderoso --------- Signed-off-by: JesusPoderoso --- .github/pull_request_template.md | 4 +- .../config/{colcon.meta => build.meta} | 4 + .github/workflows/config/test.meta | 7 + .github/workflows/config/test.repos | 5 + .github/workflows/fastcdr-test.yml | 135 --------------- .github/workflows/mac-ci.yml | 59 +++++++ .github/workflows/nightly-mac-ci.yml | 57 +++++++ .github/workflows/nightly-ubuntu-ci.yml | 57 +++++++ .github/workflows/nightly-windows-ci.yml | 92 ++++++++++ .github/workflows/reusable-ci.yml | 159 ++++++++++++++++++ .github/workflows/ubuntu-ci.yml | 65 +++++++ .github/workflows/windows-ci.yml | 71 ++++++++ README.md | 6 +- RELEASE_SUPPORT.md | 19 +++ 14 files changed, 600 insertions(+), 140 deletions(-) rename .github/workflows/config/{colcon.meta => build.meta} (71%) create mode 100644 .github/workflows/config/test.meta create mode 100644 .github/workflows/config/test.repos delete mode 100644 .github/workflows/fastcdr-test.yml create mode 100644 .github/workflows/mac-ci.yml create mode 100644 .github/workflows/nightly-mac-ci.yml create mode 100644 .github/workflows/nightly-ubuntu-ci.yml create mode 100644 .github/workflows/nightly-windows-ci.yml create mode 100644 .github/workflows/reusable-ci.yml create mode 100644 .github/workflows/ubuntu-ci.yml create mode 100644 .github/workflows/windows-ci.yml create mode 100644 RELEASE_SUPPORT.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 93e41fcb..2ca237c4 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -17,7 +17,7 @@ In case of bug fixes, please provide the list of supported branches where this fix should be also merged. Please uncomment following line, adjusting the corresponding target branches for the backport. --> - + @@ -36,7 +36,7 @@ - [ ] The code follows the style guidelines of this project. - [ ] Tests that thoroughly check the new feature have been added/Regression tests checking the bug and its fix have been added; the added tests pass locally - [ ] Any new/modified methods have been properly documented using Doxygen. -- [ ] Changes are ABI compatible. +- [ ] Changes are backport compatible: they do **NOT** break ABI nor change library core behavior. - [ ] Changes are API compatible. - [ ] New feature has been added to the `versions.md` file (if applicable). - [ ] Applicable backports have been included in the description. diff --git a/.github/workflows/config/colcon.meta b/.github/workflows/config/build.meta similarity index 71% rename from .github/workflows/config/colcon.meta rename to .github/workflows/config/build.meta index c4684d9e..6cc502de 100644 --- a/.github/workflows/config/colcon.meta +++ b/.github/workflows/config/build.meta @@ -1,6 +1,10 @@ names: + fastcdr: + cmake-args: + - "-DBUILD_TESTING=ON" googletest-distribution: cmake-args: - "-Dgtest_force_shared_crt=ON" - "-DBUILD_SHARED_LIBS=ON" - "-DBUILD_GMOCK=ON" + diff --git a/.github/workflows/config/test.meta b/.github/workflows/config/test.meta new file mode 100644 index 00000000..9112ed4a --- /dev/null +++ b/.github/workflows/config/test.meta @@ -0,0 +1,7 @@ +names: + fastcdr: + ctest-args: [ + "--repeat", "until-pass:3", + "--timeout", "300", + "--output-junit", "junit/junit.xml" + ] diff --git a/.github/workflows/config/test.repos b/.github/workflows/config/test.repos new file mode 100644 index 00000000..5052ee82 --- /dev/null +++ b/.github/workflows/config/test.repos @@ -0,0 +1,5 @@ +repositories: + googletest-distribution: + type: git + url: https://github.com/google/googletest.git + version: release-1.11.0 diff --git a/.github/workflows/fastcdr-test.yml b/.github/workflows/fastcdr-test.yml deleted file mode 100644 index 4b754521..00000000 --- a/.github/workflows/fastcdr-test.yml +++ /dev/null @@ -1,135 +0,0 @@ -# CI for Fast CDR repository -# The Action is triggered with a PR or push and every night at 00:00 -# Additionally, it can be also triggered manually - -name: Fast-CDR-test - -on: - - schedule: - - cron: '0 0 * * *' - - push: - branches: - - master - - 2.2.x - - 2.1.x - - 1.1.x - - 1.0.x - - workflow_dispatch: - inputs: - cmake_args: - description: 'Optional CMake arguments' - required: false - type: string - default: '' - ctest_args: - description: 'Optional CTest arguments' - required: false - type: string - default: '' - - pull_request: - branches: - - master - - 2.2.x - - 2.1.x - - 1.1.x - - 1.0.x - paths-ignore: - - '**.md' - - '**.txt' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - build-and-test: - name: Colcon build and test - - if: ${{ !(contains(github.event.pull_request.labels.*.name, 'no-test') || - contains(github.event.pull_request.labels.*.name, 'skip-ci')) }} - - runs-on: ${{ matrix.runner-image }} - strategy: - fail-fast: false - matrix: - runner-image: - - 'ubuntu-20.04' - - 'ubuntu-22.04' - - 'windows-2019' - - 'macos-13' - - steps: - - name: Sync eProsima/Fast-CDR repository - uses: eProsima/eProsima-CI/external/checkout@v0 - with: - path: src/Fast-CDR - - - name: Sync GTest - uses: eProsima/eProsima-CI/external/checkout@v0 - with: - path: src/googletest - repository: google/googletest - ref: 'release-1.12.1' - - - uses: eProsima/eProsima-CI/external/setup-python@v0 - with: - python-version: '3.11' - - - name: Get minimum supported version of CMake - uses: eProsima/eProsima-CI/external/get-cmake@v0 - with: - cmakeVersion: '3.22.6' - - - name: Install Colcon dependencies - uses: eProsima/eProsima-CI/multiplatform/install_colcon@v0 - - - name: Colcon build - uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 - with: - colcon_meta_file: ${{ github.workspace }}/src/Fast-CDR/.github/workflows/config/colcon.meta - colcon_build_args_default: --event-handlers=console_direct+ - cmake_args: ${{ inputs.cmake_args }} - cmake_args_default: -DBUILD_TESTING=ON - cmake_build_type: RelWithDebInfo - workspace: ${{ github.workspace }} - - - name: Colcon test - id: test - uses: eProsima/eProsima-CI/multiplatform/colcon_test@v0 - with: - colcon_test_args_default: --event-handlers=console_direct+ --return-code-on-test-failure - ctest_args: ${{ inputs.ctest_args }} - ctest_args_default: --repeat until-pass:3 --timeout 300 --output-junit junit/junit.xml - packages_names: fastcdr - workspace: ${{ github.workspace }} - - - name: Test summary - uses: eProsima/eProsima-CI/multiplatform/junit_summary@v0 - if: ${{ !cancelled() && !contains(github.event.pull_request.labels.*.name, 'no-test') }} - with: - junit_reports_dir: ${{ steps.test.outputs.ctest_results_path }} - print_summary: 'True' - show_failed: 'True' - show_disabled: 'False' - show_skipped: 'False' - - - name: Test Report - uses: eProsima/eProsima-CI/external/test-reporter@v0 - if: ${{ !cancelled() && !contains(github.event.pull_request.labels.*.name, 'no-test') }} - with: - name: "Report: ${{ matrix.runner-image }}" - path: "${{ steps.test.outputs.ctest_results_path }}*.xml" - working-directory: 'src/Fast-CDR' - path-replace-backslashes: 'true' - list-tests: 'failed' - - - name: Archive Test Results - if: always() - uses: eProsima/eProsima-CI/external/upload-artifact@v0 - with: - name: test-results-${{ matrix.runner-image }} - path: log/latest_test/fastcdr diff --git a/.github/workflows/mac-ci.yml b/.github/workflows/mac-ci.yml new file mode 100644 index 00000000..9ea93930 --- /dev/null +++ b/.github/workflows/mac-ci.yml @@ -0,0 +1,59 @@ +name: Fast CDR Mac CI + +on: + workflow_dispatch: + inputs: + os-version: + description: 'OS version to run the workflow' + required: false + default: 'macos-13' + type: string + colcon-args: + description: 'Extra arguments for colcon cli' + required: false + type: string + cmake-args: + description: 'Extra arguments for cmake cli' + required: false + type: string + ctest-args: + description: 'Extra arguments for ctest cli' + required: false + type: string + fastcdr-branch: + description: 'Branch or tag of Fast CDR repository' + type: string + required: true + run-tests: + description: 'Run test suite of Fast CDR' + required: false + type: boolean + default: true + + pull_request: + types: + - review_requested + paths-ignore: + - '**.md' + - '**.txt' + - '!**/CMakeLists.txt' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + mac-ci: + if: ${{ !(github.event_name == 'pull_request') || !contains(github.event.pull_request.labels.*.name, 'conflicts') }} + uses: ./.github/workflows/reusable-ci.yml + with: + # It would be desirable to have a matrix of macos OS for this job, but due to the issue opened in this ticket: + # https://github.com/orgs/community/discussions/128118 , it has been set as a single OS job. + os-version: ${{ inputs.os-version || 'macos-13' }} + label: ${{ format('mac-ci-{0}', inputs.fastcdr-branch || github.ref) }} + colcon-args: ${{ inputs.colcon-args }} + cmake-args: ${{ inputs.cmake-args }} + ctest-args: ${{ inputs.ctest-args }} + fastcdr-branch: ${{ inputs.fastcdr-branch || github.ref }} + run-build: ${{ !(github.event_name == 'pull_request') || !contains(github.event.pull_request.labels.*.name, 'skip-ci') }} + run-tests: ${{ (inputs.run-tests == true) || ((github.event_name == 'pull_request') && (!contains(github.event.pull_request.labels.*.name, 'no-test'))) }} diff --git a/.github/workflows/nightly-mac-ci.yml b/.github/workflows/nightly-mac-ci.yml new file mode 100644 index 00000000..be38c703 --- /dev/null +++ b/.github/workflows/nightly-mac-ci.yml @@ -0,0 +1,57 @@ +name: Fast CDR Mac CI (nightly) + +on: + workflow_dispatch: + schedule: + - cron: '0 1 * * *' + +jobs: + nightly-mac-ci-master: + uses: eProsima/Fast-CDR/.github/workflows/reusable-ci.yml@master + with: + os-version: 'macos-13' + label: 'nightly-mac-ci-master' + fastcdr-branch: 'master' + run-build: true + run-tests: true + use-ccache: false + + nightly-mac-ci-2_2_x: + uses: eProsima/Fast-CDR/.github/workflows/reusable-ci.yml@2.2.x + with: + os-version: 'macos-13' + label: 'nightly-mac-ci-2.2.x' + fastcdr-branch: '2.2.x' + run-build: true + run-tests: true + use-ccache: false + + nightly-mac-ci-2_1_x: + uses: eProsima/Fast-CDR/.github/workflows/reusable-ci.yml@2.1.x + with: + os-version: 'macos-13' + label: 'nightly-mac-ci-2.1.x' + fastcdr-branch: '2.1.x' + run-build: true + run-tests: true + use-ccache: false + + nightly-mac-ci-1_1_x: + uses: eProsima/Fast-CDR/.github/workflows/reusable-ci.yml@1.1.x + with: + os-version: 'macos-13' + label: 'nightly-mac-ci-1.1.x' + fastcdr-branch: '1.1.x' + run-build: true + run-tests: true + use-ccache: false + + nightly-mac-ci-1_0_x: + uses: eProsima/Fast-CDR/.github/workflows/reusable-ci.yml@1.0.x + with: + os-version: 'mac-13' + label: 'nightly-mac-ci-1.0.x' + fastcdr-branch: '1.0.x' + run-build: true + run-tests: true + use-ccache: false diff --git a/.github/workflows/nightly-ubuntu-ci.yml b/.github/workflows/nightly-ubuntu-ci.yml new file mode 100644 index 00000000..6d986c05 --- /dev/null +++ b/.github/workflows/nightly-ubuntu-ci.yml @@ -0,0 +1,57 @@ +name: Fast CDR Ubuntu CI (nightly) + +on: + workflow_dispatch: + schedule: + - cron: '0 1 * * *' + +jobs: + nightly-ubuntu-ci-master: + uses: eProsima/Fast-CDR/.github/workflows/reusable-ci.yml@master + with: + os-version: 'ubuntu-22.04' + label: 'nightly-ubuntu-ci-master' + fastcdr-branch: 'master' + run-build: true + run-tests: true + use-ccache: false + + nightly-ubuntu-ci-2_2_x: + uses: eProsima/Fast-CDR/.github/workflows/reusable-ci.yml@2.2.x + with: + os-version: 'ubuntu-22.04' + label: 'nightly-ubuntu-ci-2.2.x' + fastcdr-branch: '2.2.x' + run-build: true + run-tests: true + use-ccache: false + + nightly-ubuntu-ci-2_1_x: + uses: eProsima/Fast-CDR/.github/workflows/reusable-ci.yml@2.1.x + with: + os-version: 'ubuntu-22.04' + label: 'nightly-ubuntu-ci-2.1.x' + fastcdr-branch: '2.1.x' + run-build: true + run-tests: true + use-ccache: false + + nightly-ubuntu-ci-1_1_x: + uses: eProsima/Fast-CDR/.github/workflows/reusable-ci.yml@1.1.x + with: + os-version: 'ubuntu-22.04' + label: 'nightly-ubuntu-ci-1.1.x' + fastcdr-branch: '1.1.x' + run-build: true + run-tests: true + use-ccache: false + + nightly-ubuntu-ci-1_0_x: + uses: eProsima/Fast-CDR/.github/workflows/reusable-ci.yml@1.0.x + with: + os-version: 'ubuntu-20.04' + label: 'nightly-ubuntu-ci-1.0.x' + fastcdr-branch: '1.0.x' + run-build: true + run-tests: true + use-ccache: false diff --git a/.github/workflows/nightly-windows-ci.yml b/.github/workflows/nightly-windows-ci.yml new file mode 100644 index 00000000..57d2a226 --- /dev/null +++ b/.github/workflows/nightly-windows-ci.yml @@ -0,0 +1,92 @@ +name: Fast CDR Windows CI (nightly) + +on: + workflow_dispatch: + schedule: + - cron: '0 1 * * *' + +jobs: + nightly-windows-ci-master: + strategy: + fail-fast: false + matrix: + vs-toolset: + - 'v141' + - 'v142' + uses: eProsima/Fast-CDR/.github/workflows/reusable-ci.yml@master + with: + os-version: 'windows-2019' + vs-toolset: ${{ matrix.vs-toolset }} + label: 'nightly-windows-${{ matrix.vs-toolset }}-ci-master' + fastcdr-branch: 'master' + run-build: true + run-tests: true + use-ccache: false + + nightly-windows-ci-2_2_x: + strategy: + fail-fast: false + matrix: + vs-toolset: + - 'v141' + - 'v142' + uses: eProsima/Fast-CDR/.github/workflows/reusable-ci.yml@2.2.x + with: + os-version: 'windows-2019' + vs-toolset: ${{ matrix.vs-toolset }} + label: 'nightly-windows-${{ matrix.vs-toolset }}-ci-2.2.x' + fastcdr-branch: '2.2.x' + run-build: true + run-tests: true + use-ccache: false + + nightly-windows-ci-2_1_x: + strategy: + fail-fast: false + matrix: + vs-toolset: + - 'v141' + - 'v142' + uses: eProsima/Fast-CDR/.github/workflows/reusable-ci.yml@2.1.x + with: + os-version: 'windows-2019' + vs-toolset: ${{ matrix.vs-toolset }} + label: 'nightly-windows-${{ matrix.vs-toolset }}-ci-2.1.x' + fastcdr-branch: '2.1.x' + run-build: true + run-tests: true + use-ccache: false + + nightly-windows-ci-1_1_x: + strategy: + fail-fast: false + matrix: + vs-toolset: + - 'v141' + - 'v142' + uses: eProsima/Fast-CDR/.github/workflows/reusable-ci.yml@1.1.x + with: + os-version: 'windows-2019' + vs-toolset: ${{ matrix.vs-toolset }} + label: 'nightly-windows-${{ matrix.vs-toolset }}-ci-1.1.x' + fastcdr-branch: '1.1.x' + run-build: true + run-tests: true + use-ccache: false + + nightly-windows-ci-1_0_x: + strategy: + fail-fast: false + matrix: + vs-toolset: + - 'v141' + - 'v142' + uses: eProsima/Fast-CDR/.github/workflows/reusable-ci.yml@1.0.x + with: + os-version: 'windows-2019' + vs-toolset: ${{ matrix.vs-toolset }} + label: 'nightly-windows-${{ matrix.vs-toolset }}-ci-1.0.x' + fastcdr-branch: '1.0.x' + run-build: true + run-tests: true + use-ccache: false diff --git a/.github/workflows/reusable-ci.yml b/.github/workflows/reusable-ci.yml new file mode 100644 index 00000000..54c4132b --- /dev/null +++ b/.github/workflows/reusable-ci.yml @@ -0,0 +1,159 @@ +name: Fast CDR reusable CI workflow + +on: + workflow_call: + inputs: + os-version: + description: 'The OS image for the workflow' + required: false + default: 'ubuntu-22.04' + type: string + vs-toolset: + description: 'Windows Visual Studio toolset to use (only Windows)' + required: false + type: string + label: + description: 'ID associated to the workflow' + required: true + type: string + colcon-args: + description: 'Extra arguments for colcon cli' + required: false + type: string + cmake-args: + description: 'Extra arguments for cmake cli' + required: false + type: string + ctest-args: + description: 'Extra arguments for ctest cli' + required: false + type: string + fastcdr-branch: + description: 'Branch or tag of Fast CDR repository' + required: true + type: string + run-build: + description: 'Build Fast CDR (CI skipped otherwise)' + required: false + type: boolean + default: true + run-tests: + description: 'Run test suite of Fast CDR' + required: false + type: boolean + default: true + use-ccache: + description: 'Use CCache to speed up the build' + required: false + type: boolean + default: false +env: + toolset: ${{ inputs.vs-toolset && format('-T {0}', inputs.vs-toolset) || '' }} + test-meta: ${{ inputs.os-version == 'windows-2019' && format('{0}/src/fastcdr/.github/workflows/config/build_test.meta', github.workspace) || format('{0}/src/fastcdr/.github/workflows/config/build.meta {0}/src/fastcdr/.github/workflows/config/test.meta', github.workspace) }} +defaults: + run: + shell: bash + +jobs: + fastcdr_test: + runs-on: ${{ inputs.os-version }} + if: ${{ inputs.run-build == true }} + strategy: + fail-fast: false + matrix: + cmake-build-type: + - 'RelWithDebInfo' + + steps: + - name: Add ci-pending label if PR + if: ${{ github.event_name == 'pull_request' }} + uses: eProsima/eProsima-CI/external/add_labels@v0 + with: + labels: ci-pending + number: ${{ github.event.number }} + repo: eProsima/Fast-CDR + + - name: Sync eProsima/Fast-CDR repository + uses: eProsima/eProsima-CI/external/checkout@v0 + with: + path: src/fastcdr + ref: ${{ inputs.fastcdr-branch }} + + - name: Install Fix Python version + uses: eProsima/eProsima-CI/external/setup-python@v0 + with: + python-version: '3.11' + + - name: Get minimum supported version of CMake + uses: eProsima/eProsima-CI/external/get-cmake@v0 + with: + cmakeVersion: '3.22.6' + + - name: Install Colcon dependencies + uses: eProsima/eProsima-CI/multiplatform/install_colcon@v0 + + - name: Setup CCache + uses: eProsima/eProsima-CI/external/setup-ccache-action@v0 + if: ${{ inputs.use-ccache == true }} + with: + api_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Install Python dependencies + uses: eProsima/eProsima-CI/multiplatform/install_python_packages@v0 + with: + packages: vcstool + upgrade: false + + - name: Fetch Fast DDS CI dependencies + uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0 + with: + vcs_repos_file: ${{ github.workspace }}/src/fastcdr/.github/workflows/config/test.repos + destination_workspace: src + skip_existing: 'true' + + - name: Colcon build + uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 + with: + colcon_meta_file: ${{ github.workspace }}/src/fastcdr/.github/workflows/config/build.meta + colcon_build_args: ${{ inputs.colcon-args }} + colcon_build_args_default: --event-handlers=console_direct+ + cmake_args: ${{ inputs.cmake-args }} + cmake_args_default: ${{ env.toolset }} + cmake_build_type: ${{ matrix.cmake-build-type }} + workspace: ${{ github.workspace }} + + - name: Prepare build test meta file + if: ${{ inputs.run-tests == true && inputs.os-version == 'windows-2019' }} + uses: eProsima/eProsima-CI/windows/merge_yaml_metas@v0 + with: + metas: "@('${{ github.workspace }}/src/fastcdr/.github/workflows/config/build.meta', '${{ github.workspace }}/src/fastcdr/.github/workflows/config/test.meta')" + path: '${{ github.workspace }}/src/fastcdr/.github/workflows/config/build_test.meta' + + - name: Colcon test + id: test_fastcdr + if: ${{ inputs.run-tests == true }} + uses: eProsima/eProsima-CI/multiplatform/colcon_test@v0 + with: + colcon_meta_file: ${{ env.test-meta }} + colcon_test_args_default: --event-handlers=console_direct+ + ctest_args: ${{ inputs.ctest-args }} + packages_names: fastcdr + workspace: ${{ github.workspace }} + test_report_artifact: ${{ inputs.label }} + + - name: Fast CDR Test summary + uses: eProsima/eProsima-CI/multiplatform/junit_summary@v0 + if: ${{ !cancelled() && inputs.run-tests == true }} + with: + junit_reports_dir: ${{ steps.test_fastcdr.outputs.ctest_results_path }} + print_summary: 'True' + show_failed: 'True' + show_disabled: 'False' + show_skipped: 'False' + + - name: Archive Test Results + if: always() + uses: eProsima/eProsima-CI/external/upload-artifact@v0 + with: + name: test-results-${{ inputs.label }} + path: log/latest_test/fastcdr diff --git a/.github/workflows/ubuntu-ci.yml b/.github/workflows/ubuntu-ci.yml new file mode 100644 index 00000000..5d133e18 --- /dev/null +++ b/.github/workflows/ubuntu-ci.yml @@ -0,0 +1,65 @@ +name: Fast CDR Ubuntu CI + +on: + workflow_dispatch: + inputs: + os-version: + description: 'OS version to run the workflow' + required: false + default: 'ubuntu-22.04' + type: string + colcon-args: + description: 'Extra arguments for colcon cli' + required: false + type: string + cmake-args: + description: 'Extra arguments for cmake cli' + required: false + type: string + ctest-args: + description: 'Extra arguments for ctest cli' + required: false + type: string + fastcdr-branch: + description: 'Branch or tag of Fast CDR repository' + type: string + required: true + run-tests: + description: 'Run test suite of Fast CDR' + required: false + type: boolean + default: true + use-ccache: + description: 'Use CCache to speed up the build' + required: false + type: boolean + default: false + + pull_request: + types: + - review_requested + paths-ignore: + - '**.md' + - '**.txt' + - '!**/CMakeLists.txt' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + ubuntu-ci: + if: ${{ !(github.event_name == 'pull_request') || !contains(github.event.pull_request.labels.*.name, 'conflicts') }} + uses: ./.github/workflows/reusable-ci.yml + with: + # It would be desirable to have a matrix of ubuntu OS for this job, but due to the issue opened in this ticket: + # https://github.com/orgs/community/discussions/128118 , it has been set as a single OS job. + os-version: ${{ inputs.os-version || 'ubuntu-22.04' }} + label: ${{ format('ubuntu-ci-{0}', inputs.fastcdr-branch || github.ref) }} + colcon-args: ${{ inputs.colcon-args }} + cmake-args: ${{ inputs.cmake-args }} + ctest-args: ${{ inputs.ctest-args }} + fastcdr-branch: ${{ inputs.fastcdr-branch || github.ref }} + run-build: ${{ !(github.event_name == 'pull_request') || !contains(github.event.pull_request.labels.*.name, 'skip-ci') }} + run-tests: ${{ (inputs.run-tests == true) || ((github.event_name == 'pull_request') && (!contains(github.event.pull_request.labels.*.name, 'no-test'))) }} + use-ccache: ${{ inputs.use-ccache || false }} diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml new file mode 100644 index 00000000..761a5430 --- /dev/null +++ b/.github/workflows/windows-ci.yml @@ -0,0 +1,71 @@ +name: Fast CDR Windows CI + +on: + workflow_dispatch: + inputs: + os-version: + description: 'OS version to run the workflow' + required: false + default: 'windows-13' + type: string + vs-toolset: + description: 'Visual Studio toolset to use' + required: false + default: 'v142' + type: string + colcon-args: + description: 'Extra arguments for colcon cli' + required: false + type: string + cmake-args: + description: 'Extra arguments for cmake cli' + required: false + type: string + ctest-args: + description: 'Extra arguments for ctest cli' + required: false + type: string + fastcdr-branch: + description: 'Branch or tag of Fast CDR repository' + type: string + required: true + run-tests: + description: 'Run test suite of Fast CDR' + required: false + type: boolean + default: true + + pull_request: + types: + - review_requested + paths-ignore: + - '**.md' + - '**.txt' + - '!**/CMakeLists.txt' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + windows-ci: + strategy: + fail-fast: false + matrix: + vs-toolset: + - 'v141' + - 'v142' + if: ${{ !(github.event_name == 'pull_request') || !contains(github.event.pull_request.labels.*.name, 'conflicts') }} + uses: ./.github/workflows/reusable-ci.yml + with: + # It would be desirable to have a matrix of windows OS for this job, but due to the issue opened in this ticket: + # https://github.com/orgs/community/discussions/128118 , it has been set as a single OS job. + os-version: ${{ inputs.os-version || 'windows-2019' }} + vs-toolset: ${{ inputs.vs-toolset || matrix.vs-toolset }} + label: ${{ format('windows-{0}-ci-{1}', matrix.vs-toolset, inputs.fastcdr-branch || github.ref) }} + colcon-args: ${{ inputs.colcon-args }} + cmake-args: ${{ inputs.cmake-args }} + ctest-args: ${{ inputs.ctest-args }} + fastcdr-branch: ${{ inputs.fastcdr-branch || github.ref }} + run-build: ${{ !(github.event_name == 'pull_request') || !contains(github.event.pull_request.labels.*.name, 'skip-ci') }} + run-tests: ${{ (inputs.run-tests == true) || ((github.event_name == 'pull_request') && (!contains(github.event.pull_request.labels.*.name, 'no-test'))) }} diff --git a/README.md b/README.md index 4d817f84..49a9aa6f 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,10 @@ [![Issues](https://img.shields.io/github/issues/eProsima/Fast-CDR.svg)](https://github.com/eProsima/Fast-CDR/issues) [![Forks](https://img.shields.io/github/forks/eProsima/Fast-CDR.svg)](https://github.com/eProsima/Fast-CDR/network/members) [![Stars](https://img.shields.io/github/stars/eProsima/Fast-CDR.svg)](https://github.com/eProsima/Fast-CDR/stargazers) -[![Linux ci](http://jenkins.eprosima.com:8080/job/nightly_fastcdr_master_linux/badge/icon?subject=%20%20%20Linux%20CI%20)](http://jenkins.eprosima.com:8080/job/nightly_fastcdr_master_linux) +[![Fast CDR Ubuntu CI (nightly)](https://github.com/eProsima/Fast-CDR/actions/workflows/nightly-ubuntu-ci.yml/badge.svg)](https://github.com/eProsima/Fast-CDR/actions/workflows/nightly-ubuntu-ci.yml) [![Linux arm64 ci](http://jenkins.eprosima.com:8080/job/nightly_fastcdr_master_linux_aarch64/badge/icon?subject=%20%20%20Linux-aarch64%20CI%20)](http://jenkins.eprosima.com:8080/view/Nightly/job/nightly_fastcdr_master_linux_aarch64/) -[![Windows ci](http://jenkins.eprosima.com:8080/job/nightly_fastcdr_master_windows/label=windows-secure,platform=x64,toolset=v141/badge/icon?subject=%20%20%20%20Windows%20CI%20)](http://jenkins.eprosima.com:8080/job/nightly_fastcdr_master_windows/label=windows-secure,platform=x64,toolset=v141) -[![Mac ci](http://jenkins.eprosima.com:8080/job/nightly_fastcdr_master_mac/badge/icon?subject=%20%20%20%20%20%20%20Mac%20CI%20)](http://jenkins.eprosima.com:8080/job/nightly_fastcdr_master_mac) +[![Fast CDR Windows CI (nightly)](https://github.com/eProsima/Fast-CDR/actions/workflows/nightly-windows-ci.yml/badge.svg)](https://github.com/eProsima/Fast-CDR/actions/workflows/nightly-windows-ci.yml) +[![Fast CDR MacOS CI (nightly)](https://github.com/eProsima/Fast-CDR/actions/workflows/nightly-mac-ci.yml/badge.svg)](https://github.com/eProsima/Fast-CDR/actions/workflows/nightly-mac-ci.yml) [![Coverage](https://img.shields.io/jenkins/coverage/cobertura.svg?jobUrl=http%3A%2F%2Fjenkins.eprosima.com%3A8080%2Fjob%2Fnightly_fastcdr_coverage_linux)](http://jenkins.eprosima.com:8080/job/nightly_fastcdr_coverage_linux) **eProsima Fast CDR** is a C++ library that provides two serialization mechanisms. diff --git a/RELEASE_SUPPORT.md b/RELEASE_SUPPORT.md new file mode 100644 index 00000000..30877e58 --- /dev/null +++ b/RELEASE_SUPPORT.md @@ -0,0 +1,19 @@ +# Release support + + +Please, refer to the [master branch](https://github.com/eProsima/Fast-CDR/blob/master/RELEASE_SUPPORT.md) for the latest version of this document. + +*eProsima Fast CDR* maintains several releases with different support cycles. +**All of them are attached to different *eProsima Fast DDS* releases.** + +## *eProsima Fast DDS* and *Fast CDR* version compatibility + +|Fast DDS Version|Fast CDR Version|Fast CDR Version branch|Fast CDR Latest Release| +|----------------|----------------|-----------------------|-----------------------| +|2.14|2.2|[2.2.x](https://github.com/eProsima/Fast-CDR/tree/2.2.x)|[v2.2.2](https://github.com/eProsima/Fast-CDR/releases/tag/v2.2.2)| +|2.13|2.1|[2.1.x](https://github.com/eProsima/Fast-CDR/tree/2.1.x)|[v2.1.3](https://github.com/eProsima/Fast-CDR/releases/tag/v2.1.3)| +|2.10|1.0|[1.0.x](https://github.com/eProsima/Fast-CDR/tree/1.0.x)|[v1.0.28](https://github.com/eProsima/Fast-CDR/releases/tag/v1.0.28)| +|2.6|1.0|[1.0.x](https://github.com/eProsima/Fast-CDR/tree/1.0.x)|[v1.0.28](https://github.com/eProsima/Fast-CDR/releases/tag/v1.0.28)| + + +For detailed information about the lifecycle of the different *Fast DDS* versions (and their corresponding counterpart in this repository), please refer to the [release support section of the Fast DDS repository](https://github.com/eProsima/Fast-DDS/blob/master/RELEASE_SUPPORT.md). From 624080a107ea5ca637231b6916bdb765beea5c19 Mon Sep 17 00:00:00 2001 From: Eduardo Ponz Segrelles Date: Fri, 12 Jul 2024 08:27:23 +0200 Subject: [PATCH 10/33] Run CodeQL on macOS-13 instead of 11 (#220) * Refs #21286: Run CodeQL on macOS-13 instead of 11 Signed-off-by: eduponz * Refs #21286: Remove 1.1.x from the backport list, as it is attached to 2.6.x Signed-off-by: eduponz * Refs #21286: Use CodeQL action v3 Signed-off-by: eduponz --------- Signed-off-by: eduponz --- .github/pull_request_template.md | 2 +- .github/workflows/codeql-analysis.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 2ca237c4..fa88c544 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -17,7 +17,7 @@ In case of bug fixes, please provide the list of supported branches where this fix should be also merged. Please uncomment following line, adjusting the corresponding target branches for the backport. --> - + diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 53e6f2a0..6e8a2cb5 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -38,7 +38,7 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-2019, ubuntu-22.04, macos-11, ] + os: [windows-2019, ubuntu-22.04, macos-13, ] language: [ 'cpp' ] # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] # Learn more: @@ -50,7 +50,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -77,4 +77,4 @@ jobs: cmake --build . - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 From 872c324b6f3baf6b1ea17e6583137ba3cd702110 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Poderoso?= <120394830+JesusPoderoso@users.noreply.github.com> Date: Fri, 12 Jul 2024 10:00:03 +0200 Subject: [PATCH 11/33] Remove 2.1.x branch from nightly jobs (#223) * Refs #21309: Remove 2.1.x branch from nightly jobs Signed-off-by: JesusPoderoso * Refs #21309: Apply Edu' suggestion Signed-off-by: JesusPoderoso --------- Signed-off-by: JesusPoderoso --- .github/workflows/nightly-mac-ci.yml | 12 +----------- .github/workflows/nightly-ubuntu-ci.yml | 10 ---------- .github/workflows/nightly-windows-ci.yml | 17 ----------------- 3 files changed, 1 insertion(+), 38 deletions(-) diff --git a/.github/workflows/nightly-mac-ci.yml b/.github/workflows/nightly-mac-ci.yml index be38c703..ddc9d189 100644 --- a/.github/workflows/nightly-mac-ci.yml +++ b/.github/workflows/nightly-mac-ci.yml @@ -26,16 +26,6 @@ jobs: run-tests: true use-ccache: false - nightly-mac-ci-2_1_x: - uses: eProsima/Fast-CDR/.github/workflows/reusable-ci.yml@2.1.x - with: - os-version: 'macos-13' - label: 'nightly-mac-ci-2.1.x' - fastcdr-branch: '2.1.x' - run-build: true - run-tests: true - use-ccache: false - nightly-mac-ci-1_1_x: uses: eProsima/Fast-CDR/.github/workflows/reusable-ci.yml@1.1.x with: @@ -49,7 +39,7 @@ jobs: nightly-mac-ci-1_0_x: uses: eProsima/Fast-CDR/.github/workflows/reusable-ci.yml@1.0.x with: - os-version: 'mac-13' + os-version: 'macos-13' label: 'nightly-mac-ci-1.0.x' fastcdr-branch: '1.0.x' run-build: true diff --git a/.github/workflows/nightly-ubuntu-ci.yml b/.github/workflows/nightly-ubuntu-ci.yml index 6d986c05..48cfdfa8 100644 --- a/.github/workflows/nightly-ubuntu-ci.yml +++ b/.github/workflows/nightly-ubuntu-ci.yml @@ -26,16 +26,6 @@ jobs: run-tests: true use-ccache: false - nightly-ubuntu-ci-2_1_x: - uses: eProsima/Fast-CDR/.github/workflows/reusable-ci.yml@2.1.x - with: - os-version: 'ubuntu-22.04' - label: 'nightly-ubuntu-ci-2.1.x' - fastcdr-branch: '2.1.x' - run-build: true - run-tests: true - use-ccache: false - nightly-ubuntu-ci-1_1_x: uses: eProsima/Fast-CDR/.github/workflows/reusable-ci.yml@1.1.x with: diff --git a/.github/workflows/nightly-windows-ci.yml b/.github/workflows/nightly-windows-ci.yml index 57d2a226..cc292101 100644 --- a/.github/workflows/nightly-windows-ci.yml +++ b/.github/workflows/nightly-windows-ci.yml @@ -40,23 +40,6 @@ jobs: run-tests: true use-ccache: false - nightly-windows-ci-2_1_x: - strategy: - fail-fast: false - matrix: - vs-toolset: - - 'v141' - - 'v142' - uses: eProsima/Fast-CDR/.github/workflows/reusable-ci.yml@2.1.x - with: - os-version: 'windows-2019' - vs-toolset: ${{ matrix.vs-toolset }} - label: 'nightly-windows-${{ matrix.vs-toolset }}-ci-2.1.x' - fastcdr-branch: '2.1.x' - run-build: true - run-tests: true - use-ccache: false - nightly-windows-ci-1_1_x: strategy: fail-fast: false From 00d7f2d0564372270f4705a484273a60805e7042 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Poderoso?= <120394830+JesusPoderoso@users.noreply.github.com> Date: Mon, 15 Jul 2024 15:22:30 +0200 Subject: [PATCH 12/33] Set 2.1.x (Fast DDS 2.13.x) as EOL (#224) Signed-off-by: JesusPoderoso --- .github/pull_request_template.md | 2 +- .github/workflows/codeql-analysis.yml | 2 -- RELEASE_SUPPORT.md | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index fa88c544..383d6a52 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -17,7 +17,7 @@ In case of bug fixes, please provide the list of supported branches where this fix should be also merged. Please uncomment following line, adjusting the corresponding target branches for the backport. --> - + diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 6e8a2cb5..a4e10adc 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -16,7 +16,6 @@ on: branches: - master - 2.2.x - - 2.1.x - 1.1.x - 1.0.x pull_request: @@ -24,7 +23,6 @@ on: branches: - master - 2.2.x - - 2.1.x - 1.1.x - 1.0.x schedule: diff --git a/RELEASE_SUPPORT.md b/RELEASE_SUPPORT.md index 30877e58..4b58e3b1 100644 --- a/RELEASE_SUPPORT.md +++ b/RELEASE_SUPPORT.md @@ -11,7 +11,6 @@ Please, refer to the [master branch](https://github.com/eProsima/Fast-CDR/blob/m |Fast DDS Version|Fast CDR Version|Fast CDR Version branch|Fast CDR Latest Release| |----------------|----------------|-----------------------|-----------------------| |2.14|2.2|[2.2.x](https://github.com/eProsima/Fast-CDR/tree/2.2.x)|[v2.2.2](https://github.com/eProsima/Fast-CDR/releases/tag/v2.2.2)| -|2.13|2.1|[2.1.x](https://github.com/eProsima/Fast-CDR/tree/2.1.x)|[v2.1.3](https://github.com/eProsima/Fast-CDR/releases/tag/v2.1.3)| |2.10|1.0|[1.0.x](https://github.com/eProsima/Fast-CDR/tree/1.0.x)|[v1.0.28](https://github.com/eProsima/Fast-CDR/releases/tag/v1.0.28)| |2.6|1.0|[1.0.x](https://github.com/eProsima/Fast-CDR/tree/1.0.x)|[v1.0.28](https://github.com/eProsima/Fast-CDR/releases/tag/v1.0.28)| From cbc6c2444723d45c0733ad0e8b34e1fbb98fb3b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Poderoso?= <120394830+JesusPoderoso@users.noreply.github.com> Date: Wed, 24 Jul 2024 07:29:26 +0200 Subject: [PATCH 13/33] Fix windows CI: Avoid usage of removed action (#228) Signed-off-by: JesusPoderoso --- .github/workflows/reusable-ci.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/reusable-ci.yml b/.github/workflows/reusable-ci.yml index 54c4132b..c99cefda 100644 --- a/.github/workflows/reusable-ci.yml +++ b/.github/workflows/reusable-ci.yml @@ -49,7 +49,6 @@ on: default: false env: toolset: ${{ inputs.vs-toolset && format('-T {0}', inputs.vs-toolset) || '' }} - test-meta: ${{ inputs.os-version == 'windows-2019' && format('{0}/src/fastcdr/.github/workflows/config/build_test.meta', github.workspace) || format('{0}/src/fastcdr/.github/workflows/config/build.meta {0}/src/fastcdr/.github/workflows/config/test.meta', github.workspace) }} defaults: run: shell: bash @@ -122,19 +121,12 @@ jobs: cmake_build_type: ${{ matrix.cmake-build-type }} workspace: ${{ github.workspace }} - - name: Prepare build test meta file - if: ${{ inputs.run-tests == true && inputs.os-version == 'windows-2019' }} - uses: eProsima/eProsima-CI/windows/merge_yaml_metas@v0 - with: - metas: "@('${{ github.workspace }}/src/fastcdr/.github/workflows/config/build.meta', '${{ github.workspace }}/src/fastcdr/.github/workflows/config/test.meta')" - path: '${{ github.workspace }}/src/fastcdr/.github/workflows/config/build_test.meta' - - name: Colcon test id: test_fastcdr if: ${{ inputs.run-tests == true }} uses: eProsima/eProsima-CI/multiplatform/colcon_test@v0 with: - colcon_meta_file: ${{ env.test-meta }} + colcon_meta_file: ${{ github.workspace }}/src/fastcdr/.github/workflows/config/build.meta ${{ github.workspace }}/src/fastcdr/.github/workflows/config/test.meta colcon_test_args_default: --event-handlers=console_direct+ ctest_args: ${{ inputs.ctest-args }} packages_names: fastcdr From e17fdc426eb878c963cf3b9002709bc407643fbf Mon Sep 17 00:00:00 2001 From: Raul Sanchez-Mateos Lizano Date: Mon, 29 Jul 2024 15:57:31 +0200 Subject: [PATCH 14/33] Bump version to 2.2.3 (#231) Signed-off-by: Raul Sanchez-Mateos --- CMakeLists.txt | 2 +- package.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 72a11756..d038782c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,7 @@ endif() ############################################################################### # Project # ############################################################################### -project(fastcdr VERSION 2.2.2 LANGUAGES CXX) +project(fastcdr VERSION 2.2.3 LANGUAGES CXX) set(PROJECT_NAME_STYLED "FastCDR") set(PROJECT_NAME_LARGE "Fast CDR") diff --git a/package.xml b/package.xml index 0a742ac5..85ce9a1d 100644 --- a/package.xml +++ b/package.xml @@ -2,12 +2,12 @@ fastcdr - 2.2.2 + 2.2.3 *eProsima Fast CDR* is a C++ serialization library implementing the Common Data Representation (CDR) mechanism defined by the Object Management Group (OMG) consortium. CDR is the serialization mechanism used in DDS for the DDS Interoperability Wire Protocol (DDSI-RTPS). Miguel Company - Eduardo Ponz + Raúl Sánchez-Mateos Apache 2.0 https://www.eprosima.com/ From 371fba8fe57ab78db73615fe70b425dc7d6b80e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Dom=C3=ADnguez=20L=C3=B3pez?= <116071334+Mario-DL@users.noreply.github.com> Date: Tue, 10 Sep 2024 07:24:13 +0200 Subject: [PATCH 15/33] Bugfix: clear map before deserializing with string as values in XCRv1 (#233) * Refs #21443: Add regression test Signed-off-by: Mario Dominguez * Refs #21443: Add fix Signed-off-by: Mario Dominguez * Refs #21556: Apply Ricardo's suggestion Signed-off-by: Mario Dominguez --------- Signed-off-by: Mario Dominguez --- include/fastcdr/Cdr.h | 2 ++ test/cdr/SimpleTest.cpp | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/include/fastcdr/Cdr.h b/include/fastcdr/Cdr.h index ba51fa2b..983c886b 100644 --- a/include/fastcdr/Cdr.h +++ b/include/fastcdr/Cdr.h @@ -2024,6 +2024,8 @@ class Cdr deserialize(sequence_length); + map_t.clear(); + try { for (uint32_t i = 0; i < sequence_length; ++i) diff --git a/test/cdr/SimpleTest.cpp b/test/cdr/SimpleTest.cpp index 29807edf..be2af444 100644 --- a/test/cdr/SimpleTest.cpp +++ b/test/cdr/SimpleTest.cpp @@ -2251,6 +2251,35 @@ TEST(CDRTests, Complete) free(c_wstring_value); } +// Regression test for Fast DDS issue #5136 +// A non-empty map should be cleared before deserializing in XCDRv1 +TEST(CDRTests, DeserializeIntoANonEmptyMapInXCDRv1) +{ + char buffer[14] = + { + 0x00, 0x00, 0x00, 0x01, // Map length + 0x00, 0x02, // Key + 0x00, 0x00, // Alignment + 0x00, 0x00, 0x00, 0x01, // Length + 65, 0x00 // 'A' + }; + + std::map initialized_map{ + {1, "a"} + }; + + FastBuffer cdr_buffer(buffer, 14); + Cdr cdr_ser_map( + cdr_buffer, + eprosima::fastcdr::Cdr::Endianness::BIG_ENDIANNESS, + XCDRv1); + + // Deserialization in a non-empty map + cdr_ser_map >> initialized_map; + ASSERT_EQ(initialized_map.size(), 1u); + ASSERT_EQ(initialized_map.at(2), "A"); +} + TEST(FastCDRTests, Octet) { // Check good case. From 0ad4f980e9a818265edd1afc93a5bb796f46db53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Poderoso?= <120394830+JesusPoderoso@users.noreply.github.com> Date: Tue, 10 Sep 2024 12:34:40 +0200 Subject: [PATCH 16/33] Bump version to v2.2.4 (#235) Signed-off-by: JesusPoderoso --- CMakeLists.txt | 2 +- package.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d038782c..6e427991 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,7 @@ endif() ############################################################################### # Project # ############################################################################### -project(fastcdr VERSION 2.2.3 LANGUAGES CXX) +project(fastcdr VERSION 2.2.4 LANGUAGES CXX) set(PROJECT_NAME_STYLED "FastCDR") set(PROJECT_NAME_LARGE "Fast CDR") diff --git a/package.xml b/package.xml index 85ce9a1d..023224c7 100644 --- a/package.xml +++ b/package.xml @@ -2,7 +2,7 @@ fastcdr - 2.2.3 + 2.2.4 *eProsima Fast CDR* is a C++ serialization library implementing the Common Data Representation (CDR) mechanism defined by the Object Management Group (OMG) consortium. CDR is the serialization mechanism used in DDS for the DDS Interoperability Wire Protocol (DDSI-RTPS). From 101a15669543dc0458b1090fafa11934935a175f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Gonz=C3=A1lez?= Date: Fri, 4 Oct 2024 11:24:19 +0200 Subject: [PATCH 17/33] Fix encoding/decoding when inner structure has different extensibility (#237) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Refs #21782. Regression test Signed-off-by: Ricardo González Moreno * Refs #21782. Fix Signed-off-by: Ricardo González Moreno * Refs #21782. Fix in CdrSizeCalculator Signed-off-by: Ricardo González Moreno * Refs #21782. Add more tests Signed-off-by: Ricardo González Moreno --------- Signed-off-by: Ricardo González Moreno --- include/fastcdr/CdrSizeCalculator.hpp | 4 +- src/cpp/Cdr.cpp | 32 ++- test/xcdr/CMakeLists.txt | 1 + test/xcdr/appendable.cpp | 349 +++++++++++++++++++++++ test/xcdr/final.cpp | 392 ++++++++++++++++++++++++++ test/xcdr/mutable.cpp | 369 ++++++++++++++++++++++++ 6 files changed, 1135 insertions(+), 12 deletions(-) create mode 100644 test/xcdr/final.cpp diff --git a/include/fastcdr/CdrSizeCalculator.hpp b/include/fastcdr/CdrSizeCalculator.hpp index 67860e2a..1caab9ef 100644 --- a/include/fastcdr/CdrSizeCalculator.hpp +++ b/include/fastcdr/CdrSizeCalculator.hpp @@ -1166,7 +1166,9 @@ class CdrSizeCalculator 0 < calculated_size) { - if (8 < calculated_size) + if (8 < calculated_size || + (1 != calculated_size && 2 != calculated_size && 4 != calculated_size && + 8 != calculated_size)) { extra_size = 8; // Long EMHEADER. if (NO_SERIALIZED_MEMBER_SIZE != serialized_member_size_) diff --git a/src/cpp/Cdr.cpp b/src/cpp/Cdr.cpp index 189ee21d..1b31547e 100644 --- a/src/cpp/Cdr.cpp +++ b/src/cpp/Cdr.cpp @@ -50,18 +50,18 @@ inline size_t alignment_on_state( inline uint32_t Cdr::get_long_lc( SerializedMemberSizeForNextInt serialized_member_size) { - uint32_t lc = 0x40000000; + uint32_t lc {0x40000000}; switch (serialized_member_size) { case SERIALIZED_MEMBER_SIZE_8: - lc = 0x70000000; + lc = 0x70000000u; break; case SERIALIZED_MEMBER_SIZE_4: - lc = 0x60000000; + lc = 0x60000000u; break; case SERIALIZED_MEMBER_SIZE: - lc = 0x50000000; + lc = 0x50000000u; break; default: break; @@ -73,17 +73,20 @@ inline uint32_t Cdr::get_long_lc( inline uint32_t Cdr::get_short_lc( size_t member_serialized_size) { - uint32_t lc = 0x0; + uint32_t lc {0xFFFFFFFFu}; switch (member_serialized_size) { + case 1: + lc = 0x00000000u; + break; case 2: - lc = 0x10000000; + lc = 0x10000000u; break; case 4: - lc = 0x20000000; + lc = 0x20000000u; break; case 8: - lc = 0x30000000; + lc = 0x30000000u; break; default: break; @@ -2986,7 +2989,7 @@ Cdr& Cdr::xcdr2_end_serialize_member( { const size_t member_serialized_size = last_offset - offset_ - (current_state.header_serialized_ == XCdrHeaderSelection::SHORT_HEADER ? 4 : 8); - if (8 < member_serialized_size) + if (8 < member_serialized_size || 0xFFFFFFFFu == get_short_lc(member_serialized_size)) { switch (current_state.header_serialized_) { @@ -3196,8 +3199,9 @@ Cdr& Cdr::xcdr1_deserialize_type( assert(EncodingAlgorithmFlag::PLAIN_CDR == type_encoding || EncodingAlgorithmFlag::PL_CDR == type_encoding); Cdr::state current_state(*this); + current_encoding_ = type_encoding; - if (EncodingAlgorithmFlag::PL_CDR == type_encoding) + if (EncodingAlgorithmFlag::PL_CDR == current_encoding_) { while (xcdr1_deserialize_member_header(next_member_id_, current_state)) { @@ -3234,6 +3238,7 @@ Cdr& Cdr::xcdr1_deserialize_type( } next_member_id_ = current_state.next_member_id_; + current_encoding_ = current_state.previous_encoding_; return *this; } @@ -3253,8 +3258,9 @@ Cdr& Cdr::xcdr2_deserialize_type( deserialize(dheader); Cdr::state current_state(*this); + current_encoding_ = type_encoding; - if (EncodingAlgorithmFlag::PL_CDR2 == type_encoding) + if (EncodingAlgorithmFlag::PL_CDR2 == current_encoding_) { while (offset_ - current_state.offset_ != dheader) { @@ -3306,10 +3312,13 @@ Cdr& Cdr::xcdr2_deserialize_type( next_member_id_ = current_state.next_member_id_; } + + current_encoding_ = current_state.previous_encoding_; } else { Cdr::state current_state(*this); + current_encoding_ = type_encoding; next_member_id_ = MemberId(0); while (offset_ != end_ && functor(*this, next_member_id_)) @@ -3318,6 +3327,7 @@ Cdr& Cdr::xcdr2_deserialize_type( } next_member_id_ = current_state.next_member_id_; + current_encoding_ = current_state.previous_encoding_; } return *this; diff --git a/test/xcdr/CMakeLists.txt b/test/xcdr/CMakeLists.txt index 6a6c2d70..09861750 100644 --- a/test/xcdr/CMakeLists.txt +++ b/test/xcdr/CMakeLists.txt @@ -19,6 +19,7 @@ set(XCDR_TEST_SOURCE appendable.cpp basic_types.cpp external.cpp + final.cpp mutable.cpp optional.cpp xcdrv1.cpp diff --git a/test/xcdr/appendable.cpp b/test/xcdr/appendable.cpp index 8ab748eb..0b125332 100644 --- a/test/xcdr/appendable.cpp +++ b/test/xcdr/appendable.cpp @@ -256,6 +256,99 @@ void deserialize( } // namespace fastcdr } // namespace eprosima +struct ApInnerStructure +{ +public: + + ApInnerStructure() = default; + + ApInnerStructure( + eprosima::fastcdr::EncodingAlgorithmFlag e1, + eprosima::fastcdr::EncodingAlgorithmFlag e2 + ) + : enc_xcdrv1(e1) + , enc_xcdrv2(e2) + { + } + + ApInnerStructure( + eprosima::fastcdr::EncodingAlgorithmFlag e1, + eprosima::fastcdr::EncodingAlgorithmFlag e2, + uint8_t value + ) + : value1(value) + , enc_xcdrv1(e1) + , enc_xcdrv2(e2) + { + } + + bool operator ==( + const ApInnerStructure& other) const + { + return value1 == other.value1 && + value2.has_value() == other.value2.has_value() && + (!value2.has_value() || value2.value() == other.value2.value()); + } + + //! First being serialized. + uint32_t value1 {0}; + + //! Second being serialized. + eprosima::fastcdr::optional value2; + + eprosima::fastcdr::EncodingAlgorithmFlag enc_xcdrv1 {eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR}; + + eprosima::fastcdr::EncodingAlgorithmFlag enc_xcdrv2 {eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2}; +}; + +namespace eprosima { +namespace fastcdr { + +template<> +void serialize( + Cdr& cdr, + const ApInnerStructure& data) +{ + Cdr::state current_status(cdr); + cdr.begin_serialize_type(current_status, cdr.get_cdr_version() == eprosima::fastcdr::CdrVersion::XCDRv1 + ? data.enc_xcdrv1 + : data.enc_xcdrv2); + cdr << MemberId(0) << data.value1; + cdr << MemberId(1) << data.value2; + cdr.end_serialize_type(current_status); +} + +template<> +void deserialize( + Cdr& cdr, + ApInnerStructure& data) +{ + cdr.deserialize_type(cdr.get_cdr_version() == eprosima::fastcdr::CdrVersion::XCDRv1 + ? data.enc_xcdrv1 + : data.enc_xcdrv2, + [&data](Cdr& cdr_inner, const MemberId& mid) -> bool + { + bool ret_value {true}; + switch (mid.id) + { + case 0: + cdr_inner >> data.value1; + break; + case 1: + cdr_inner >> data.value2; + break; + default: + ret_value = false; + break; + } + + return ret_value; + }); +} + +} // namespace fastcdr +} // namespace eprosima + /*! * @test Test an appendable structure where the encoded version has more members that the decoded one. * @code{.idl} @@ -958,6 +1051,262 @@ TEST_P(XCdrAppendableTest, inner_mutable) //} } +/*! + * @test Test an inner final structure inside a appendable structure. + * @code{.idl} + * @final + * struct InnerFinalStructure + * { + * @id(0) + * unsigned long value1; + * @id(1) @optional + * unsigned long value2; + * }; + * + * @appendable + * struct AppendableWithInnerFinalStruct + * { + * @id(1) + * unsigned long value1; + * @id(2) + * InnerFinalStructure value2; + * }; + * @endcode + */ +TEST_P(XCdrAppendableTest, inner_final_structure) +{ + constexpr uint8_t ival {0xCD}; + + //{ Defining expected XCDR streams + XCdrStreamValues expected_streams; + expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = + { + 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, ival, // ULong + 0x00, 0x00, 0x00, ival, // ULong + 0x00, 0x01, 0x00, 0x00, // ShortMemberHeader (optional) + }; + expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = + { + 0x00, 0x01, 0x00, 0x00, // Encapsulation + ival, 0x00, 0x00, 0x00, // ULong + ival, 0x00, 0x00, 0x00, // ULong + 0x01, 0x00, 0x00, 0x00, // ShortMemberHeader (optional) + }; + expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = + { + 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x09, // DHEADER + 0x00, 0x00, 0x00, ival, // ULong + 0x00, 0x00, 0x00, ival, // ULong + 0x00, // Optional not present + }; + expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = + { + 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x09, 0x00, 0x00, 0x00, // DHEADER + ival, 0x00, 0x00, 0x00, // ULong + ival, 0x00, 0x00, 0x00, // ULong + 0x00, // Optional not present + }; + //} + + EncodingAlgorithmFlag encoding = std::get<0>(GetParam()); + Cdr::Endianness endianness = std::get<1>(GetParam()); + + //{ Prepare buffer + uint8_t tested_stream = 0 + encoding + endianness; + auto buffer = + std::unique_ptr{reinterpret_cast(calloc(expected_streams[tested_stream].size(), sizeof(char))), free}; + FastBuffer fast_buffer(buffer.get(), expected_streams[tested_stream].size()); + Cdr cdr(fast_buffer, endianness, get_version_from_algorithm(encoding)); + //} + + //{ Encode + uint32_t value1 {ival}; + ApInnerStructure value2 {eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, ival}; + cdr.set_encoding_flag(encoding); + cdr.serialize_encapsulation(); + Cdr::state enc_state(cdr); + cdr.begin_serialize_type(enc_state, encoding); + cdr << MemberId(1) << value1; + cdr << MemberId(2) << value2; + cdr.end_serialize_type(enc_state); + Cdr::state enc_state_end(cdr); + //} + + //{ Test encoded content + ASSERT_EQ(cdr.get_serialized_data_length(), expected_streams[tested_stream].size()); + ASSERT_EQ(0, memcmp(buffer.get(), expected_streams[tested_stream].data(), + expected_streams[tested_stream].size())); + //} + + //{ Decoding + uint32_t dvalue1 {0}; + ApInnerStructure dvalue2 {eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, ival}; + cdr.reset(); + cdr.read_encapsulation(); + ASSERT_EQ(cdr.get_encoding_flag(), encoding); + ASSERT_EQ(cdr.endianness(), endianness); + cdr.deserialize_type(encoding, [&](Cdr& cdr_inner, const MemberId& mid)->bool + { + bool ret_value {true}; + + switch (mid.id) + { + case 0: + cdr_inner >> dvalue1; + break; + case 1: + cdr_inner >> dvalue2; + break; + default: + ret_value = false; + break; + } + + return ret_value; + }); + ASSERT_EQ(value1, dvalue1); + ASSERT_EQ(value2, dvalue2); + Cdr::state dec_state_end(cdr); + ASSERT_EQ(enc_state_end, dec_state_end); + //} +} + +/*! + * @test Test an inner mutable structure inside a appendable structure. + * @code{.idl} + * @mutable + * struct InnerMutableStructure + * { + * @id(0) + * unsigned long value1; + * @id(1) @optional + * unsigned long value2; + * }; + * + * @appendable + * struct AppendableWithInnerMutableStruct + * { + * @id(1) + * unsigned long value1; + * @id(2) + * InnerMutableStructure value2; + * }; + * @endcode + */ +TEST_P(XCdrAppendableTest, inner_mutable_structure) +{ + constexpr uint8_t ival {0xCD}; + + //{ Defining expected XCDR streams + XCdrStreamValues expected_streams; + expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = + { + 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, ival, // ULong + 0x00, 0x00, 0x00, 0x04, // ShortMemberHeader + 0x00, 0x00, 0x00, ival, // ULong + 0x3F, 0x02, 0x00, 0x00, // Sentinel + }; + expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = + { + 0x00, 0x01, 0x00, 0x00, // Encapsulation + ival, 0x00, 0x00, 0x00, // ULong + 0x00, 0x00, 0x04, 0x00, // ShortMemberHeader + ival, 0x00, 0x00, 0x00, // ULong + 0x02, 0x3F, 0x00, 0x00, // Sentinel + }; + expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = + { + 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x10, // DHEADER + 0x00, 0x00, 0x00, ival, // ULong + 0x00, 0x00, 0x00, 0x08, // DHEADER + 0x20, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT + 0x00, 0x00, 0x00, ival, // ULong + }; + expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = + { + 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x10, 0x00, 0x00, 0x00, // DHEADER + ival, 0x00, 0x00, 0x00, // ULong + 0x08, 0x00, 0x00, 0x00, // DHEADER + 0x00, 0x00, 0x00, 0x20, // EMHEADER1(M) without NEXTINT + ival, 0x00, 0x00, 0x00, // ULong + }; + //} + + EncodingAlgorithmFlag encoding = std::get<0>(GetParam()); + Cdr::Endianness endianness = std::get<1>(GetParam()); + + //{ Prepare buffer + uint8_t tested_stream = 0 + encoding + endianness; + auto buffer = + std::unique_ptr{reinterpret_cast(calloc(expected_streams[tested_stream].size(), sizeof(char))), free}; + FastBuffer fast_buffer(buffer.get(), expected_streams[tested_stream].size()); + Cdr cdr(fast_buffer, endianness, get_version_from_algorithm(encoding)); + //} + + //{ Encode + uint32_t value1 {ival}; + ApInnerStructure value2 {eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR, + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2, ival}; + cdr.set_encoding_flag(encoding); + cdr.serialize_encapsulation(); + Cdr::state enc_state(cdr); + cdr.begin_serialize_type(enc_state, encoding); + cdr << MemberId(1) << value1; + cdr << MemberId(2) << value2; + cdr.end_serialize_type(enc_state); + Cdr::state enc_state_end(cdr); + //} + + //{ Test encoded content + ASSERT_EQ(cdr.get_serialized_data_length(), expected_streams[tested_stream].size()); + ASSERT_EQ(0, memcmp(buffer.get(), expected_streams[tested_stream].data(), + expected_streams[tested_stream].size())); + //} + + //{ Decoding + uint32_t dvalue1 {0}; + ApInnerStructure dvalue2 {eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR, + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2, ival}; + cdr.reset(); + cdr.read_encapsulation(); + ASSERT_EQ(cdr.get_encoding_flag(), encoding); + ASSERT_EQ(cdr.endianness(), endianness); + cdr.deserialize_type(encoding, [&](Cdr& cdr_inner, const MemberId& mid)->bool + { + bool ret_value {true}; + + switch (mid.id) + { + case 0: + cdr_inner >> dvalue1; + break; + case 1: + cdr_inner >> dvalue2; + break; + default: + ret_value = false; + break; + } + + return ret_value; + }); + ASSERT_EQ(value1, dvalue1); + ASSERT_EQ(value2, dvalue2); + Cdr::state dec_state_end(cdr); + ASSERT_EQ(enc_state_end, dec_state_end); + //} +} + INSTANTIATE_TEST_SUITE_P( XCdrTest, XCdrAppendableTest, diff --git a/test/xcdr/final.cpp b/test/xcdr/final.cpp new file mode 100644 index 00000000..8283e3a3 --- /dev/null +++ b/test/xcdr/final.cpp @@ -0,0 +1,392 @@ +// 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 +#include +#include + +#include + +#include +#include "utility.hpp" + +using namespace eprosima::fastcdr; + +using XCdrStreamValues = + std::array, + 1 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS>; + + +class XCdrFinalTest : public ::testing::TestWithParam< std::tuple> +{ +}; + +struct FiInnerStructure +{ +public: + + FiInnerStructure() = default; + + FiInnerStructure( + eprosima::fastcdr::EncodingAlgorithmFlag e1, + eprosima::fastcdr::EncodingAlgorithmFlag e2 + ) + : enc_xcdrv1(e1) + , enc_xcdrv2(e2) + { + } + + FiInnerStructure( + eprosima::fastcdr::EncodingAlgorithmFlag e1, + eprosima::fastcdr::EncodingAlgorithmFlag e2, + uint8_t value + ) + : value1(value) + , enc_xcdrv1(e1) + , enc_xcdrv2(e2) + { + } + + bool operator ==( + const FiInnerStructure& other) const + { + return value1 == other.value1 && + value2.has_value() == other.value2.has_value() && + (!value2.has_value() || value2.value() == other.value2.value()); + } + + //! First being serialized. + uint32_t value1 {0}; + + //! Second being serialized. + eprosima::fastcdr::optional value2; + + eprosima::fastcdr::EncodingAlgorithmFlag enc_xcdrv1 {eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR}; + + eprosima::fastcdr::EncodingAlgorithmFlag enc_xcdrv2 {eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2}; +}; + +namespace eprosima { +namespace fastcdr { + +template<> +void serialize( + Cdr& cdr, + const FiInnerStructure& data) +{ + Cdr::state current_status(cdr); + cdr.begin_serialize_type(current_status, cdr.get_cdr_version() == eprosima::fastcdr::CdrVersion::XCDRv1 + ? data.enc_xcdrv1 + : data.enc_xcdrv2); + cdr << MemberId(0) << data.value1; + cdr << MemberId(1) << data.value2; + cdr.end_serialize_type(current_status); +} + +template<> +void deserialize( + Cdr& cdr, + FiInnerStructure& data) +{ + cdr.deserialize_type(cdr.get_cdr_version() == eprosima::fastcdr::CdrVersion::XCDRv1 + ? data.enc_xcdrv1 + : data.enc_xcdrv2, + [&data](Cdr& cdr_inner, const MemberId& mid) -> bool + { + bool ret_value {true}; + switch (mid.id) + { + case 0: + cdr_inner >> data.value1; + break; + case 1: + cdr_inner >> data.value2; + break; + default: + ret_value = false; + break; + } + + return ret_value; + }); +} + +} // namespace fastcdr +} // namespace eprosima + +/*! + * @test Test an inner appendable structure inside a final structure. + * @code{.idl} + * @appendable + * struct InnerAppendableStructure + * { + * @id(0) + * unsigned long value1; + * @id(1) @optional + * unsigned long value2; + * }; + * + * @final + * struct FinalWithInnerAppendableStruct + * { + * @id(1) + * unsigned long value1; + * @id(2) + * InnerAppendableStructure value2; + * }; + * @endcode + */ +TEST_P(XCdrFinalTest, inner_appendable_structure) +{ + constexpr uint8_t ival {0xCD}; + + //{ Defining expected XCDR streams + XCdrStreamValues expected_streams; + expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = + { + 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, ival, // ULong + 0x00, 0x00, 0x00, ival, // ULong + 0x00, 0x01, 0x00, 0x00, // ShortMemberHeader (optional) + }; + expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = + { + 0x00, 0x01, 0x00, 0x00, // Encapsulation + ival, 0x00, 0x00, 0x00, // ULong + ival, 0x00, 0x00, 0x00, // ULong + 0x01, 0x00, 0x00, 0x00, // ShortMemberHeader (optional) + }; + expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = + { + 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, ival, // ULong + 0x00, 0x00, 0x00, 0x05, // DHEADER + 0x00, 0x00, 0x00, ival, // ULong + 0x00, // Optional not present + }; + expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = + { + 0x00, 0x07, 0x00, 0x00, // Encapsulation + ival, 0x00, 0x00, 0x00, // ULong + 0x05, 0x00, 0x00, 0x00, // DHEADER + ival, 0x00, 0x00, 0x00, // ULong + 0x00, // Optional not present + }; + //} + + EncodingAlgorithmFlag encoding = std::get<0>(GetParam()); + Cdr::Endianness endianness = std::get<1>(GetParam()); + + //{ Prepare buffer + uint8_t tested_stream = 0 + encoding + endianness; + auto buffer = + std::unique_ptr{reinterpret_cast(calloc(expected_streams[tested_stream].size(), sizeof(char))), free}; + FastBuffer fast_buffer(buffer.get(), expected_streams[tested_stream].size()); + Cdr cdr(fast_buffer, endianness, get_version_from_algorithm(encoding)); + //} + + //{ Encode + uint32_t value1 {ival}; + FiInnerStructure value2 {eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2, ival}; + cdr.set_encoding_flag(encoding); + cdr.serialize_encapsulation(); + Cdr::state enc_state(cdr); + cdr.begin_serialize_type(enc_state, encoding); + cdr << MemberId(1) << value1; + cdr << MemberId(2) << value2; + cdr.end_serialize_type(enc_state); + Cdr::state enc_state_end(cdr); + //} + + //{ Test encoded content + ASSERT_EQ(cdr.get_serialized_data_length(), expected_streams[tested_stream].size()); + ASSERT_EQ(0, memcmp(buffer.get(), expected_streams[tested_stream].data(), + expected_streams[tested_stream].size())); + //} + + //{ Decoding + uint32_t dvalue1 {0}; + FiInnerStructure dvalue2 {eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2, ival}; + cdr.reset(); + cdr.read_encapsulation(); + ASSERT_EQ(cdr.get_encoding_flag(), encoding); + ASSERT_EQ(cdr.endianness(), endianness); + cdr.deserialize_type(encoding, [&](Cdr& cdr_inner, const MemberId& mid)->bool + { + bool ret_value {true}; + + switch (mid.id) + { + case 0: + cdr_inner >> dvalue1; + break; + case 1: + cdr_inner >> dvalue2; + break; + default: + ret_value = false; + break; + } + + return ret_value; + }); + ASSERT_EQ(value1, dvalue1); + ASSERT_EQ(value2, dvalue2); + Cdr::state dec_state_end(cdr); + ASSERT_EQ(enc_state_end, dec_state_end); + //} +} + +/*! + * @test Test an inner mutable structure inside a final structure. + * @code{.idl} + * @mutable + * struct InnerMutableStructure + * { + * @id(0) + * unsigned long value1; + * @id(1) @optional + * unsigned long value2; + * }; + * + * @final + * struct FinalWithInnerMutableStruct + * { + * @id(1) + * unsigned long value1; + * @id(2) + * InnerMutableStructure value2; + * }; + * @endcode + */ +TEST_P(XCdrFinalTest, inner_mutable_structure) +{ + constexpr uint8_t ival {0xCD}; + + //{ Defining expected XCDR streams + XCdrStreamValues expected_streams; + expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = + { + 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, ival, // ULong + 0x00, 0x00, 0x00, 0x04, // ShortMemberHeader + 0x00, 0x00, 0x00, ival, // ULong + 0x3F, 0x02, 0x00, 0x00, // Sentinel + }; + expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = + { + 0x00, 0x01, 0x00, 0x00, // Encapsulation + ival, 0x00, 0x00, 0x00, // ULong + 0x00, 0x00, 0x04, 0x00, // ShortMemberHeader + ival, 0x00, 0x00, 0x00, // ULong + 0x02, 0x3F, 0x00, 0x00, // Sentinel + }; + expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = + { + 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, ival, // ULong + 0x00, 0x00, 0x00, 0x08, // DHEADER + 0x20, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT + 0x00, 0x00, 0x00, ival, // ULong + }; + expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = + { + 0x00, 0x07, 0x00, 0x00, // Encapsulation + ival, 0x00, 0x00, 0x00, // ULong + 0x08, 0x00, 0x00, 0x00, // DHEADER + 0x00, 0x00, 0x00, 0x20, // EMHEADER1(M) without NEXTINT + ival, 0x00, 0x00, 0x00, // ULong + }; + //} + + EncodingAlgorithmFlag encoding = std::get<0>(GetParam()); + Cdr::Endianness endianness = std::get<1>(GetParam()); + + //{ Prepare buffer + uint8_t tested_stream = 0 + encoding + endianness; + auto buffer = + std::unique_ptr{reinterpret_cast(calloc(expected_streams[tested_stream].size(), sizeof(char))), free}; + FastBuffer fast_buffer(buffer.get(), expected_streams[tested_stream].size()); + Cdr cdr(fast_buffer, endianness, get_version_from_algorithm(encoding)); + //} + + //{ Encode + uint32_t value1 {ival}; + FiInnerStructure value2 {eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR, + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2, ival}; + cdr.set_encoding_flag(encoding); + cdr.serialize_encapsulation(); + Cdr::state enc_state(cdr); + cdr.begin_serialize_type(enc_state, encoding); + cdr << MemberId(1) << value1; + cdr << MemberId(2) << value2; + cdr.end_serialize_type(enc_state); + Cdr::state enc_state_end(cdr); + //} + + //{ Test encoded content + ASSERT_EQ(cdr.get_serialized_data_length(), expected_streams[tested_stream].size()); + ASSERT_EQ(0, memcmp(buffer.get(), expected_streams[tested_stream].data(), + expected_streams[tested_stream].size())); + //} + + //{ Decoding + uint32_t dvalue1 {0}; + FiInnerStructure dvalue2 {eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR, + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2, ival}; + cdr.reset(); + cdr.read_encapsulation(); + ASSERT_EQ(cdr.get_encoding_flag(), encoding); + ASSERT_EQ(cdr.endianness(), endianness); + cdr.deserialize_type(encoding, [&](Cdr& cdr_inner, const MemberId& mid)->bool + { + bool ret_value {true}; + + switch (mid.id) + { + case 0: + cdr_inner >> dvalue1; + break; + case 1: + cdr_inner >> dvalue2; + break; + default: + ret_value = false; + break; + } + + return ret_value; + }); + ASSERT_EQ(value1, dvalue1); + ASSERT_EQ(value2, dvalue2); + Cdr::state dec_state_end(cdr); + ASSERT_EQ(enc_state_end, dec_state_end); + //} +} + +INSTANTIATE_TEST_SUITE_P( + XCdrTest, + XCdrFinalTest, + ::testing::Values( + std::make_tuple(EncodingAlgorithmFlag::PLAIN_CDR, Cdr::Endianness::BIG_ENDIANNESS), + std::make_tuple(EncodingAlgorithmFlag::PLAIN_CDR, Cdr::Endianness::LITTLE_ENDIANNESS), + std::make_tuple(EncodingAlgorithmFlag::PLAIN_CDR2, Cdr::Endianness::BIG_ENDIANNESS), + std::make_tuple(EncodingAlgorithmFlag::PLAIN_CDR2, Cdr::Endianness::LITTLE_ENDIANNESS) + )); + diff --git a/test/xcdr/mutable.cpp b/test/xcdr/mutable.cpp index e09c3961..ba88bf12 100644 --- a/test/xcdr/mutable.cpp +++ b/test/xcdr/mutable.cpp @@ -183,6 +183,99 @@ void deserialize( } // namespace fastcdr } // namespace eprosima +struct MuInnerStructure +{ +public: + + MuInnerStructure() = default; + + MuInnerStructure( + eprosima::fastcdr::EncodingAlgorithmFlag e1, + eprosima::fastcdr::EncodingAlgorithmFlag e2 + ) + : enc_xcdrv1(e1) + , enc_xcdrv2(e2) + { + } + + MuInnerStructure( + eprosima::fastcdr::EncodingAlgorithmFlag e1, + eprosima::fastcdr::EncodingAlgorithmFlag e2, + uint8_t value + ) + : value1(value) + , enc_xcdrv1(e1) + , enc_xcdrv2(e2) + { + } + + bool operator ==( + const MuInnerStructure& other) const + { + return value1 == other.value1 && + value2.has_value() == other.value2.has_value() && + (!value2.has_value() || value2.value() == other.value2.value()); + } + + //! First being serialized. + uint32_t value1 {0}; + + //! Second being serialized. + eprosima::fastcdr::optional value2; + + eprosima::fastcdr::EncodingAlgorithmFlag enc_xcdrv1 {eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR}; + + eprosima::fastcdr::EncodingAlgorithmFlag enc_xcdrv2 {eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2}; +}; + +namespace eprosima { +namespace fastcdr { + +template<> +void serialize( + Cdr& cdr, + const MuInnerStructure& data) +{ + Cdr::state current_status(cdr); + cdr.begin_serialize_type(current_status, cdr.get_cdr_version() == eprosima::fastcdr::CdrVersion::XCDRv1 + ? data.enc_xcdrv1 + : data.enc_xcdrv2); + cdr << MemberId(3) << data.value1; + cdr << MemberId(16) << data.value2; + cdr.end_serialize_type(current_status); +} + +template<> +void deserialize( + Cdr& cdr, + MuInnerStructure& data) +{ + cdr.deserialize_type(cdr.get_cdr_version() == eprosima::fastcdr::CdrVersion::XCDRv1 + ? data.enc_xcdrv1 + : data.enc_xcdrv2, + [&data](Cdr& cdr_inner, const MemberId& mid) -> bool + { + bool ret_value {true}; + switch (mid.id) + { + case 0: + cdr_inner >> data.value1; + break; + case 1: + cdr_inner >> data.value2; + break; + default: + ret_value = false; + break; + } + + return ret_value; + }); +} + +} // namespace fastcdr +} // namespace eprosima + /*! * @test Test a mutable structure where the encoded version has more members that the decoded one. * @code{.idl} @@ -861,6 +954,282 @@ TEST_P(XCdrMutableTest, inner_unordered_and_less_serialized_elements) //} } +/*! + * @test Test an inner final structure inside a mutable structure. + * @code{.idl} + * @final + * struct InnerFinalStructure + * { + * @id(3) + * unsigned long value1; + * @id(16) @optional + * unsigned long value2; + * }; + * + * @mutable + * struct MutableWithInnerFinalStruct + * { + * @id(1) + * unsigned long value1; + * @id(2) + * InnerFinalStructure value2; + * }; + * @endcode + */ +TEST_P(XCdrMutableTest, inner_final_structure) +{ + constexpr uint8_t ival {0xCD}; + + //{ Defining expected XCDR streams + XCdrStreamValues expected_streams; + expected_streams[0 + EncodingAlgorithmFlag::PL_CDR + Cdr::Endianness::BIG_ENDIANNESS] = + { + 0x00, 0x02, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x04, // ShortMemberHeader + 0x00, 0x00, 0x00, ival, // ULong + 0x00, 0x02, 0x00, 0x08, // ShortMemberHeader + 0x00, 0x00, 0x00, ival, // ULong + 0x00, 0x10, 0x00, 0x00, // ShortMemberHeader (optional) + 0x3F, 0x02, 0x00, 0x00, // Sentinel + }; + expected_streams[0 + EncodingAlgorithmFlag::PL_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = + { + 0x00, 0x03, 0x00, 0x00, // Encapsulation + 0x01, 0x00, 0x04, 0x00, // ShortMemberHeader + ival, 0x00, 0x00, 0x00, // ULong + 0x02, 0x00, 0x08, 0x00, // ShortMemberHeader + ival, 0x00, 0x00, 0x00, // ULong + 0x10, 0x00, 0x00, 0x00, // ShortMemberHeader + 0x02, 0x3F, 0x00, 0x00, // Sentinel + }; + expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = + { + 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x15, // DHEADER + 0x20, 0x00, 0x00, 0x01, // EMHEADER1(M) without NEXTINT + 0x00, 0x00, 0x00, ival, // ULong + 0x40, 0x00, 0x00, 0x02, // EMHEADER1(M) with NEXTINT + 0x00, 0x00, 0x00, 0x05, // NEXTINT + 0x00, 0x00, 0x00, ival, // ULong + 0x00, // Optional not present + }; + expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = + { + 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x15, 0x00, 0x00, 0x00, // DHEADER + 0x01, 0x00, 0x00, 0x20, // EMHEADER1(M) without NEXTINT + ival, 0x00, 0x00, 0x00, // ULong + 0x02, 0x00, 0x00, 0x40, // EMHEADER1(M) with NEXTINT + 0x05, 0x00, 0x00, 0x00, // NEXTINT + ival, 0x00, 0x00, 0x00, // ULong + 0x00, // Optional not present + }; + //} + + EncodingAlgorithmFlag encoding = std::get<0>(GetParam()); + Cdr::Endianness endianness = std::get<1>(GetParam()); + + //{ Prepare buffer + uint8_t tested_stream = 0 + encoding + endianness; + auto buffer = + std::unique_ptr{reinterpret_cast(calloc(expected_streams[tested_stream].size(), sizeof(char))), free}; + FastBuffer fast_buffer(buffer.get(), expected_streams[tested_stream].size()); + Cdr cdr(fast_buffer, endianness, get_version_from_algorithm(encoding)); + //} + + //{ Encode + uint32_t value1 {ival}; + MuInnerStructure value2 {eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, ival}; + cdr.set_encoding_flag(encoding); + cdr.serialize_encapsulation(); + Cdr::state enc_state(cdr); + cdr.begin_serialize_type(enc_state, encoding); + cdr << MemberId(1) << value1; + cdr << MemberId(2) << value2; + cdr.end_serialize_type(enc_state); + Cdr::state enc_state_end(cdr); + //} + + //{ Test encoded content + ASSERT_EQ(cdr.get_serialized_data_length(), expected_streams[tested_stream].size()); + ASSERT_EQ(0, memcmp(buffer.get(), expected_streams[tested_stream].data(), + expected_streams[tested_stream].size())); + //} + + //{ Decoding + uint32_t dvalue1 {0}; + MuInnerStructure dvalue2 {eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, ival}; + cdr.reset(); + cdr.read_encapsulation(); + ASSERT_EQ(cdr.get_encoding_flag(), encoding); + ASSERT_EQ(cdr.endianness(), endianness); + cdr.deserialize_type(encoding, [&](Cdr& cdr_inner, const MemberId& mid)->bool + { + bool ret_value {true}; + + switch (mid.id) + { + case 1: + cdr_inner >> dvalue1; + break; + case 2: + cdr_inner >> dvalue2; + break; + default: + ret_value = false; + break; + } + + return ret_value; + }); + ASSERT_EQ(value1, dvalue1); + ASSERT_EQ(value2, dvalue2); + Cdr::state dec_state_end(cdr); + ASSERT_EQ(enc_state_end, dec_state_end); + //} +} + +/*! + * @test Test an inner appendable structure inside a mutable structure. + * @code{.idl} + * @appendable + * struct InnerAppendableStructure + * { + * @id(3) + * unsigned long value1; + * @id(16) @optional + * unsigned long value2; + * }; + * + * @mutable + * struct MutableWithInnerAppendableStruct + * { + * @id(1) + * unsigned long value1; + * @id(2) + * InnerAppendableStructure value2; + * }; + * @endcode + */ +TEST_P(XCdrMutableTest, inner_appendable_structure) +{ + constexpr uint8_t ival {0xCD}; + + //{ Defining expected XCDR streams + XCdrStreamValues expected_streams; + expected_streams[0 + EncodingAlgorithmFlag::PL_CDR + Cdr::Endianness::BIG_ENDIANNESS] = + { + 0x00, 0x02, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x04, // ShortMemberHeader + 0x00, 0x00, 0x00, ival, // ULong + 0x00, 0x02, 0x00, 0x08, // ShortMemberHeader + 0x00, 0x00, 0x00, ival, // ULong + 0x00, 0x10, 0x00, 0x00, // ShortMemberHeader (optional) + 0x3F, 0x02, 0x00, 0x00, // Sentinel + }; + expected_streams[0 + EncodingAlgorithmFlag::PL_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = + { + 0x00, 0x03, 0x00, 0x00, // Encapsulation + 0x01, 0x00, 0x04, 0x00, // ShortMemberHeader + ival, 0x00, 0x00, 0x00, // ULong + 0x02, 0x00, 0x08, 0x00, // ShortMemberHeader + ival, 0x00, 0x00, 0x00, // ULong + 0x10, 0x00, 0x00, 0x00, // ShortMemberHeader + 0x02, 0x3F, 0x00, 0x00, // Sentinel + }; + expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = + { + 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x15, // DHEADER + 0x20, 0x00, 0x00, 0x01, // EMHEADER1(M) without NEXTINT + 0x00, 0x00, 0x00, ival, // ULong + 0x50, 0x00, 0x00, 0x02, // EMHEADER1(M) with NEXTINT + 0x00, 0x00, 0x00, 0x05, // NEXTINT + DHEADER + 0x00, 0x00, 0x00, ival, // ULong + 0x00, // Optional not present + }; + expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = + { + 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x15, 0x00, 0x00, 0x00, // DHEADER + 0x01, 0x00, 0x00, 0x20, // EMHEADER1(M) without NEXTINT + ival, 0x00, 0x00, 0x00, // ULong + 0x02, 0x00, 0x00, 0x50, // EMHEADER1(M) with NEXTINT + 0x05, 0x00, 0x00, 0x00, // NEXTINT + DHEADER + ival, 0x00, 0x00, 0x00, // ULong + 0x00, // Optional not present + }; + //} + + EncodingAlgorithmFlag encoding = std::get<0>(GetParam()); + Cdr::Endianness endianness = std::get<1>(GetParam()); + + //{ Prepare buffer + uint8_t tested_stream = 0 + encoding + endianness; + auto buffer = + std::unique_ptr{reinterpret_cast(calloc(expected_streams[tested_stream].size(), sizeof(char))), free}; + FastBuffer fast_buffer(buffer.get(), expected_streams[tested_stream].size()); + Cdr cdr(fast_buffer, endianness, get_version_from_algorithm(encoding)); + //} + + //{ Encode + uint32_t value1 {ival}; + MuInnerStructure value2 {eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2, ival}; + cdr.set_encoding_flag(encoding); + cdr.serialize_encapsulation(); + Cdr::state enc_state(cdr); + cdr.begin_serialize_type(enc_state, encoding); + cdr << MemberId(1) << value1; + cdr << MemberId(2) << value2; + cdr.end_serialize_type(enc_state); + Cdr::state enc_state_end(cdr); + //} + + //{ Test encoded content + ASSERT_EQ(cdr.get_serialized_data_length(), expected_streams[tested_stream].size()); + ASSERT_EQ(0, memcmp(buffer.get(), expected_streams[tested_stream].data(), + expected_streams[tested_stream].size())); + //} + + //{ Decoding + uint32_t dvalue1 {0}; + MuInnerStructure dvalue2 {eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2, ival}; + cdr.reset(); + cdr.read_encapsulation(); + ASSERT_EQ(cdr.get_encoding_flag(), encoding); + ASSERT_EQ(cdr.endianness(), endianness); + cdr.deserialize_type(encoding, [&](Cdr& cdr_inner, const MemberId& mid)->bool + { + bool ret_value {true}; + + switch (mid.id) + { + case 1: + cdr_inner >> dvalue1; + break; + case 2: + cdr_inner >> dvalue2; + break; + default: + ret_value = false; + break; + } + + return ret_value; + }); + ASSERT_EQ(value1, dvalue1); + ASSERT_EQ(value2, dvalue2); + Cdr::state dec_state_end(cdr); + ASSERT_EQ(enc_state_end, dec_state_end); + //} +} + INSTANTIATE_TEST_SUITE_P( XCdrTest, XCdrMutableTest, From 5d445eec3d081a1c1b302dc6b1f8f05914bb540b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Gonz=C3=A1lez?= Date: Fri, 4 Oct 2024 11:26:19 +0200 Subject: [PATCH 18/33] CdrSizeCalculator adds 4 bytes extra in a fixed string member of mutable structure in XCDRv2 (#238) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Refs #21794. Add regression test Signed-off-by: Ricardo González Moreno * Refs #21794. Fix Signed-off-by: Ricardo González Moreno --------- Signed-off-by: Ricardo González Moreno --- include/fastcdr/CdrSizeCalculator.hpp | 1 + src/cpp/CdrSizeCalculator.cpp | 4 +- test/xcdr/basic_types.cpp | 459 ++++++++++++++++++++++++++ 3 files changed, 462 insertions(+), 2 deletions(-) diff --git a/include/fastcdr/CdrSizeCalculator.hpp b/include/fastcdr/CdrSizeCalculator.hpp index 1caab9ef..7f3a2328 100644 --- a/include/fastcdr/CdrSizeCalculator.hpp +++ b/include/fastcdr/CdrSizeCalculator.hpp @@ -487,6 +487,7 @@ class CdrSizeCalculator { size_t calculated_size {4 + alignment(current_alignment, 4) + data.size() + 1}; current_alignment += calculated_size; + serialized_member_size_ = SERIALIZED_MEMBER_SIZE; return calculated_size; } diff --git a/src/cpp/CdrSizeCalculator.cpp b/src/cpp/CdrSizeCalculator.cpp index 6462422b..225cc7ee 100644 --- a/src/cpp/CdrSizeCalculator.cpp +++ b/src/cpp/CdrSizeCalculator.cpp @@ -35,9 +35,9 @@ CdrSizeCalculator::CdrSizeCalculator( CdrSizeCalculator::CdrSizeCalculator( CdrVersion cdr_version, EncodingAlgorithmFlag encoding) - : cdr_version_(cdr_version) - , current_encoding_(encoding) + : CdrSizeCalculator(cdr_version) { + current_encoding_ = encoding; } CdrVersion CdrSizeCalculator::get_cdr_version() const diff --git a/test/xcdr/basic_types.cpp b/test/xcdr/basic_types.cpp index b717201b..78911a71 100644 --- a/test/xcdr/basic_types.cpp +++ b/test/xcdr/basic_types.cpp @@ -21,6 +21,7 @@ #include #include +#include #include "utility.hpp" using namespace eprosima::fastcdr; @@ -2060,6 +2061,105 @@ TEST_P(XCdrBasicTypesTest, wstring) serialize(expected_streams, encoding, endianness, string_value, false); } +/*! + * @test Test a structure with a field of fixed string type. + * @code{.idl} + * struct FixedStringStruct + * { + * string<20> var_string; + * }; + * @endcode + */ +TEST_P(XCdrBasicTypesTest, fixed_string) +{ + const fixed_string<20> string_value {"AB"}; + constexpr uint8_t valA {65}; + constexpr uint8_t valB {66}; + + //{ Defining expected XCDR streams + XCdrStreamValues expected_streams; + expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = + { + 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x03, // String length + valA, valB, 0x00 // String + }; + expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = + { + 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x03, 0x00, 0x00, 0x00, // String length + valA, valB, 0x00 // String + }; + expected_streams[0 + EncodingAlgorithmFlag::PL_CDR + Cdr::Endianness::BIG_ENDIANNESS] = + { + 0x00, 0x02, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x07, // ShortMemberHeader + 0x00, 0x00, 0x00, 0x03, // String length + valA, valB, 0x00, // String + 0x00, // Alignment + 0x3F, 0x02, 0x00, 0x00 // Sentinel + }; + expected_streams[0 + EncodingAlgorithmFlag::PL_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = + { + 0x00, 0x03, 0x00, 0x00, // Encapsulation + 0x01, 0x00, 0x07, 0x00, // ShortMemberHeader + 0x03, 0x00, 0x00, 0x00, // String length + valA, valB, 0x00, // String + 0x00, // Alignment + 0x02, 0x3F, 0x00, 0x00 // Sentinel + }; + expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = + { + 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x03, // String length + valA, valB, 0x00 // String + }; + expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = + { + 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x03, 0x00, 0x00, 0x00, // String length + valA, valB, 0x00 // String + }; + expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = + { + 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x07, // DHEADER + 0x00, 0x00, 0x00, 0x03, // String length + valA, valB, 0x00 // String + }; + expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = + { + 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x07, 0x00, 0x00, 0x00, // DHEADER + 0x03, 0x00, 0x00, 0x00, // String length + valA, valB, 0x00 // String + }; + expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = + { + 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x0B, // DHEADER + 0x50, 0x00, 0x00, 0x01, // EMHEADER1(M) with NEXTINT + 0x00, 0x00, 0x00, 0x03, // String length + valA, valB, 0x00 // String + }; + expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = + { + 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x0B, 0x00, 0x00, 0x00, // DHEADER + 0x01, 0x00, 0x00, 0x50, // EMHEADER1(M) with NEXTINT + 0x03, 0x00, 0x00, 0x00, // String length + valA, valB, 0x00 // String + }; + //} + + EncodingAlgorithmFlag encoding = std::get<0>(GetParam()); + Cdr::Endianness endianness = std::get<1>(GetParam()); + + serialize(expected_streams, encoding, endianness, string_value, true); + + serialize(expected_streams, encoding, endianness, string_value, false); +} + /*! * @test Test a structure with a field of enum 32bits type. * @code{.idl} @@ -10731,6 +10831,365 @@ TEST_P(XCdrBasicTypesTest, enum8_align_4) align_serialize(expected_streams, encoding, endianness, align_value, enum_value, false); } +/*! + * @test Test a structure with strings + * @code{.idl} + * struct InnerStructStruct + * { + * @id(1) + * string var_field1; + * @id(2) + * wstring var_field2; + * @id(3) + * string<20> var_field3; + * }; + * @endcode + */ +TEST_P(XCdrBasicTypesTest, struct_with_strings) +{ + const std::string var_field1 {"AB"}; + const std::wstring var_field2 {L"AB"}; + const fixed_string<20> var_field3 {"AB"}; + constexpr uint8_t valA {65}; + constexpr uint8_t valB {66}; + + //{ Defining expected XCDR streams + XCdrStreamValues expected_streams; + expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = + { + 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x03, // String length + valA, valB, 0x00, // String + 0x00, // Alignment + 0x00, 0x00, 0x00, 0x02, // WString length + 0x00, valA, // WString + 0x00, valB, // WString + 0x00, 0x00, 0x00, 0x03, // Fixed String length + valA, valB, 0x00 // Fixed String + }; + expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = + { + 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x03, 0x00, 0x00, 0x00, // String length + valA, valB, 0x00, // String + 0x00, // Alignment + 0x02, 0x00, 0x00, 0x00, // WString length + valA, 0x00, // WString + valB, 0x00, // WString + 0x03, 0x00, 0x00, 0x00, // Fixed String length + valA, valB, 0x00 // Fixed String + }; + expected_streams[0 + EncodingAlgorithmFlag::PL_CDR + Cdr::Endianness::BIG_ENDIANNESS] = + { + 0x00, 0x02, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x07, // ShortMemberHeader + 0x00, 0x00, 0x00, 0x03, // String length + valA, valB, 0x00, // String + 0x00, // Alignment + 0x00, 0x02, 0x00, 0x08, // ShortMemberHeader + 0x00, 0x00, 0x00, 0x02, // WString length + 0x00, valA, // WString + 0x00, valB, // WString + 0x00, 0x03, 0x00, 0x07, // ShortMemberHeader + 0x00, 0x00, 0x00, 0x03, // Fixed String length + valA, valB, 0x00, // Fixed String + 0x00, // Alignment + 0x3F, 0x02, 0x00, 0x00 // Sentinel + }; + expected_streams[0 + EncodingAlgorithmFlag::PL_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = + { + 0x00, 0x03, 0x00, 0x00, // Encapsulation + 0x01, 0x00, 0x07, 0x00, // ShortMemberHeader + 0x03, 0x00, 0x00, 0x00, // String length + valA, valB, 0x00, // String + 0x00, // Alignment + 0x02, 0x00, 0x08, 0x00, // ShortMemberHeader + 0x02, 0x00, 0x00, 0x00, // WString length + valA, 0x00, // WString + valB, 0x00, // WString + 0x03, 0x00, 0x07, 0x00, // ShortMemberHeader + 0x03, 0x00, 0x00, 0x00, // Fixed String length + valA, valB, 0x00, // Fixed String + 0x00, // Alignment + 0x02, 0x3F, 0x00, 0x00 // Sentinel + }; + expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = + { + 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x03, // String length + valA, valB, 0x00, // String + 0x00, // Alignment + 0x00, 0x00, 0x00, 0x02, // WString length + 0x00, valA, // WString + 0x00, valB, // WString + 0x00, 0x00, 0x00, 0x03, // Fixed String length + valA, valB, 0x00 // Fixed String + }; + expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = + { + 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x03, 0x00, 0x00, 0x00, // String length + valA, valB, 0x00, // String + 0x00, // Alignment + 0x02, 0x00, 0x00, 0x00, // WString length + valA, 0x00, // WString + valB, 0x00, // WString + 0x03, 0x00, 0x00, 0x00, // Fixed String length + valA, valB, 0x00 // Fixed String + }; + expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = + { + 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x17, // DHEADER + 0x00, 0x00, 0x00, 0x03, // String length + valA, valB, 0x00, // String + 0x00, // Alignment + 0x00, 0x00, 0x00, 0x02, // WString length + 0x00, valA, // WString + 0x00, valB, // WString + 0x00, 0x00, 0x00, 0x03, // Fixed String length + valA, valB, 0x00 // Fixed String + }; + expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = + { + 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x17, 0x00, 0x00, 0x00, // DHEADER + 0x03, 0x00, 0x00, 0x00, // String length + valA, valB, 0x00, // String + 0x00, // Alignment + 0x02, 0x00, 0x00, 0x00, // WString length + valA, 0x00, // WString + valB, 0x00, // WString + 0x03, 0x00, 0x00, 0x00, // Fixed String length + valA, valB, 0x00 // Fixed String + }; + expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = + { + 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x23, // DHEADER + 0x50, 0x00, 0x00, 0x01, // EMHEADER1(M) with NEXTINT + 0x00, 0x00, 0x00, 0x03, // String length + valA, valB, 0x00, // String + 0x00, // Alignment + 0x30, 0x00, 0x00, 0x02, // EMHEADER1(M) without NEXTINT + 0x00, 0x00, 0x00, 0x02, // WString length + 0x00, valA, // WString + 0x00, valB, // WString + 0x50, 0x00, 0x00, 0x03, // EMHEADER1(M) with NEXTINT + 0x00, 0x00, 0x00, 0x03, // Fixed String length + valA, valB, 0x00 // Fixed String + }; + expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = + { + 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x23, 0x00, 0x00, 0x00, // DHEADER + 0x01, 0x00, 0x00, 0x50, // EMHEADER1(M) with NEXTINT + 0x03, 0x00, 0x00, 0x00, // String length + valA, valB, 0x00, // String + 0x00, // Alignment + 0x02, 0x00, 0x00, 0x30, // EMHEADER1(M) without NEXTINT + 0x02, 0x00, 0x00, 0x00, // WString length + valA, 0x00, // WString + valB, 0x00, // WString + 0x03, 0x00, 0x00, 0x50, // EMHEADER1(M) with NEXTINT + 0x03, 0x00, 0x00, 0x00, // Fixed String length + valA, valB, 0x00 // Fixed String + }; + //} + + EncodingAlgorithmFlag encoding = std::get<0>(GetParam()); + Cdr::Endianness endianness = std::get<1>(GetParam()); + + //{ Calculate encoded size. + CdrSizeCalculator calculator(get_version_from_algorithm(encoding)); + size_t current_alignment {0}; + size_t calculated_size {calculator.begin_calculate_type_serialized_size(encoding, current_alignment)}; + calculated_size += calculator.calculate_member_serialized_size(MemberId(1), var_field1, current_alignment); + calculated_size += calculator.calculate_member_serialized_size(MemberId(2), var_field2, current_alignment); + calculated_size += calculator.calculate_member_serialized_size(MemberId(3), var_field3, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size(encoding, current_alignment); + calculated_size += 4; // Encapsulation + //} + + { + //{ Prepare buffer + uint8_t tested_stream = 0 + encoding + endianness; + auto buffer = + std::unique_ptr{reinterpret_cast(calloc(expected_streams[tested_stream].size(), sizeof(char))), free}; + FastBuffer fast_buffer(buffer.get(), expected_streams[tested_stream].size()); + Cdr cdr(fast_buffer, endianness, get_version_from_algorithm(encoding)); + //} + + //{ Encode + cdr.set_encoding_flag(encoding); + cdr.serialize_encapsulation(); + Cdr::state enc_state(cdr); + cdr.begin_serialize_type(enc_state, encoding); + cdr.serialize_member(MemberId(1), var_field1); + cdr.serialize_member(MemberId(2), var_field2); + cdr.serialize_member(MemberId(3), var_field3); + cdr.end_serialize_type(enc_state); + Cdr::state enc_state_end(cdr); + //} + + //{ Test encoded content + ASSERT_EQ(cdr.get_serialized_data_length(), expected_streams[tested_stream].size()); + ASSERT_EQ(cdr.get_serialized_data_length(), calculated_size); + ASSERT_EQ(0, memcmp(buffer.get(), expected_streams[tested_stream].data(), + expected_streams[tested_stream].size())); + //} + + //{ Decoding + std::string dvar_field1; + std::wstring dvar_field2; + fixed_string<20> dvar_field3; + cdr.reset(); + cdr.read_encapsulation(); + ASSERT_EQ(cdr.get_encoding_flag(), encoding); + ASSERT_EQ(cdr.endianness(), endianness); + cdr.deserialize_type(encoding, [&](Cdr& cdr_inner, const MemberId& mid)->bool + { + bool ret_value = true; + + if (EncodingAlgorithmFlag::PL_CDR == cdr_inner.get_encoding_flag() || + EncodingAlgorithmFlag::PL_CDR2 == cdr_inner.get_encoding_flag()) + { + switch (mid.id) + { + case 1: + cdr_inner.deserialize_member(dvar_field1); + break; + case 2: + cdr_inner.deserialize_member(dvar_field2); + break; + case 3: + cdr_inner.deserialize_member(dvar_field3); + break; + default: + ret_value = false; + break; + } + } + else + { + switch (mid.id) + { + case 0: + cdr_inner.deserialize_member(dvar_field1); + break; + case 1: + cdr_inner.deserialize_member(dvar_field2); + break; + case 2: + cdr_inner.deserialize_member(dvar_field3); + break; + default: + ret_value = false; + break; + } + } + + return ret_value; + }); + ASSERT_EQ(var_field1, dvar_field1); + ASSERT_EQ(var_field2, dvar_field2); + ASSERT_EQ(var_field3, dvar_field3); + Cdr::state dec_state_end(cdr); + ASSERT_EQ(enc_state_end, dec_state_end); + //} + } + + { + //{ Prepare buffer + uint8_t tested_stream = 0 + encoding + endianness; + auto buffer = + std::unique_ptr{reinterpret_cast(calloc(expected_streams[tested_stream].size(), sizeof(char))), free}; + FastBuffer fast_buffer(buffer.get(), expected_streams[tested_stream].size()); + Cdr cdr(fast_buffer, endianness, get_version_from_algorithm(encoding)); + //} + + //{ Encode + cdr.set_encoding_flag(encoding); + cdr.serialize_encapsulation(); + Cdr::state enc_state(cdr); + cdr.begin_serialize_type(enc_state, encoding); + cdr << MemberId(1) << var_field1; + cdr << MemberId(2) << var_field2; + cdr << MemberId(3) << var_field3; + cdr.end_serialize_type(enc_state); + Cdr::state enc_state_end(cdr); + //} + + //{ Test encoded content + ASSERT_EQ(cdr.get_serialized_data_length(), expected_streams[tested_stream].size()); + ASSERT_EQ(cdr.get_serialized_data_length(), calculated_size); + ASSERT_EQ(0, memcmp(buffer.get(), expected_streams[tested_stream].data(), + expected_streams[tested_stream].size())); + //} + + //{ Decoding + std::string dvar_field1; + std::wstring dvar_field2; + fixed_string<20> dvar_field3; + cdr.reset(); + cdr.read_encapsulation(); + ASSERT_EQ(cdr.get_encoding_flag(), encoding); + ASSERT_EQ(cdr.endianness(), endianness); + cdr.deserialize_type(encoding, [&](Cdr& cdr_inner, const MemberId& mid)->bool + { + bool ret_value = true; + + if (EncodingAlgorithmFlag::PL_CDR == cdr_inner.get_encoding_flag() || + EncodingAlgorithmFlag::PL_CDR2 == cdr_inner.get_encoding_flag()) + { + switch (mid.id) + { + case 1: + cdr_inner >> dvar_field1; + break; + case 2: + cdr_inner >> dvar_field2; + break; + case 3: + cdr_inner >> dvar_field3; + break; + default: + ret_value = false; + break; + } + } + else + { + switch (mid.id) + { + case 0: + cdr_inner >> dvar_field1; + break; + case 1: + cdr_inner >> dvar_field2; + break; + case 2: + cdr_inner >> dvar_field3; + break; + default: + ret_value = false; + break; + } + } + + return ret_value; + }); + ASSERT_EQ(var_field1, dvar_field1); + ASSERT_EQ(var_field2, dvar_field2); + ASSERT_EQ(var_field3, dvar_field3); + Cdr::state dec_state_end(cdr); + ASSERT_EQ(enc_state_end, dec_state_end); + //} + } +} + /*! * @test Test a structure with two fields of struct type. * @code{.idl} From 2f90c7bbccc1318fad21cf48dbc87eaf934d3590 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Poderoso?= <120394830+JesusPoderoso@users.noreply.github.com> Date: Wed, 9 Oct 2024 08:41:47 +0200 Subject: [PATCH 19/33] Bump version to v2.2.5 (#239) Signed-off-by: eProsima --- CMakeLists.txt | 2 +- package.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e427991..4350498e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,7 @@ endif() ############################################################################### # Project # ############################################################################### -project(fastcdr VERSION 2.2.4 LANGUAGES CXX) +project(fastcdr VERSION 2.2.5 LANGUAGES CXX) set(PROJECT_NAME_STYLED "FastCDR") set(PROJECT_NAME_LARGE "Fast CDR") diff --git a/package.xml b/package.xml index 023224c7..c00787e1 100644 --- a/package.xml +++ b/package.xml @@ -2,7 +2,7 @@ fastcdr - 2.2.4 + 2.2.5 *eProsima Fast CDR* is a C++ serialization library implementing the Common Data Representation (CDR) mechanism defined by the Object Management Group (OMG) consortium. CDR is the serialization mechanism used in DDS for the DDS Interoperability Wire Protocol (DDSI-RTPS). From 68326c5bb8a44a58dfec7e0811edcbbb9f4c9233 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Poderoso?= <120394830+JesusPoderoso@users.noreply.github.com> Date: Thu, 10 Oct 2024 16:09:58 +0200 Subject: [PATCH 20/33] Fix supported branches in PR template backports section (#242) Signed-off-by: eProsima --- .github/pull_request_template.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 383d6a52..4cbefe3b 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -17,7 +17,7 @@ In case of bug fixes, please provide the list of supported branches where this fix should be also merged. Please uncomment following line, adjusting the corresponding target branches for the backport. --> - + From b7110b40dc4ae390a9da3acdafe4b329962babad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Poderoso?= <120394830+JesusPoderoso@users.noreply.github.com> Date: Tue, 15 Oct 2024 17:04:30 +0200 Subject: [PATCH 21/33] Update commercial support section in project README (#243) Signed-off-by: eProsima --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 49a9aa6f..080af3ba 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,12 @@ **eProsima Fast CDR** is a C++ library that provides two serialization mechanisms. One is the standard CDR serialization mechanism, while the other is a faster implementation that modifies the standard. +## Commercial support + +Looking for commercial support? Write us to info@eprosima.com + +Find more about us at [eProsima’s webpage](https://eprosima.com/). + ## Build **eProsima Fast CDR** provides [CMake][cmake] scripts to build and install it (please read the [installation guide](https://fast-dds.docs.eprosima.com/en/latest/installation/sources/sources_linux.html#cmake-installation) for more details). From f4d99fe4f37829c1620b24c57028bf78aef3add1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Gonz=C3=A1lez?= Date: Tue, 5 Nov 2024 08:57:21 +0100 Subject: [PATCH 22/33] Support setting and encoding options with least significant bits set with possible padding (#244) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Refs #22039. Support serializing options Signed-off-by: Ricardo González Moreno * Refs #22039. Add test Signed-off-by: Ricardo González Moreno --------- Signed-off-by: Ricardo González Moreno --- include/fastcdr/Cdr.h | 6 + src/cpp/Cdr.cpp | 35 +++ test/xcdr/appendable.cpp | 177 +++++++++-- test/xcdr/basic_types.cpp | 607 +++++++++++++++++++------------------- test/xcdr/external.cpp | 44 +-- test/xcdr/final.cpp | 6 +- test/xcdr/mutable.cpp | 30 +- test/xcdr/optional.cpp | 352 +++++++++++----------- test/xcdr/xcdrv1.cpp | 3 + test/xcdr/xcdrv2.cpp | 10 +- 10 files changed, 744 insertions(+), 526 deletions(-) diff --git a/include/fastcdr/Cdr.h b/include/fastcdr/Cdr.h index 983c886b..56334674 100644 --- a/include/fastcdr/Cdr.h +++ b/include/fastcdr/Cdr.h @@ -3548,6 +3548,12 @@ class Cdr //! Specifies if a DHEADER was serialized. Used to optimize XCDRv2 member headers. serialized_member_size_ {NO_SERIALIZED_MEMBER_SIZE}; + //! Stores the initial state. + state initial_state_; + + //! Whether the encapsulation was serialized. + bool encapsulation_serialized_ {false}; + uint32_t get_long_lc( SerializedMemberSizeForNextInt serialized_member_size); diff --git a/src/cpp/Cdr.cpp b/src/cpp/Cdr.cpp index 1b31547e..6d684999 100644 --- a/src/cpp/Cdr.cpp +++ b/src/cpp/Cdr.cpp @@ -141,6 +141,7 @@ Cdr::Cdr( , offset_(cdr_buffer.begin()) , origin_(cdr_buffer.begin()) , end_(cdr_buffer.end()) + , initial_state_(*this) { switch (cdr_version_) { @@ -272,7 +273,21 @@ Cdr& Cdr::read_encapsulation() if (CdrVersion::CORBA_CDR < cdr_version_) { deserialize(options_); + + uint8_t option_align {static_cast(options_[1] & 0x3u)}; + + if (0 < option_align) + { + auto length {end_ - cdr_buffer_.begin()}; + auto alignment = ((length + 3u) & ~3u) - length; + + if (0 == alignment) + { + end_ -= option_align; + } + } } + } catch (Exception& ex) { @@ -326,6 +341,7 @@ Cdr& Cdr::serialize_encapsulation() } reset_alignment(); + encapsulation_serialized_ = true; return *this; } @@ -365,6 +381,25 @@ void Cdr::set_dds_cdr_options( const std::array& options) { options_ = options; + + if (CdrVersion::XCDRv1 == cdr_version_ || + CdrVersion::XCDRv2 == cdr_version_) + { + auto length {offset_ - cdr_buffer_.begin()}; + auto alignment = ((length + 3u) & ~3u) - length; + options_[1] = static_cast(options_[1] & 0xC) + static_cast(alignment & 0x3); + } + + if (encapsulation_serialized_ && CdrVersion::CORBA_CDR < cdr_version_) + { + state previous_state(*this); + set_state(initial_state_); + + jump(2); + serialize(options_); + + set_state(previous_state); + } } void Cdr::change_endianness( diff --git a/test/xcdr/appendable.cpp b/test/xcdr/appendable.cpp index 0b125332..35e34b97 100644 --- a/test/xcdr/appendable.cpp +++ b/test/xcdr/appendable.cpp @@ -381,21 +381,21 @@ TEST_P(XCdrAppendableTest, more_serialized_elements) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x01, // Encapsulation 0x00, 0x00, 0x00, ival, // ULong 0x00, ival, // UShort ival, // Octet }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x01, // Encapsulation ival, 0x00, 0x00, 0x00, // ULong ival, 0x00, // UShort ival, // Octet }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x01, // Encapsulation 0x00, 0x00, 0x00, 0x7, // DHEADER 0x00, 0x00, 0x00, ival, // ULong 0x00, ival, // UShort @@ -403,7 +403,7 @@ TEST_P(XCdrAppendableTest, more_serialized_elements) }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x01, // Encapsulation 0x07, 0x00, 0x00, 0x00, // DHEADER ival, 0x00, 0x00, 0x00, // ULong ival, 0x00, // UShort @@ -435,6 +435,7 @@ TEST_P(XCdrAppendableTest, more_serialized_elements) cdr << MemberId(2) << value2; cdr << MemberId(3) << value3; cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -516,26 +517,26 @@ TEST_P(XCdrAppendableTest, less_serialized_elements) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, ival, // ULong 0x00, ival // UShort }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x02, // Encapsulation ival, 0x00, 0x00, 0x00, // ULong ival, 0x00 // UShort }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x6, // DHEADER 0x00, 0x00, 0x00, ival, // ULong 0x00, ival // UShort }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x02, // Encapsulation 0x06, 0x00, 0x00, 0x00, // DHEADER ival, 0x00, 0x00, 0x00, // ULong ival, 0x00 // UShort @@ -564,6 +565,137 @@ TEST_P(XCdrAppendableTest, less_serialized_elements) cdr << MemberId(1) << value1; cdr << MemberId(2) << value2; cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); + Cdr::state enc_state_end(cdr); + //} + + //{ Test encoded content + ASSERT_EQ(cdr.get_serialized_data_length(), expected_streams[tested_stream].size()); + ASSERT_EQ(0, memcmp(buffer.get(), expected_streams[tested_stream].data(), + expected_streams[tested_stream].size())); + //} + + //{ Decoding + uint32_t dvalue1 {0}; + uint16_t dvalue2 {0}; + uint8_t dvalue3 {0}; + cdr.reset(); + cdr.read_encapsulation(); + ASSERT_EQ(cdr.get_encoding_flag(), encoding); + ASSERT_EQ(cdr.endianness(), endianness); + cdr.deserialize_type(encoding, [&](Cdr& cdr_inner, const MemberId& mid)->bool + { + bool ret_value = true; + + switch (mid.id) + { + case 0: + cdr_inner >> dvalue1; + break; + case 1: + cdr_inner >> dvalue2; + break; + case 2: + cdr_inner >> dvalue3; + break; + default: + ret_value = false; + break; + } + + return ret_value; + }); + Cdr::state dec_state_end(cdr); + ASSERT_EQ(enc_state_end, dec_state_end); + ASSERT_EQ(value1, dvalue1); + ASSERT_EQ(value2, dvalue2); + ASSERT_EQ(0, dvalue3); + //} +} + +/*! + * @test Test an appendable structure where the encoded version has less members that the decoded one. + * The decoded buffer takes into account the extra padding in order to reach the next 4-byte aligned offset. + * @code{.idl} + * @appendable + * struct AppendableStruct // Encoded version + * { + * @id(1) + * unsigned long value1; + * @id(2) + * unsigned short value2; + * }; + * + * @appendable + * struct AppendableStruct // Decoded version + * { + * @id(1) + * unsigned long value1; + * @id(2) + * unsigned short value2; + * @id(3) + * octet value3; + * }; + * @endcode + */ +TEST_P(XCdrAppendableTest, less_serialized_elements_extra_padding) +{ + constexpr uint8_t ival {0xCD}; + + //{ Defining expected XCDR streams + XCdrStreamValues expected_streams; + expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = + { + 0x00, 0x00, 0x00, 0x02, // Encapsulation + 0x00, 0x00, 0x00, ival, // ULong + 0x00, ival // UShort + }; + expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = + { + 0x00, 0x01, 0x00, 0x02, // Encapsulation + ival, 0x00, 0x00, 0x00, // ULong + ival, 0x00 // UShort + }; + expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = + { + 0x00, 0x08, 0x00, 0x02, // Encapsulation + 0x00, 0x00, 0x00, 0x6, // DHEADER + 0x00, 0x00, 0x00, ival, // ULong + 0x00, ival // UShort + }; + expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = + { + 0x00, 0x09, 0x00, 0x02, // Encapsulation + 0x06, 0x00, 0x00, 0x00, // DHEADER + ival, 0x00, 0x00, 0x00, // ULong + ival, 0x00 // UShort + }; + //} + + EncodingAlgorithmFlag encoding = std::get<0>(GetParam()); + Cdr::Endianness endianness = std::get<1>(GetParam()); + + //{ Prepare buffer + uint8_t tested_stream = 0 + encoding + endianness; + auto buffer = + std::unique_ptr{reinterpret_cast(calloc(expected_streams[tested_stream].size(), sizeof(char))), free}; + auto alignment {((expected_streams[tested_stream].size() + 3u) & ~3u) - expected_streams[tested_stream].size()}; + FastBuffer fast_buffer(buffer.get(), expected_streams[tested_stream].size() + alignment); + Cdr cdr(fast_buffer, endianness, get_version_from_algorithm(encoding)); + //} + + //{ Encode + uint32_t value1 { ival }; + uint16_t value2 { ival }; + cdr.set_encoding_flag(encoding); + cdr.serialize_encapsulation(); + Cdr::state enc_state(cdr); + cdr.begin_serialize_type(enc_state, encoding); + cdr << MemberId(1) << value1; + cdr << MemberId(2) << value2; + cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -652,7 +784,7 @@ TEST_P(XCdrAppendableTest, inner_more_serialized_elements) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x01, // Encapsulation 0x00, 0x00, 0x00, ival, // ULong 0x00, ival, // UShort ival, // Octet @@ -663,7 +795,7 @@ TEST_P(XCdrAppendableTest, inner_more_serialized_elements) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x01, // Encapsulation ival, 0x00, 0x00, 0x00, // ULong ival, 0x00, // UShort ival, // Octet @@ -674,7 +806,7 @@ TEST_P(XCdrAppendableTest, inner_more_serialized_elements) }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x01, // Encapsulation 0x00, 0x00, 0x00, 0x17, // DHEADER 0x00, 0x00, 0x00, 0x07, // DHEADER 0x00, 0x00, 0x00, ival, // ULong @@ -688,7 +820,7 @@ TEST_P(XCdrAppendableTest, inner_more_serialized_elements) }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x01, // Encapsulation 0x17, 0x00, 0x00, 0x00, // DHEADER 0x07, 0x00, 0x00, 0x00, // DHEADER ival, 0x00, 0x00, 0x00, // ULong @@ -723,6 +855,7 @@ TEST_P(XCdrAppendableTest, inner_more_serialized_elements) cdr << MemberId(1) << value; cdr << MemberId(2) << value; cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -812,7 +945,7 @@ TEST_P(XCdrAppendableTest, inner_less_serialized_elements) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, ival, // ULong 0x00, ival, // UShort 0x00, 0x00, // Alignment @@ -821,7 +954,7 @@ TEST_P(XCdrAppendableTest, inner_less_serialized_elements) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x02, // Encapsulation ival, 0x00, 0x00, 0x00, // ULong ival, 0x00, // UShort 0x00, 0x00, // Alignment @@ -830,7 +963,7 @@ TEST_P(XCdrAppendableTest, inner_less_serialized_elements) }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x16, // DHEADER 0x00, 0x00, 0x00, 0x06, // DHEADER 0x00, 0x00, 0x00, ival, // ULong @@ -842,7 +975,7 @@ TEST_P(XCdrAppendableTest, inner_less_serialized_elements) }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x02, // Encapsulation 0x16, 0x00, 0x00, 0x00, // DHEADER 0x06, 0x00, 0x00, 0x00, // DHEADER ival, 0x00, 0x00, 0x00, // ULong @@ -875,6 +1008,7 @@ TEST_P(XCdrAppendableTest, inner_less_serialized_elements) cdr << MemberId(1) << value; cdr << MemberId(2) << value; cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -943,7 +1077,7 @@ TEST_P(XCdrAppendableTest, inner_mutable) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x04, // ShortMemberHeader 0x00, 0x00, 0x00, ival, // ULong 0x00, 0x01, 0x00, 0x02, // ShortMemberHeader @@ -954,7 +1088,7 @@ TEST_P(XCdrAppendableTest, inner_mutable) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x04, 0x00, // ShortMemberHeader ival, 0x00, 0x00, 0x00, // ULong 0x01, 0x00, 0x02, 0x00, // ShortMemberHeader @@ -1009,6 +1143,7 @@ TEST_P(XCdrAppendableTest, inner_mutable) cdr << MemberId(0) << value; cdr << MemberId(1) << value2; cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -1095,7 +1230,7 @@ TEST_P(XCdrAppendableTest, inner_final_structure) }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x09, // DHEADER 0x00, 0x00, 0x00, ival, // ULong 0x00, 0x00, 0x00, ival, // ULong @@ -1103,7 +1238,7 @@ TEST_P(XCdrAppendableTest, inner_final_structure) }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x03, // Encapsulation 0x09, 0x00, 0x00, 0x00, // DHEADER ival, 0x00, 0x00, 0x00, // ULong ival, 0x00, 0x00, 0x00, // ULong @@ -1134,6 +1269,7 @@ TEST_P(XCdrAppendableTest, inner_final_structure) cdr << MemberId(1) << value1; cdr << MemberId(2) << value2; cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -1264,6 +1400,7 @@ TEST_P(XCdrAppendableTest, inner_mutable_structure) cdr << MemberId(1) << value1; cdr << MemberId(2) << value2; cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} diff --git a/test/xcdr/basic_types.cpp b/test/xcdr/basic_types.cpp index 78911a71..d2633259 100644 --- a/test/xcdr/basic_types.cpp +++ b/test/xcdr/basic_types.cpp @@ -289,6 +289,7 @@ void serialize( cdr << MemberId(1) << value; } cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -373,6 +374,7 @@ void align_serialize( cdr << MemberId(0) << align_value << MemberId(1) << value; } cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -478,6 +480,7 @@ void longdouble_align_serialize( cdr << MemberId(0) << align_value << MemberId(1) << value; } cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -561,12 +564,12 @@ TEST_P(XCdrBasicTypesTest, short) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x02, // Encapsulation ival, fval // Short }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x02, // Encapsulation fval, ival // Short }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR + Cdr::Endianness::BIG_ENDIANNESS] = @@ -587,36 +590,36 @@ TEST_P(XCdrBasicTypesTest, short) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x02, // Encapsulation ival, fval // Short }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x02, // Encapsulation fval, ival // Short }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x02, // DHEADER ival, fval // Short }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x02, // Encapsulation 0x02, 0x00, 0x00, 0x00, // DHEADER fval, ival // Short }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x06, // DHEADER 0x10, 0x00, 0x00, 0x01, // EMHEADER1(M) without NEXTINT ival, fval // Short }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x06, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x10, // EMHEADER1(M) without NEXTINT fval, ival // Short @@ -650,12 +653,12 @@ TEST_P(XCdrBasicTypesTest, ushort) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x02, // Encapsulation ival, fval // UShort }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x02, // Encapsulation fval, ival // UShort }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR + Cdr::Endianness::BIG_ENDIANNESS] = @@ -676,36 +679,36 @@ TEST_P(XCdrBasicTypesTest, ushort) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x02, // Encapsulation ival, fval // UShort }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x02, // Encapsulation fval, ival // UShort }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x02, // DHEADER ival, fval // UShort }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x02, // Encapsulation 0x02, 0x00, 0x00, 0x00, // DHEADER fval, ival // UShort }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x06, // DHEADER 0x10, 0x00, 0x00, 0x01, // EMHEADER1(M) without NEXTINT ival, fval // UShort }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x06, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x10, // EMHEADER1(M) without NEXTINT fval, ival // UShort @@ -1403,6 +1406,7 @@ TEST_P(XCdrBasicTypesTest, longdouble) cdr.begin_serialize_type(enc_state, encoding); cdr.serialize_member(MemberId(1), value); cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -1462,6 +1466,7 @@ TEST_P(XCdrBasicTypesTest, longdouble) cdr.begin_serialize_type(enc_state, encoding); cdr << MemberId(1) << value; cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -1521,12 +1526,12 @@ TEST_P(XCdrBasicTypesTest, boolean) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x03, // Encapsulation b_value // Boolean }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x03, // Encapsulation b_value // Boolean }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR + Cdr::Endianness::BIG_ENDIANNESS] = @@ -1547,36 +1552,36 @@ TEST_P(XCdrBasicTypesTest, boolean) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x03, // Encapsulation b_value // Boolean }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x03, // Encapsulation b_value // Boolean }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x01, // DHEADER b_value // Boolean }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x03, // Encapsulation 0x01, 0x00, 0x00, 0x00, // DHEADER b_value // Boolean }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x05, // DHEADER 0x00, 0x00, 0x00, 0x01, // EMHEADER1(M) without NEXTINT b_value // Boolean }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x03, // Encapsulation 0x05, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT b_value // Boolean @@ -1608,12 +1613,12 @@ TEST_P(XCdrBasicTypesTest, octet) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x03, // Encapsulation octet_value // Octet }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x03, // Encapsulation octet_value // Octet }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR + Cdr::Endianness::BIG_ENDIANNESS] = @@ -1634,36 +1639,36 @@ TEST_P(XCdrBasicTypesTest, octet) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x03, // Encapsulation octet_value // Octet }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x03, // Encapsulation octet_value // Octet }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x01, // DHEADER octet_value // Octet }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x03, // Encapsulation 0x01, 0x00, 0x00, 0x00, // DHEADER octet_value // Octet }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x05, // DHEADER 0x00, 0x00, 0x00, 0x01, // EMHEADER1(M) without NEXTINT octet_value // Octet }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x03, // Encapsulation 0x05, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT octet_value // Octet @@ -1696,12 +1701,12 @@ TEST_P(XCdrBasicTypesTest, char) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x03, // Encapsulation valu // Char }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x03, // Encapsulation valu // Char }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR + Cdr::Endianness::BIG_ENDIANNESS] = @@ -1722,36 +1727,36 @@ TEST_P(XCdrBasicTypesTest, char) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x03, // Encapsulation valu // Char }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x03, // Encapsulation valu // Char }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x01, // DHEADER valu // Char }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x03, // Encapsulation 0x01, 0x00, 0x00, 0x00, // DHEADER valu // Char }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x05, // DHEADER 0x00, 0x00, 0x00, 0x01, // EMHEADER1(M) without NEXTINT valu // Char }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x03, // Encapsulation 0x05, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT valu // Char @@ -1785,12 +1790,12 @@ TEST_P(XCdrBasicTypesTest, wchar) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x02, // Encapsulation ival, fval // Wchar }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x02, // Encapsulation fval, ival // Wchar }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR + Cdr::Endianness::BIG_ENDIANNESS] = @@ -1811,36 +1816,36 @@ TEST_P(XCdrBasicTypesTest, wchar) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x02, // Encapsulation ival, fval // Wchar }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x02, // Encapsulation fval, ival // Wchar }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x02, // DHEADER ival, fval // Wchar }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x02, // Encapsulation 0x02, 0x00, 0x00, 0x00, // DHEADER fval, ival // Wchar }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x06, // DHEADER 0x10, 0x00, 0x00, 0x01, // EMHEADER1(M) without NEXTINT ival, fval // Wchar }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x06, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x10, // EMHEADER1(M) without NEXTINT fval, ival // Wchar @@ -1874,13 +1879,13 @@ TEST_P(XCdrBasicTypesTest, string) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x01, // Encapsulation 0x00, 0x00, 0x00, 0x03, // String length valA, valB, 0x00 // String }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x01, // Encapsulation 0x03, 0x00, 0x00, 0x00, // String length valA, valB, 0x00 // String }; @@ -1904,33 +1909,33 @@ TEST_P(XCdrBasicTypesTest, string) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x01, // Encapsulation 0x00, 0x00, 0x00, 0x03, // String length valA, valB, 0x00 // String }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x01, // Encapsulation 0x03, 0x00, 0x00, 0x00, // String length valA, valB, 0x00 // String }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x01, // Encapsulation 0x00, 0x00, 0x00, 0x07, // DHEADER 0x00, 0x00, 0x00, 0x03, // String length valA, valB, 0x00 // String }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x01, // Encapsulation 0x07, 0x00, 0x00, 0x00, // DHEADER 0x03, 0x00, 0x00, 0x00, // String length valA, valB, 0x00 // String }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x01, // Encapsulation 0x00, 0x00, 0x00, 0x0B, // DHEADER 0x50, 0x00, 0x00, 0x01, // EMHEADER1(M) with NEXTINT 0x00, 0x00, 0x00, 0x03, // String length @@ -1938,7 +1943,7 @@ TEST_P(XCdrBasicTypesTest, string) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x01, // Encapsulation 0x0B, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x50, // EMHEADER1(M) with NEXTINT 0x03, 0x00, 0x00, 0x00, // String length @@ -2080,13 +2085,13 @@ TEST_P(XCdrBasicTypesTest, fixed_string) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x01, // Encapsulation 0x00, 0x00, 0x00, 0x03, // String length valA, valB, 0x00 // String }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x01, // Encapsulation 0x03, 0x00, 0x00, 0x00, // String length valA, valB, 0x00 // String }; @@ -2110,33 +2115,33 @@ TEST_P(XCdrBasicTypesTest, fixed_string) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x01, // Encapsulation 0x00, 0x00, 0x00, 0x03, // String length valA, valB, 0x00 // String }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x01, // Encapsulation 0x03, 0x00, 0x00, 0x00, // String length valA, valB, 0x00 // String }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x01, // Encapsulation 0x00, 0x00, 0x00, 0x07, // DHEADER 0x00, 0x00, 0x00, 0x03, // String length valA, valB, 0x00 // String }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x01, // Encapsulation 0x07, 0x00, 0x00, 0x00, // DHEADER 0x03, 0x00, 0x00, 0x00, // String length valA, valB, 0x00 // String }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x01, // Encapsulation 0x00, 0x00, 0x00, 0x0B, // DHEADER 0x50, 0x00, 0x00, 0x01, // EMHEADER1(M) with NEXTINT 0x00, 0x00, 0x00, 0x03, // String length @@ -2144,7 +2149,7 @@ TEST_P(XCdrBasicTypesTest, fixed_string) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x01, // Encapsulation 0x0B, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x50, // EMHEADER1(M) with NEXTINT 0x03, 0x00, 0x00, 0x00, // String length @@ -2275,12 +2280,12 @@ TEST_P(XCdrBasicTypesTest, enum16) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x02, // Encapsulation 0x00, 0x01 // UShort }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x02, // Encapsulation 0x01, 0x00 // UShort }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR + Cdr::Endianness::BIG_ENDIANNESS] = @@ -2301,36 +2306,36 @@ TEST_P(XCdrBasicTypesTest, enum16) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x02, // Encapsulation 0x00, 0x01 // UShort }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x02, // Encapsulation 0x01, 0x00 // UShort }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x02, // DHEADER 0x00, 0x01 // UShort }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x02, // Encapsulation 0x02, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00 // UShort }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x06, // DHEADER 0x10, 0x00, 0x00, 0x01, // EMHEADER1(M) without NEXTINT 0x00, 0x01 // UShort }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x06, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x10, // EMHEADER1(M) without NEXTINT 0x01, 0x00 // UShort @@ -2369,19 +2374,19 @@ TEST_P(XCdrBasicTypesTest, enum8) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation - 0x01 // Octet + 0x00, 0x00, 0x00, 0x03, // Encapsulation + 0x01 // Octet }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation - 0x01 // Octet + 0x00, 0x01, 0x00, 0x03, // Encapsulation + 0x01 // Octet }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { 0x00, 0x02, 0x00, 0x00, // Encapsulation 0x00, 0x01, 0x00, 0x01, // ShortMemberHeader - 0x01, // Octet + 0x01, // Octet 0x00, 0x00, 0x00, // Alignment 0x3F, 0x02, 0x00, 0x00 // Sentinel }; @@ -2389,45 +2394,45 @@ TEST_P(XCdrBasicTypesTest, enum8) { 0x00, 0x03, 0x00, 0x00, // Encapsulation 0x01, 0x00, 0x01, 0x00, // ShortMemberHeader - 0x01, // Octet + 0x01, // Octet 0x00, 0x00, 0x00, // Alignment 0x02, 0x3F, 0x00, 0x00 // Sentinel }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation - 0x01 // Octet + 0x00, 0x06, 0x00, 0x03, // Encapsulation + 0x01 // Octet }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation - 0x01 // Octet + 0x00, 0x07, 0x00, 0x03, // Encapsulation + 0x01 // Octet }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x01, // DHEADER - 0x01 // Octet + 0x01 // Octet }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x03, // Encapsulation 0x01, 0x00, 0x00, 0x00, // DHEADER - 0x01 // Octet + 0x01 // Octet }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x05, // DHEADER 0x00, 0x00, 0x00, 0x01, // EMHEADER1(M) without NEXTINT - 0x01 // Octet + 0x01 // Octet }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x03, // Encapsulation 0x05, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT - 0x01 // Octet + 0x01 // Octet }; //} @@ -2658,7 +2663,7 @@ TEST_P(XCdrBasicTypesTest, array_struct) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x2E, // DHEADER 0x50, 0x00, 0x00, 0x01, // EMHEADER1(M) with NEXTINT 0x00, 0x00, 0x00, 0x26, // DHEADER + NEXTINT @@ -2678,7 +2683,7 @@ TEST_P(XCdrBasicTypesTest, array_struct) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x2E, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x50, // EMHEADER1(M) with NEXTINT 0x26, 0x00, 0x00, 0x00, // DHEADER + NEXTINT @@ -3006,7 +3011,7 @@ TEST_P(XCdrBasicTypesTest, multi_array_struct) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x56, // DHEADER 0x50, 0x00, 0x00, 0x01, // EMHEADER1(M) with NEXTINT 0x00, 0x00, 0x00, 0x4E, // DHEADER + NEXTINT @@ -3040,7 +3045,7 @@ TEST_P(XCdrBasicTypesTest, multi_array_struct) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x56, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x50, // EMHEADER1(M) with NEXTINT 0x4E, 0x00, 0x00, 0x00, // DHEADER + NEXTINT @@ -3319,7 +3324,7 @@ TEST_P(XCdrBasicTypesTest, sequence_struct) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x32, // DHEADER 0x50, 0x00, 0x00, 0x01, // EMHEADER1(M) with NEXTINT 0x00, 0x00, 0x00, 0x2A, // DHEADER + NEXTINT @@ -3340,7 +3345,7 @@ TEST_P(XCdrBasicTypesTest, sequence_struct) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x32, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x50, // EMHEADER1(M) with NEXTINT 0x2A, 0x00, 0x00, 0x00, // DHEADER + NEXTINT @@ -3734,7 +3739,7 @@ TEST_P(XCdrBasicTypesTest, recursive_sequence_struct) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x6A, // DHEADER 0x50, 0x00, 0x00, 0x01, // EMHEADER1(M) with NEXTINT 0x00, 0x00, 0x00, 0x62, // DHEADER + NEXTINT @@ -3773,7 +3778,7 @@ TEST_P(XCdrBasicTypesTest, recursive_sequence_struct) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x6A, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x50, // EMHEADER1(M) with NEXTINT 0x62, 0x00, 0x00, 0x00, // DHEADER + NEXTINT @@ -4126,7 +4131,7 @@ TEST_P(XCdrBasicTypesTest, map_struct) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x36, // DHEADER 0x50, 0x00, 0x00, 0x01, // EMHEADER1(M) with NEXTINT 0x00, 0x00, 0x00, 0x2e, // DHEADER + NEXTINT @@ -4149,7 +4154,7 @@ TEST_P(XCdrBasicTypesTest, map_struct) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x36, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x50, // EMHEADER1(M) with NEXTINT 0x2e, 0x00, 0x00, 0x00, // DHEADER + NEXTINT @@ -4203,12 +4208,12 @@ TEST_P(XCdrBasicTypesTest, bitset_8) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x03, // Encapsulation ival // Bitset }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x03, // Encapsulation ival // Bitset }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR + Cdr::Endianness::BIG_ENDIANNESS] = @@ -4229,36 +4234,36 @@ TEST_P(XCdrBasicTypesTest, bitset_8) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x03, // Encapsulation ival, // Bitset }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x03, // Encapsulation ival // Bitset }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x01, // DHEADER ival, // Bitset }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x03, // Encapsulation 0x01, 0x00, 0x00, 0x00, // DHEADER ival // Bitset }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x05, // DHEADER 0x00, 0x00, 0x00, 0x01, // EMHEADER1(M) without NEXTINT ival, // Bitset }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x03, // Encapsulation 0x05, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT ival // Bitset @@ -4297,12 +4302,12 @@ TEST_P(XCdrBasicTypesTest, bitset_16) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x02, // Encapsulation ival, fval // Bitset }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x02, // Encapsulation fval, ival // Bitset }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR + Cdr::Endianness::BIG_ENDIANNESS] = @@ -4323,36 +4328,36 @@ TEST_P(XCdrBasicTypesTest, bitset_16) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x02, // Encapsulation ival, fval // Bitset }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x02, // Encapsulation fval, ival // Bitset }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x02, // DHEADER ival, fval // Bitset }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x02, // Encapsulation 0x02, 0x00, 0x00, 0x00, // DHEADER fval, ival // Bitset }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x06, // DHEADER 0x10, 0x00, 0x00, 0x01, // EMHEADER1(M) without NEXTINT ival, fval // Bitset }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x06, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x10, // EMHEADER1(M) without NEXTINT fval, ival // Bitset @@ -4648,7 +4653,7 @@ TEST_P(XCdrBasicTypesTest, short_align_1) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x0E, // DHEADER 0x00, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT align_value, @@ -4658,7 +4663,7 @@ TEST_P(XCdrBasicTypesTest, short_align_1) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x0E, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT align_value, @@ -4759,7 +4764,7 @@ TEST_P(XCdrBasicTypesTest, short_align_2) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x0E, // DHEADER 0x10, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT iava, fava, @@ -4769,7 +4774,7 @@ TEST_P(XCdrBasicTypesTest, short_align_2) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x0E, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x10, // EMHEADER1(M) without NEXTINT fava, iava, @@ -4810,13 +4815,13 @@ TEST_P(XCdrBasicTypesTest, short_align_4) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x02, // Encapsulation iava, iava, iava, fava, ival, fval // Short }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x02, // Encapsulation fava, iava, iava, iava, fval, ival // Short }; @@ -4842,33 +4847,33 @@ TEST_P(XCdrBasicTypesTest, short_align_4) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x02, // Encapsulation iava, iava, iava, fava, ival, fval // Short }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x02, // Encapsulation fava, iava, iava, iava, fval, ival // Short }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x06, // DHEADER iava, iava, iava, fava, ival, fval // Short }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x02, // Encapsulation 0x06, 0x00, 0x00, 0x00, // DHEADER fava, iava, iava, iava, fval, ival // Short }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x0E, // DHEADER 0x20, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT iava, iava, iava, fava, @@ -4877,7 +4882,7 @@ TEST_P(XCdrBasicTypesTest, short_align_4) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x0E, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x20, // EMHEADER1(M) without NEXTINT fava, iava, iava, iava, @@ -4981,7 +4986,7 @@ TEST_P(XCdrBasicTypesTest, ushort_align_1) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x0E, // DHEADER 0x00, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT align_value, @@ -4991,7 +4996,7 @@ TEST_P(XCdrBasicTypesTest, ushort_align_1) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x0E, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT align_value, @@ -5092,7 +5097,7 @@ TEST_P(XCdrBasicTypesTest, ushort_align_2) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x0E, // DHEADER 0x10, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT iava, fava, @@ -5102,7 +5107,7 @@ TEST_P(XCdrBasicTypesTest, ushort_align_2) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x0E, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x10, // EMHEADER1(M) without NEXTINT fava, iava, @@ -5143,13 +5148,13 @@ TEST_P(XCdrBasicTypesTest, ushort_align_4) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x02, // Encapsulation iava, iava, iava, fava, ival, fval // UShort }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x02, // Encapsulation fava, iava, iava, iava, fval, ival // UShort }; @@ -5175,33 +5180,33 @@ TEST_P(XCdrBasicTypesTest, ushort_align_4) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x02, // Encapsulation iava, iava, iava, fava, ival, fval // UShort }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x02, // Encapsulation fava, iava, iava, iava, fval, ival // UShort }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x06, // DHEADER iava, iava, iava, fava, ival, fval // UShort }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x02, // Encapsulation 0x06, 0x00, 0x00, 0x00, // DHEADER fava, iava, iava, iava, fval, ival // UShort }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x0E, // DHEADER 0x20, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT iava, iava, iava, fava, @@ -5210,7 +5215,7 @@ TEST_P(XCdrBasicTypesTest, ushort_align_4) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x0E, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x20, // EMHEADER1(M) without NEXTINT fava, iava, iava, iava, @@ -7758,13 +7763,13 @@ TEST_P(XCdrBasicTypesTest, boolean_align_1) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x02, // Encapsulation align_value, b_value // Boolean }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x02, // Encapsulation align_value, b_value // Boolean }; @@ -7792,33 +7797,33 @@ TEST_P(XCdrBasicTypesTest, boolean_align_1) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x02, // Encapsulation align_value, b_value // Boolean }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x02, // Encapsulation align_value, b_value // Boolean }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x02, // DHEADER align_value, b_value // Boolean }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x02, // Encapsulation 0x02, 0x00, 0x00, 0x00, // DHEADER align_value, b_value // Boolean }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x0D, // DHEADER 0x00, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT align_value, @@ -7828,7 +7833,7 @@ TEST_P(XCdrBasicTypesTest, boolean_align_1) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x03, // Encapsulation 0x0D, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT align_value, @@ -7868,13 +7873,13 @@ TEST_P(XCdrBasicTypesTest, boolean_align_2) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x01, // Encapsulation iava, fava, b_value // Boolean }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x01, // Encapsulation fava, iava, b_value // Boolean }; @@ -7902,33 +7907,33 @@ TEST_P(XCdrBasicTypesTest, boolean_align_2) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x01, // Encapsulation iava, fava, b_value // Boolean }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x01, // Encapsulation fava, iava, b_value // Boolean }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x01, // Encapsulation 0x00, 0x00, 0x00, 0x03, // DHEADER iava, fava, b_value // Boolean }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x01, // Encapsulation 0x03, 0x00, 0x00, 0x00, // DHEADER fava, iava, b_value // Boolean }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x0D, // DHEADER 0x10, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT iava, fava, @@ -7938,7 +7943,7 @@ TEST_P(XCdrBasicTypesTest, boolean_align_2) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x03, // Encapsulation 0x0D, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x10, // EMHEADER1(M) without NEXTINT fava, iava, @@ -7978,13 +7983,13 @@ TEST_P(XCdrBasicTypesTest, boolean_align_4) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x03, // Encapsulation iava, iava, iava, fava, b_value // Boolean }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x03, // Encapsulation fava, iava, iava, iava, b_value // Boolean }; @@ -8010,33 +8015,33 @@ TEST_P(XCdrBasicTypesTest, boolean_align_4) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x03, // Encapsulation iava, iava, iava, fava, b_value // Boolean }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x03, // Encapsulation fava, iava, iava, iava, b_value // Boolean }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x05, // DHEADER iava, iava, iava, fava, b_value // Boolean }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x03, // Encapsulation 0x05, 0x00, 0x00, 0x00, // DHEADER fava, iava, iava, iava, b_value // Boolean }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x0D, // DHEADER 0x20, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT iava, iava, iava, fava, @@ -8045,7 +8050,7 @@ TEST_P(XCdrBasicTypesTest, boolean_align_4) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x03, // Encapsulation 0x0D, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x20, // EMHEADER1(M) without NEXTINT fava, iava, iava, iava, @@ -8081,13 +8086,13 @@ TEST_P(XCdrBasicTypesTest, octet_align_1) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x02, // Encapsulation align_value, octet_value // Octet }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x02, // Encapsulation align_value, octet_value // Octet }; @@ -8115,33 +8120,33 @@ TEST_P(XCdrBasicTypesTest, octet_align_1) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x02, // Encapsulation align_value, octet_value // Octet }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x02, // Encapsulation align_value, octet_value // Octet }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x02, // DHEADER align_value, octet_value // Octet }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x02, // Encapsulation 0x02, 0x00, 0x00, 0x00, // DHEADER align_value, octet_value // Octet }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x0D, // DHEADER 0x00, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT align_value, @@ -8151,7 +8156,7 @@ TEST_P(XCdrBasicTypesTest, octet_align_1) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x03, // Encapsulation 0x0D, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT align_value, @@ -8190,13 +8195,13 @@ TEST_P(XCdrBasicTypesTest, octet_align_2) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x01, // Encapsulation iava, fava, octet_value // Octet }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x01, // Encapsulation fava, iava, octet_value // Octet }; @@ -8224,33 +8229,33 @@ TEST_P(XCdrBasicTypesTest, octet_align_2) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x01, // Encapsulation iava, fava, octet_value // Octet }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x01, // Encapsulation fava, iava, octet_value // Octet }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x01, // Encapsulation 0x00, 0x00, 0x00, 0x03, // DHEADER iava, fava, octet_value // Octet }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x01, // Encapsulation 0x03, 0x00, 0x00, 0x00, // DHEADER fava, iava, octet_value // Octet }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x0D, // DHEADER 0x10, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT iava, fava, @@ -8260,7 +8265,7 @@ TEST_P(XCdrBasicTypesTest, octet_align_2) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x03, // Encapsulation 0x0D, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x10, // EMHEADER1(M) without NEXTINT fava, iava, @@ -8299,13 +8304,13 @@ TEST_P(XCdrBasicTypesTest, octet_align_4) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x03, // Encapsulation iava, iava, iava, fava, octet_value // Octet }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x03, // Encapsulation fava, iava, iava, iava, octet_value // Octet }; @@ -8331,33 +8336,33 @@ TEST_P(XCdrBasicTypesTest, octet_align_4) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x03, // Encapsulation iava, iava, iava, fava, octet_value // Octet }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x03, // Encapsulation fava, iava, iava, iava, octet_value // Octet }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x05, // DHEADER iava, iava, iava, fava, octet_value // Octet }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x03, // Encapsulation 0x05, 0x00, 0x00, 0x00, // DHEADER fava, iava, iava, iava, octet_value // Octet }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x0D, // DHEADER 0x20, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT iava, iava, iava, fava, @@ -8366,7 +8371,7 @@ TEST_P(XCdrBasicTypesTest, octet_align_4) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x03, // Encapsulation 0x0D, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x20, // EMHEADER1(M) without NEXTINT fava, iava, iava, iava, @@ -8403,13 +8408,13 @@ TEST_P(XCdrBasicTypesTest, char_align_1) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x02, // Encapsulation align_value, valu // Char }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x02, // Encapsulation align_value, valu // Char }; @@ -8437,33 +8442,33 @@ TEST_P(XCdrBasicTypesTest, char_align_1) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x02, // Encapsulation align_value, valu // Char }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x02, // Encapsulation align_value, valu // Char }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x02, // DHEADER align_value, valu // Char }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x02, // Encapsulation 0x02, 0x00, 0x00, 0x00, // DHEADER align_value, valu // Char }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x0D, // DHEADER 0x00, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT align_value, @@ -8473,7 +8478,7 @@ TEST_P(XCdrBasicTypesTest, char_align_1) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x03, // Encapsulation 0x0D, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT align_value, @@ -8513,13 +8518,13 @@ TEST_P(XCdrBasicTypesTest, char_align_2) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x01, // Encapsulation iava, fava, valu // Char }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x01, // Encapsulation fava, iava, valu // Char }; @@ -8547,33 +8552,33 @@ TEST_P(XCdrBasicTypesTest, char_align_2) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x01, // Encapsulation iava, fava, valu // Char }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x01, // Encapsulation fava, iava, valu // Char }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x01, // Encapsulation 0x00, 0x00, 0x00, 0x03, // DHEADER iava, fava, valu // Char }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x01, // Encapsulation 0x03, 0x00, 0x00, 0x00, // DHEADER fava, iava, valu // Char }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x0D, // DHEADER 0x10, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT iava, fava, @@ -8583,7 +8588,7 @@ TEST_P(XCdrBasicTypesTest, char_align_2) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x03, // Encapsulation 0x0D, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x10, // EMHEADER1(M) without NEXTINT fava, iava, @@ -8623,13 +8628,13 @@ TEST_P(XCdrBasicTypesTest, char_align_4) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x03, // Encapsulation iava, iava, iava, fava, valu // Char }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x03, // Encapsulation fava, iava, iava, iava, valu // Char }; @@ -8655,33 +8660,33 @@ TEST_P(XCdrBasicTypesTest, char_align_4) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x03, // Encapsulation iava, iava, iava, fava, valu // Char }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x03, // Encapsulation fava, iava, iava, iava, valu // Char }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x05, // DHEADER iava, iava, iava, fava, valu // Char }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x03, // Encapsulation 0x05, 0x00, 0x00, 0x00, // DHEADER fava, iava, iava, iava, valu // Char }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x0D, // DHEADER 0x20, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT iava, iava, iava, fava, @@ -8690,7 +8695,7 @@ TEST_P(XCdrBasicTypesTest, char_align_4) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x03, // Encapsulation 0x0D, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x20, // EMHEADER1(M) without NEXTINT fava, iava, iava, iava, @@ -8794,7 +8799,7 @@ TEST_P(XCdrBasicTypesTest, wchar_align_1) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x0E, // DHEADER 0x00, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT align_value, @@ -8804,7 +8809,7 @@ TEST_P(XCdrBasicTypesTest, wchar_align_1) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x0E, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT align_value, @@ -8905,7 +8910,7 @@ TEST_P(XCdrBasicTypesTest, wchar_align_2) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x0E, // DHEADER 0x10, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT iava, fava, @@ -8915,7 +8920,7 @@ TEST_P(XCdrBasicTypesTest, wchar_align_2) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x0E, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x10, // EMHEADER1(M) without NEXTINT fava, iava, @@ -8956,13 +8961,13 @@ TEST_P(XCdrBasicTypesTest, wchar_align_4) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x02, // Encapsulation iava, iava, iava, fava, ival, fval // WChar }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x02, // Encapsulation fava, iava, iava, iava, fval, ival // WChar }; @@ -8988,33 +8993,33 @@ TEST_P(XCdrBasicTypesTest, wchar_align_4) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x02, // Encapsulation iava, iava, iava, fava, ival, fval // WChar }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x02, // Encapsulation fava, iava, iava, iava, fval, ival // WChar }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x06, // DHEADER iava, iava, iava, fava, ival, fval // WChar }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x02, // Encapsulation 0x06, 0x00, 0x00, 0x00, // DHEADER fava, iava, iava, iava, fval, ival // WChar }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x0E, // DHEADER 0x20, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT iava, iava, iava, fava, @@ -9023,7 +9028,7 @@ TEST_P(XCdrBasicTypesTest, wchar_align_4) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x0E, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x20, // EMHEADER1(M) without NEXTINT fava, iava, iava, iava, @@ -9061,7 +9066,7 @@ TEST_P(XCdrBasicTypesTest, string_align_1) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x01, // Encapsulation align_value, 0x00, 0x00, 0x00, // Alignment 0x00, 0x00, 0x00, 0x03, // String length @@ -9069,7 +9074,7 @@ TEST_P(XCdrBasicTypesTest, string_align_1) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x01, // Encapsulation align_value, 0x00, 0x00, 0x00, // Alignment 0x03, 0x00, 0x00, 0x00, // String length @@ -9101,7 +9106,7 @@ TEST_P(XCdrBasicTypesTest, string_align_1) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x01, // Encapsulation align_value, 0x00, 0x00, 0x00, // Alignment 0x00, 0x00, 0x00, 0x03, // String length @@ -9109,7 +9114,7 @@ TEST_P(XCdrBasicTypesTest, string_align_1) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x01, // Encapsulation align_value, 0x00, 0x00, 0x00, // Alignment 0x03, 0x00, 0x00, 0x00, // String length @@ -9117,7 +9122,7 @@ TEST_P(XCdrBasicTypesTest, string_align_1) }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x01, // Encapsulation 0x00, 0x00, 0x00, 0x0B, // DHEADER align_value, 0x00, 0x00, 0x00, // Alignment @@ -9126,7 +9131,7 @@ TEST_P(XCdrBasicTypesTest, string_align_1) }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x01, // Encapsulation 0x0B, 0x00, 0x00, 0x00, // DHEADER align_value, 0x00, 0x00, 0x00, // Alignment @@ -9135,7 +9140,7 @@ TEST_P(XCdrBasicTypesTest, string_align_1) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x01, // Encapsulation 0x00, 0x00, 0x00, 0x13, // DHEADER 0x00, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT align_value, @@ -9146,7 +9151,7 @@ TEST_P(XCdrBasicTypesTest, string_align_1) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x01, // Encapsulation 0x13, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT align_value, @@ -9188,7 +9193,7 @@ TEST_P(XCdrBasicTypesTest, string_align_2) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x01, // Encapsulation iava, fava, 0x00, 0x00, // Alignment 0x00, 0x00, 0x00, 0x03, // String length @@ -9196,7 +9201,7 @@ TEST_P(XCdrBasicTypesTest, string_align_2) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x01, // Encapsulation fava, iava, 0x00, 0x00, // Alignment 0x03, 0x00, 0x00, 0x00, // String length @@ -9228,7 +9233,7 @@ TEST_P(XCdrBasicTypesTest, string_align_2) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x01, // Encapsulation iava, fava, 0x00, 0x00, // Alignment 0x00, 0x00, 0x00, 0x03, // String length @@ -9236,7 +9241,7 @@ TEST_P(XCdrBasicTypesTest, string_align_2) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x01, // Encapsulation fava, iava, 0x00, 0x00, // Alignment 0x03, 0x00, 0x00, 0x00, // String length @@ -9244,7 +9249,7 @@ TEST_P(XCdrBasicTypesTest, string_align_2) }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x01, // Encapsulation 0x00, 0x00, 0x00, 0x0B, // DHEADER iava, fava, 0x00, 0x00, // Alignment @@ -9253,7 +9258,7 @@ TEST_P(XCdrBasicTypesTest, string_align_2) }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x01, // Encapsulation 0x0B, 0x00, 0x00, 0x00, // DHEADER fava, iava, 0x00, 0x00, // Alignment @@ -9262,7 +9267,7 @@ TEST_P(XCdrBasicTypesTest, string_align_2) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x01, // Encapsulation 0x00, 0x00, 0x00, 0x13, // DHEADER 0x10, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT iava, fava, @@ -9273,7 +9278,7 @@ TEST_P(XCdrBasicTypesTest, string_align_2) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x01, // Encapsulation 0x13, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x10, // EMHEADER1(M) without NEXTINT fava, iava, @@ -9315,14 +9320,14 @@ TEST_P(XCdrBasicTypesTest, string_align_4) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x01, // Encapsulation iava, iava, iava, fava, 0x00, 0x00, 0x00, 0x03, // String length valA, valB, 0x00 // String }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x01, // Encapsulation fava, iava, iava, iava, 0x03, 0x00, 0x00, 0x00, // String length valA, valB, 0x00 // String @@ -9351,21 +9356,21 @@ TEST_P(XCdrBasicTypesTest, string_align_4) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x01, // Encapsulation iava, iava, iava, fava, 0x00, 0x00, 0x00, 0x03, // String length valA, valB, 0x00 // String }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x01, // Encapsulation fava, iava, iava, iava, 0x03, 0x00, 0x00, 0x00, // String length valA, valB, 0x00 // String }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x01, // Encapsulation 0x00, 0x00, 0x00, 0x0B, // DHEADER iava, iava, iava, fava, 0x00, 0x00, 0x00, 0x03, // String length @@ -9373,7 +9378,7 @@ TEST_P(XCdrBasicTypesTest, string_align_4) }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x01, // Encapsulation 0x0B, 0x00, 0x00, 0x00, // DHEADER fava, iava, iava, iava, 0x03, 0x00, 0x00, 0x00, // String length @@ -9381,7 +9386,7 @@ TEST_P(XCdrBasicTypesTest, string_align_4) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x01, // Encapsulation 0x00, 0x00, 0x00, 0x13, // DHEADER 0x20, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT iava, iava, iava, fava, @@ -9391,7 +9396,7 @@ TEST_P(XCdrBasicTypesTest, string_align_4) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x01, // Encapsulation 0x13, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x20, // EMHEADER1(M) without NEXTINT fava, iava, iava, iava, @@ -10238,7 +10243,7 @@ TEST_P(XCdrBasicTypesTest, enum16_align_1) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x0E, // DHEADER 0x00, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT align_value, @@ -10248,7 +10253,7 @@ TEST_P(XCdrBasicTypesTest, enum16_align_1) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x0E, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT align_value, @@ -10353,7 +10358,7 @@ TEST_P(XCdrBasicTypesTest, enum16_align_2) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x0E, // DHEADER 0x10, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT iava, fava, @@ -10363,7 +10368,7 @@ TEST_P(XCdrBasicTypesTest, enum16_align_2) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x0E, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x10, // EMHEADER1(M) without NEXTINT fava, iava, @@ -10408,13 +10413,13 @@ TEST_P(XCdrBasicTypesTest, enum16_align_4) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x02, // Encapsulation iava, iava, iava, fava, 0x00, 0x01 // Enum16 }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x02, // Encapsulation fava, iava, iava, iava, 0x01, 0x00 // Enum16 }; @@ -10440,33 +10445,33 @@ TEST_P(XCdrBasicTypesTest, enum16_align_4) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x02, // Encapsulation iava, iava, iava, fava, 0x00, 0x01 // Enum16 }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x02, // Encapsulation fava, iava, iava, iava, 0x01, 0x00 // Enum16 }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x06, // DHEADER iava, iava, iava, fava, 0x00, 0x01 // Enum16 }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x02, // Encapsulation 0x06, 0x00, 0x00, 0x00, // DHEADER fava, iava, iava, iava, 0x01, 0x00 // Enum16 }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x0E, // DHEADER 0x20, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT iava, iava, iava, fava, @@ -10475,7 +10480,7 @@ TEST_P(XCdrBasicTypesTest, enum16_align_4) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x0E, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x20, // EMHEADER1(M) without NEXTINT fava, iava, iava, iava, @@ -10517,13 +10522,13 @@ TEST_P(XCdrBasicTypesTest, enum8_align_1) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x02, // Encapsulation align_value, enum_value // Enum8 }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x02, // Encapsulation align_value, enum_value // Enum8 }; @@ -10551,33 +10556,33 @@ TEST_P(XCdrBasicTypesTest, enum8_align_1) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x02, // Encapsulation align_value, enum_value // Enum8 }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x02, // Encapsulation align_value, enum_value // Enum8 }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x02, // DHEADER align_value, enum_value // Enum8 }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x02, // Encapsulation 0x02, 0x00, 0x00, 0x00, // DHEADER align_value, enum_value // Enum8 }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x0D, // DHEADER 0x00, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT align_value, @@ -10587,7 +10592,7 @@ TEST_P(XCdrBasicTypesTest, enum8_align_1) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x03, // Encapsulation 0x0D, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT align_value, @@ -10632,13 +10637,13 @@ TEST_P(XCdrBasicTypesTest, enum8_align_2) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x01, // Encapsulation iava, fava, enum_value // Enum8 }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x01, // Encapsulation fava, iava, enum_value // Enum8 }; @@ -10666,33 +10671,33 @@ TEST_P(XCdrBasicTypesTest, enum8_align_2) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x01, // Encapsulation iava, fava, enum_value // Enum8 }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x01, // Encapsulation fava, iava, enum_value // Enum8 }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x01, // Encapsulation 0x00, 0x00, 0x00, 0x03, // DHEADER iava, fava, enum_value // Enum8 }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x01, // Encapsulation 0x03, 0x00, 0x00, 0x00, // DHEADER fava, iava, enum_value // Enum8 }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x0D, // DHEADER 0x10, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT iava, fava, @@ -10702,7 +10707,7 @@ TEST_P(XCdrBasicTypesTest, enum8_align_2) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x03, // Encapsulation 0x0D, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x10, // EMHEADER1(M) without NEXTINT fava, iava, @@ -10747,13 +10752,13 @@ TEST_P(XCdrBasicTypesTest, enum8_align_4) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x03, // Encapsulation iava, iava, iava, fava, enum_value // Enum8 }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x03, // Encapsulation fava, iava, iava, iava, enum_value // Enum8 }; @@ -10779,33 +10784,33 @@ TEST_P(XCdrBasicTypesTest, enum8_align_4) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x03, // Encapsulation iava, iava, iava, fava, enum_value // Enum8 }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x03, // Encapsulation fava, iava, iava, iava, enum_value // Enum8 }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x05, // DHEADER iava, iava, iava, fava, enum_value // Enum8 }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x03, // Encapsulation 0x05, 0x00, 0x00, 0x00, // DHEADER fava, iava, iava, iava, enum_value // Enum8 }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x0D, // DHEADER 0x20, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT iava, iava, iava, fava, @@ -10814,7 +10819,7 @@ TEST_P(XCdrBasicTypesTest, enum8_align_4) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x03, // Encapsulation 0x0D, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x20, // EMHEADER1(M) without NEXTINT fava, iava, iava, iava, @@ -10857,7 +10862,7 @@ TEST_P(XCdrBasicTypesTest, struct_with_strings) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x01, // Encapsulation 0x00, 0x00, 0x00, 0x03, // String length valA, valB, 0x00, // String 0x00, // Alignment @@ -10869,7 +10874,7 @@ TEST_P(XCdrBasicTypesTest, struct_with_strings) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x01, // Encapsulation 0x03, 0x00, 0x00, 0x00, // String length valA, valB, 0x00, // String 0x00, // Alignment @@ -10915,7 +10920,7 @@ TEST_P(XCdrBasicTypesTest, struct_with_strings) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x01, // Encapsulation 0x00, 0x00, 0x00, 0x03, // String length valA, valB, 0x00, // String 0x00, // Alignment @@ -10927,7 +10932,7 @@ TEST_P(XCdrBasicTypesTest, struct_with_strings) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x01, // Encapsulation 0x03, 0x00, 0x00, 0x00, // String length valA, valB, 0x00, // String 0x00, // Alignment @@ -10939,7 +10944,7 @@ TEST_P(XCdrBasicTypesTest, struct_with_strings) }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x01, // Encapsulation 0x00, 0x00, 0x00, 0x17, // DHEADER 0x00, 0x00, 0x00, 0x03, // String length valA, valB, 0x00, // String @@ -10952,7 +10957,7 @@ TEST_P(XCdrBasicTypesTest, struct_with_strings) }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x01, // Encapsulation 0x17, 0x00, 0x00, 0x00, // DHEADER 0x03, 0x00, 0x00, 0x00, // String length valA, valB, 0x00, // String @@ -10965,7 +10970,7 @@ TEST_P(XCdrBasicTypesTest, struct_with_strings) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x01, // Encapsulation 0x00, 0x00, 0x00, 0x23, // DHEADER 0x50, 0x00, 0x00, 0x01, // EMHEADER1(M) with NEXTINT 0x00, 0x00, 0x00, 0x03, // String length @@ -10981,7 +10986,7 @@ TEST_P(XCdrBasicTypesTest, struct_with_strings) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x01, // Encapsulation 0x23, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x50, // EMHEADER1(M) with NEXTINT 0x03, 0x00, 0x00, 0x00, // String length @@ -11030,6 +11035,7 @@ TEST_P(XCdrBasicTypesTest, struct_with_strings) cdr.serialize_member(MemberId(2), var_field2); cdr.serialize_member(MemberId(3), var_field3); cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -11119,6 +11125,7 @@ TEST_P(XCdrBasicTypesTest, struct_with_strings) cdr << MemberId(2) << var_field2; cdr << MemberId(3) << var_field3; cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -11324,7 +11331,7 @@ TEST_P(XCdrBasicTypesTest, one_inner_struct) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x2E, // DHEADER 0x50, 0x00, 0x00, 0x01, // EMHEADER1(M) with NEXTINT 0x00, 0x00, 0x00, 0x0E, // NEXTINT + DHEADER @@ -11344,7 +11351,7 @@ TEST_P(XCdrBasicTypesTest, one_inner_struct) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x2E, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x50, // EMHEADER1(M) with NEXTINT 0x0E, 0x00, 0x00, 0x00, // NEXTINT + DHEADER @@ -11396,6 +11403,7 @@ TEST_P(XCdrBasicTypesTest, one_inner_struct) cdr.serialize_member(MemberId(1), value); cdr.serialize_member(MemberId(2), value); cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -11475,6 +11483,7 @@ TEST_P(XCdrBasicTypesTest, one_inner_struct) cdr << MemberId(1) << value; cdr << MemberId(2) << value; cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -11685,7 +11694,7 @@ TEST_P(XCdrBasicTypesTest, two_inner_struct) }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x1e, // DHEADER 0x00, 0x00, 0x00, 0x0A, // DHEADER 0x00, 0x00, 0x00, 0x04, // DHEADER @@ -11701,7 +11710,7 @@ TEST_P(XCdrBasicTypesTest, two_inner_struct) }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x02, // Encapsulation 0x1e, 0x00, 0x00, 0x00, // DHEADER 0x0A, 0x00, 0x00, 0x00, // DHEADER 0x04, 0x00, 0x00, 0x00, // DHEADER @@ -11717,7 +11726,7 @@ TEST_P(XCdrBasicTypesTest, two_inner_struct) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x4e, // DHEADER 0x50, 0x00, 0x00, 0x01, // EMHEADER1(M) with NEXTINT 0x00, 0x00, 0x00, 0x1e, // NEXTINT + DHEADER @@ -11747,7 +11756,7 @@ TEST_P(XCdrBasicTypesTest, two_inner_struct) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x4e, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x50, // EMHEADER1(M) with NEXTINT 0x1e, 0x00, 0x00, 0x00, // NEXTINT + DHEADER @@ -11809,6 +11818,7 @@ TEST_P(XCdrBasicTypesTest, two_inner_struct) cdr.serialize_member(MemberId(1), value); cdr.serialize_member(MemberId(2), value); cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -11888,6 +11898,7 @@ TEST_P(XCdrBasicTypesTest, two_inner_struct) cdr << MemberId(1) << value; cdr << MemberId(2) << value; cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} diff --git a/test/xcdr/external.cpp b/test/xcdr/external.cpp index a8e587d4..acabf9a8 100644 --- a/test/xcdr/external.cpp +++ b/test/xcdr/external.cpp @@ -453,13 +453,13 @@ void serialize_external( XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x01, // Encapsulation 0x00, 0x00, 0x00, 0x03, // String length valA, valB, 0x00 // String }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x01, // Encapsulation 0x03, 0x00, 0x00, 0x00, // String length valA, valB, 0x00 // String }; @@ -487,19 +487,19 @@ void serialize_external( }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x01, // Encapsulation 0x00, 0x00, 0x00, 0x03, // String length valA, valB, 0x00 // String }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x01, // Encapsulation 0x03, 0x00, 0x00, 0x00, // String length valA, valB, 0x00 // String }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x01, // Encapsulation 0x00, 0x00, 0x00, 0x0B, // DHEADER 0x00, 0x00, 0x00, 0x07, // DHEADER 0x00, 0x00, 0x00, 0x03, // String length @@ -507,7 +507,7 @@ void serialize_external( }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x01, // Encapsulation 0x0B, 0x00, 0x00, 0x00, // DHEADER 0x07, 0x00, 0x00, 0x00, // DHEADER 0x03, 0x00, 0x00, 0x00, // String length @@ -515,7 +515,7 @@ void serialize_external( }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x01, // Encapsulation 0x00, 0x00, 0x00, 0x13, // DHEADER 0x50, 0x00, 0x00, 0x01, // EMHEADER1(M) with NEXTINT 0x00, 0x00, 0x00, 0x0B, // DHEADER @@ -525,7 +525,7 @@ void serialize_external( }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x01, // Encapsulation 0x13, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x50, // EMHEADER1(M) with NEXTINT 0x0B, 0x00, 0x00, 0x00, // DHEADER @@ -567,6 +567,7 @@ void serialize_external( cdr << MemberId(1) << ext_value; } cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -621,14 +622,14 @@ void serialize_optional_external( XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x01, // Encapsulation 0x00, 0x01, 0x00, 0x07, // ShortMemberHeader 0x00, 0x00, 0x00, 0x03, // String length valA, valB, 0x00 // String }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x01, // Encapsulation 0x01, 0x00, 0x07, 0x00, // ShortMemberHeader 0x03, 0x00, 0x00, 0x00, // String length valA, valB, 0x00 // String @@ -657,7 +658,7 @@ void serialize_optional_external( }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x01, // Encapsulation 0x01, // Present 0x00, 0x00, 0x00, // Alignment 0x00, 0x00, 0x00, 0x03, // String length @@ -665,7 +666,7 @@ void serialize_optional_external( }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x01, // Encapsulation 0x01, // Present 0x00, 0x00, 0x00, // Alignment 0x03, 0x00, 0x00, 0x00, // String length @@ -673,7 +674,7 @@ void serialize_optional_external( }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x01, // Encapsulation 0x00, 0x00, 0x00, 0x0F, // DHEADER 0x01, // Present 0x00, 0x00, 0x00, // Alignment @@ -683,7 +684,7 @@ void serialize_optional_external( }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x01, // Encapsulation 0x0F, 0x00, 0x00, 0x00, // DHEADER 0x01, // Present 0x00, 0x00, 0x00, // Alignment @@ -693,7 +694,7 @@ void serialize_optional_external( }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x01, // Encapsulation 0x00, 0x00, 0x00, 0x13, // DHEADER 0x50, 0x00, 0x00, 0x01, // EMHEADER1(M) with NEXTINT 0x00, 0x00, 0x00, 0x0B, // DHEADER @@ -703,7 +704,7 @@ void serialize_optional_external( }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x01, // Encapsulation 0x13, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x50, // EMHEADER1(M) with NEXTINT 0x0B, 0x00, 0x00, 0x00, // DHEADER @@ -745,6 +746,7 @@ void serialize_optional_external( cdr << MemberId(1) << ext_value; } cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -1006,23 +1008,23 @@ TEST_P(XCdrExternalTest, null_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x03, // Encapsulation 0x00 // Not present }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x03, // Encapsulation 0x00 // Not present }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x01, // DHEADER 0x00 // Not present }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x03, // Encapsulation 0x01, 0x00, 0x00, 0x00, // DHEADER 0x00 // Not present }; @@ -1069,6 +1071,7 @@ TEST_P(XCdrExternalTest, null_optional) cdr.begin_serialize_type(enc_state, encoding); cdr.serialize_member(MemberId(1), opt_value); cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -1119,6 +1122,7 @@ TEST_P(XCdrExternalTest, null_optional) cdr.begin_serialize_type(enc_state, encoding); cdr << MemberId(1) << opt_value; cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} diff --git a/test/xcdr/final.cpp b/test/xcdr/final.cpp index 8283e3a3..ddd5aec4 100644 --- a/test/xcdr/final.cpp +++ b/test/xcdr/final.cpp @@ -170,7 +170,7 @@ TEST_P(XCdrFinalTest, inner_appendable_structure) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, ival, // ULong 0x00, 0x00, 0x00, 0x05, // DHEADER 0x00, 0x00, 0x00, ival, // ULong @@ -178,7 +178,7 @@ TEST_P(XCdrFinalTest, inner_appendable_structure) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x03, // Encapsulation ival, 0x00, 0x00, 0x00, // ULong 0x05, 0x00, 0x00, 0x00, // DHEADER ival, 0x00, 0x00, 0x00, // ULong @@ -209,6 +209,7 @@ TEST_P(XCdrFinalTest, inner_appendable_structure) cdr << MemberId(1) << value1; cdr << MemberId(2) << value2; cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -337,6 +338,7 @@ TEST_P(XCdrFinalTest, inner_mutable_structure) cdr << MemberId(1) << value1; cdr << MemberId(2) << value2; cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} diff --git a/test/xcdr/mutable.cpp b/test/xcdr/mutable.cpp index ba88bf12..f63b7623 100644 --- a/test/xcdr/mutable.cpp +++ b/test/xcdr/mutable.cpp @@ -338,7 +338,7 @@ TEST_P(XCdrMutableTest, unordered_and_more_serialized_elements) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x16, // DHEADER 0x20, 0x00, 0x00, 0x03, // EMHEADER1(M) without NEXTINT 0x00, 0x00, 0x00, ival, // ULong @@ -350,7 +350,7 @@ TEST_P(XCdrMutableTest, unordered_and_more_serialized_elements) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x16, 0x00, 0x00, 0x00, // DHEADER 0x03, 0x00, 0x00, 0x20, // EMHEADER1(M) without NEXTINT ival, 0x00, 0x00, 0x00, // ULong @@ -386,6 +386,7 @@ TEST_P(XCdrMutableTest, unordered_and_more_serialized_elements) cdr << MemberId(0x3FFF) << value3; cdr << MemberId(16) << value2; cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -480,7 +481,7 @@ TEST_P(XCdrMutableTest, unordered_and_less_serialized_elements) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x0E, // DHEADER 0x20, 0x00, 0x00, 0x03, // EMHEADER1(M) without NEXTINT 0x00, 0x00, 0x00, ival, // ULong @@ -489,7 +490,7 @@ TEST_P(XCdrMutableTest, unordered_and_less_serialized_elements) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x0E, 0x00, 0x00, 0x00, // DHEADER 0x03, 0x00, 0x00, 0x20, // EMHEADER1(M) without NEXTINT ival, 0x00, 0x00, 0x00, // ULong @@ -520,6 +521,7 @@ TEST_P(XCdrMutableTest, unordered_and_less_serialized_elements) cdr << MemberId(3) << value1; cdr << MemberId(16) << value2; cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -667,7 +669,7 @@ TEST_P(XCdrMutableTest, inner_unordered_and_more_serialized_elements) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x3E, // DHEADER 0x50, 0x00, 0x00, 0x01, // EMHEADER1(M) with NEXTINT 0x00, 0x00, 0x00, 0x16, // NEXTINT + DHEADER @@ -691,7 +693,7 @@ TEST_P(XCdrMutableTest, inner_unordered_and_more_serialized_elements) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x3E, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x50, // EMHEADER1(M) with NEXTINT 0x16, 0x00, 0x00, 0x00, // NEXTINT + DHEADER @@ -736,6 +738,7 @@ TEST_P(XCdrMutableTest, inner_unordered_and_more_serialized_elements) cdr << MemberId(1) << value; cdr << MemberId(2) << value; cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -856,7 +859,7 @@ TEST_P(XCdrMutableTest, inner_unordered_and_less_serialized_elements) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x2E, // DHEADER 0x50, 0x00, 0x00, 0x01, // EMHEADER1(M) with NEXTINT 0x00, 0x00, 0x00, 0x0E, // NEXTINT + DHEADER @@ -874,7 +877,7 @@ TEST_P(XCdrMutableTest, inner_unordered_and_less_serialized_elements) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x2E, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x50, // EMHEADER1(M) with NEXTINT 0x0E, 0x00, 0x00, 0x00, // NEXTINT + DHEADER @@ -913,6 +916,7 @@ TEST_P(XCdrMutableTest, inner_unordered_and_less_serialized_elements) cdr << MemberId(1) << value; cdr << MemberId(2) << value; cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -1004,7 +1008,7 @@ TEST_P(XCdrMutableTest, inner_final_structure) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x15, // DHEADER 0x20, 0x00, 0x00, 0x01, // EMHEADER1(M) without NEXTINT 0x00, 0x00, 0x00, ival, // ULong @@ -1015,7 +1019,7 @@ TEST_P(XCdrMutableTest, inner_final_structure) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x03, // Encapsulation 0x15, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x20, // EMHEADER1(M) without NEXTINT ival, 0x00, 0x00, 0x00, // ULong @@ -1049,6 +1053,7 @@ TEST_P(XCdrMutableTest, inner_final_structure) cdr << MemberId(1) << value1; cdr << MemberId(2) << value2; cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -1142,7 +1147,7 @@ TEST_P(XCdrMutableTest, inner_appendable_structure) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x15, // DHEADER 0x20, 0x00, 0x00, 0x01, // EMHEADER1(M) without NEXTINT 0x00, 0x00, 0x00, ival, // ULong @@ -1153,7 +1158,7 @@ TEST_P(XCdrMutableTest, inner_appendable_structure) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x03, // Encapsulation 0x15, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x20, // EMHEADER1(M) without NEXTINT ival, 0x00, 0x00, 0x00, // ULong @@ -1187,6 +1192,7 @@ TEST_P(XCdrMutableTest, inner_appendable_structure) cdr << MemberId(1) << value1; cdr << MemberId(2) << value2; cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} diff --git a/test/xcdr/optional.cpp b/test/xcdr/optional.cpp index 67f4d161..adcfd2e1 100644 --- a/test/xcdr/optional.cpp +++ b/test/xcdr/optional.cpp @@ -172,6 +172,7 @@ void serialize_optional( cdr << MemberId(1) << opt_value; } cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -258,6 +259,7 @@ void null_align_serialize_optional( cdr << MemberId(0) << align_value << MemberId(1) << opt_value; } cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -362,6 +364,7 @@ void align_serialize_optional( cdr << MemberId(0) << align_value << MemberId(1) << opt_value; } cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -470,6 +473,7 @@ void longdouble_align_serialize_optional( cdr << MemberId(0) << align_value << MemberId(1) << opt_value; } cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -588,23 +592,23 @@ TEST_P(XCdrOptionalTest, null_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x03, // Encapsulation 0x00 // Not present }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x03, // Encapsulation 0x00 // Not present }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x01, // DHEADER 0x00 // Not present }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x03, // Encapsulation 0x01, 0x00, 0x00, 0x00, // DHEADER 0x00 // Not present }; @@ -651,6 +655,7 @@ TEST_P(XCdrOptionalTest, null_optional) cdr.begin_serialize_type(enc_state, encoding); cdr.serialize_member(MemberId(1), opt_value); cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -701,6 +706,7 @@ TEST_P(XCdrOptionalTest, null_optional) cdr.begin_serialize_type(enc_state, encoding); cdr << MemberId(1) << opt_value; cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -756,13 +762,13 @@ TEST_P(XCdrOptionalTest, short_optional) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x02, // Encapsulation 0x00, 0x01, 0x00, 0x02, // ShortMemberHeader ival, fval // Short }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x02, // Encapsulation 0x01, 0x00, 0x02, 0x00, // ShortMemberHeader fval, ival // Short }; @@ -810,14 +816,14 @@ TEST_P(XCdrOptionalTest, short_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x06, // DHEADER 0x10, 0x00, 0x00, 0x01, // EMHEADER1(M) without NEXTINT ival, fval // Short }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x06, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x10, // EMHEADER1(M) without NEXTINT fval, ival // Short @@ -852,13 +858,13 @@ TEST_P(XCdrOptionalTest, ushort_optional) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x02, // Encapsulation 0x00, 0x01, 0x00, 0x02, // ShortMemberHeader ival, fval // UShort }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x02, // Encapsulation 0x01, 0x00, 0x02, 0x00, // ShortMemberHeader fval, ival // UShort }; @@ -906,14 +912,14 @@ TEST_P(XCdrOptionalTest, ushort_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x06, // DHEADER 0x10, 0x00, 0x00, 0x01, // EMHEADER1(M) without NEXTINT ival, fval // UShort }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x06, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x10, // EMHEADER1(M) without NEXTINT fval, ival // UShort @@ -1688,6 +1694,7 @@ TEST_P(XCdrOptionalTest, longdouble_optional) cdr.begin_serialize_type(enc_state, encoding); cdr.serialize_member(MemberId(1), opt_value); cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -1747,6 +1754,7 @@ TEST_P(XCdrOptionalTest, longdouble_optional) cdr.begin_serialize_type(enc_state, encoding); cdr << MemberId(1) << opt_value; cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -1808,13 +1816,13 @@ TEST_P(XCdrOptionalTest, boolean_optional) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x03, // Encapsulation 0x00, 0x01, 0x00, 0x01, // ShortMemberHeader b_value // Boolean }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x03, // Encapsulation 0x01, 0x00, 0x01, 0x00, // ShortMemberHeader b_value // Boolean }; @@ -1836,40 +1844,40 @@ TEST_P(XCdrOptionalTest, boolean_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x02, // Encapsulation 0x01, // Present b_value // Boolean }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x02, // Encapsulation 0x01, // Present b_value // Boolean }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x02, // DHEADER 0x01, // Present b_value // Boolean }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x02, // Encapsulation 0x02, 0x00, 0x00, 0x00, // DHEADER 0x01, // Present b_value // Boolean }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x05, // DHEADER 0x00, 0x00, 0x00, 0x01, // EMHEADER1(M) without NEXTINT b_value // Boolean }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x03, // Encapsulation 0x05, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT b_value // Boolean @@ -1902,13 +1910,13 @@ TEST_P(XCdrOptionalTest, octet_optional) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x03, // Encapsulation 0x00, 0x01, 0x00, 0x01, // ShortMemberHeader octet_value // Octet }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x03, // Encapsulation 0x01, 0x00, 0x01, 0x00, // ShortMemberHeader octet_value // Octet }; @@ -1930,40 +1938,40 @@ TEST_P(XCdrOptionalTest, octet_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x02, // Encapsulation 0x01, // Present octet_value // Octet }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x02, // Encapsulation 0x01, // Present octet_value // Octet }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x02, // DHEADER 0x01, // Present octet_value // Octet }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x02, // Encapsulation 0x02, 0x00, 0x00, 0x00, // DHEADER 0x01, // Present octet_value // Octet }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x05, // DHEADER 0x00, 0x00, 0x00, 0x01, // EMHEADER1(M) without NEXTINT octet_value // Octet }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x03, // Encapsulation 0x05, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT octet_value // Octet @@ -1997,13 +2005,13 @@ TEST_P(XCdrOptionalTest, char_optional) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x03, // Encapsulation 0x00, 0x01, 0x00, 0x01, // ShortMemberHeader valu // Char }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x03, // Encapsulation 0x01, 0x00, 0x01, 0x00, // ShortMemberHeader valu // Char }; @@ -2025,40 +2033,40 @@ TEST_P(XCdrOptionalTest, char_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x02, // Encapsulation 0x01, // Present valu // Char }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x02, // Encapsulation 0x01, // Present valu // Char }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x02, // DHEADER 0x01, // Present valu // Char }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x02, // Encapsulation 0x02, 0x00, 0x00, 0x00, // DHEADER 0x01, // Present valu // Char }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x05, // DHEADER 0x00, 0x00, 0x00, 0x01, // EMHEADER1(M) without NEXTINT valu // Char }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x03, // Encapsulation 0x05, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT valu // Char @@ -2093,13 +2101,13 @@ TEST_P(XCdrOptionalTest, wchar_optional) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x02, // Encapsulation 0x00, 0x01, 0x00, 0x02, // ShortMemberHeader ival, fval // Wchar }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x02, // Encapsulation 0x01, 0x00, 0x02, 0x00, // ShortMemberHeader fval, ival // Wchar }; @@ -2151,14 +2159,14 @@ TEST_P(XCdrOptionalTest, wchar_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x06, // DHEADER 0x10, 0x00, 0x00, 0x01, // EMHEADER1(M) without NEXTINT ival, fval // Wchar }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x06, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x10, // EMHEADER1(M) without NEXTINT fval, ival // Wchar @@ -2222,40 +2230,40 @@ TEST_P(XCdrOptionalTest, null_align_1_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x02, // Encapsulation align_value, 0x00 // Not present }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x02, // Encapsulation align_value, 0x00 // Not present }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x02, // DHEADER align_value, 0x00 // Not present }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x02, // Encapsulation 0x02, 0x00, 0x00, 0x00, // DHEADER align_value, 0x00 // Not present }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x05, // DHEADER 0x00, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT align_value }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x03, // Encapsulation 0x05, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT align_value @@ -2322,40 +2330,40 @@ TEST_P(XCdrOptionalTest, null_align_2_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x01, // Encapsulation ival, fval, 0x00 // Not present }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x01, // Encapsulation fval, ival, 0x00 // Not present }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x01, // Encapsulation 0x00, 0x00, 0x00, 0x03, // DHEADER ival, fval, 0x00 // Not present }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x01, // Encapsulation 0x03, 0x00, 0x00, 0x00, // DHEADER fval, ival, 0x00 // Not present }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x06, // DHEADER 0x10, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT ival, fval }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x06, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x10, // EMHEADER1(M) without NEXTINT fval, ival @@ -2417,26 +2425,26 @@ TEST_P(XCdrOptionalTest, null_align_4_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x03, // Encapsulation ival, ival, ival, fval, 0x00 // Not present }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x03, // Encapsulation fval, ival, ival, ival, 0x00 // Not present }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x05, // DHEADER ival, ival, ival, fval, 0x00 // Not present }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x03, // Encapsulation 0x05, 0x00, 0x00, 0x00, // DHEADER fval, ival, ival, ival, 0x00 // Not present @@ -2487,7 +2495,7 @@ TEST_P(XCdrOptionalTest, short_align_1_optional) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x02, // Encapsulation align_value, 0x00, 0x00, 0x00, // Alignment 0x00, 0x01, 0x00, 0x02, // ShortMemberHeader @@ -2495,7 +2503,7 @@ TEST_P(XCdrOptionalTest, short_align_1_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x02, // Encapsulation align_value, 0x00, 0x00, 0x00, // Alignment 0x01, 0x00, 0x02, 0x00, // ShortMemberHeader @@ -2555,7 +2563,7 @@ TEST_P(XCdrOptionalTest, short_align_1_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x0E, // DHEADER 0x00, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT align_value, @@ -2565,7 +2573,7 @@ TEST_P(XCdrOptionalTest, short_align_1_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x0E, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT align_value, @@ -2606,7 +2614,7 @@ TEST_P(XCdrOptionalTest, short_align_2_optional) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x02, // Encapsulation iava, fava, 0x00, 0x00, // Alignment 0x00, 0x01, 0x00, 0x02, // ShortMemberHeader @@ -2614,7 +2622,7 @@ TEST_P(XCdrOptionalTest, short_align_2_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x02, // Encapsulation fava, iava, 0x00, 0x00, // Alignment 0x01, 0x00, 0x02, 0x00, // ShortMemberHeader @@ -2644,7 +2652,7 @@ TEST_P(XCdrOptionalTest, short_align_2_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x02, // Encapsulation iava, fava, 0x01, // Present 0x00, // Alignment @@ -2652,7 +2660,7 @@ TEST_P(XCdrOptionalTest, short_align_2_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x02, // Encapsulation fava, iava, 0x01, // Present 0x00, // Alignment @@ -2660,7 +2668,7 @@ TEST_P(XCdrOptionalTest, short_align_2_optional) }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x06, // DHEADER iava, fava, 0x01, // Present @@ -2669,7 +2677,7 @@ TEST_P(XCdrOptionalTest, short_align_2_optional) }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x02, // Encapsulation 0x06, 0x00, 0x00, 0x00, // DHEADER fava, iava, 0x01, // Present @@ -2678,7 +2686,7 @@ TEST_P(XCdrOptionalTest, short_align_2_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x0E, // DHEADER 0x10, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT iava, fava, @@ -2688,7 +2696,7 @@ TEST_P(XCdrOptionalTest, short_align_2_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x0E, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x10, // EMHEADER1(M) without NEXTINT fava, iava, @@ -2730,14 +2738,14 @@ TEST_P(XCdrOptionalTest, short_align_4_optional) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x02, // Encapsulation iava, iava, iava, fava, 0x00, 0x01, 0x00, 0x02, // ShortMemberHeader ival, fval // Short }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x02, // Encapsulation fava, iava, iava, iava, 0x01, 0x00, 0x02, 0x00, // ShortMemberHeader fval, ival // Short @@ -2798,7 +2806,7 @@ TEST_P(XCdrOptionalTest, short_align_4_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x0E, // DHEADER 0x20, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT iava, iava, iava, fava, @@ -2807,7 +2815,7 @@ TEST_P(XCdrOptionalTest, short_align_4_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x0E, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x20, // EMHEADER1(M) without NEXTINT fava, iava, iava, iava, @@ -2846,7 +2854,7 @@ TEST_P(XCdrOptionalTest, ushort_align_1_optional) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x02, // Encapsulation align_value, 0x00, 0x00, 0x00, // Alignment 0x00, 0x01, 0x00, 0x02, // ShortMemberHeader @@ -2854,7 +2862,7 @@ TEST_P(XCdrOptionalTest, ushort_align_1_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x02, // Encapsulation align_value, 0x00, 0x00, 0x00, // Alignment 0x01, 0x00, 0x02, 0x00, // ShortMemberHeader @@ -2914,7 +2922,7 @@ TEST_P(XCdrOptionalTest, ushort_align_1_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x0E, // DHEADER 0x00, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT align_value, @@ -2924,7 +2932,7 @@ TEST_P(XCdrOptionalTest, ushort_align_1_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x0E, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT align_value, @@ -2966,7 +2974,7 @@ TEST_P(XCdrOptionalTest, ushort_align_2_optional) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x02, // Encapsulation iava, fava, 0x00, 0x00, // Alignment 0x00, 0x01, 0x00, 0x02, // ShortMemberHeader @@ -2974,7 +2982,7 @@ TEST_P(XCdrOptionalTest, ushort_align_2_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x02, // Encapsulation fava, iava, 0x00, 0x00, // Alignment 0x01, 0x00, 0x02, 0x00, // ShortMemberHeader @@ -3004,7 +3012,7 @@ TEST_P(XCdrOptionalTest, ushort_align_2_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x02, // Encapsulation iava, fava, 0x01, // Present 0x00, // Alignment @@ -3012,7 +3020,7 @@ TEST_P(XCdrOptionalTest, ushort_align_2_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x02, // Encapsulation fava, iava, 0x01, // Present 0x00, // Alignment @@ -3020,7 +3028,7 @@ TEST_P(XCdrOptionalTest, ushort_align_2_optional) }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x06, // DHEADER iava, fava, 0x01, // Present @@ -3029,7 +3037,7 @@ TEST_P(XCdrOptionalTest, ushort_align_2_optional) }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x02, // Encapsulation 0x06, 0x00, 0x00, 0x00, // DHEADER fava, iava, 0x01, // Present @@ -3038,7 +3046,7 @@ TEST_P(XCdrOptionalTest, ushort_align_2_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x0E, // DHEADER 0x10, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT iava, fava, @@ -3048,7 +3056,7 @@ TEST_P(XCdrOptionalTest, ushort_align_2_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x0E, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x10, // EMHEADER1(M) without NEXTINT fava, iava, @@ -3090,14 +3098,14 @@ TEST_P(XCdrOptionalTest, ushort_align_4_optional) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x02, // Encapsulation iava, iava, iava, fava, 0x00, 0x01, 0x00, 0x02, // ShortMemberHeader ival, fval // UShort }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x02, // Encapsulation fava, iava, iava, iava, 0x01, 0x00, 0x02, 0x00, // ShortMemberHeader fval, ival // UShort @@ -3158,7 +3166,7 @@ TEST_P(XCdrOptionalTest, ushort_align_4_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x0E, // DHEADER 0x20, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT iava, iava, iava, fava, @@ -3167,7 +3175,7 @@ TEST_P(XCdrOptionalTest, ushort_align_4_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x0E, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x20, // EMHEADER1(M) without NEXTINT fava, iava, iava, iava, @@ -5867,7 +5875,7 @@ TEST_P(XCdrOptionalTest, boolean_align_1_optional) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x03, // Encapsulation align_value, 0x00, 0x00, 0x00, // Alignment 0x00, 0x01, 0x00, 0x01, // ShortMemberHeader @@ -5875,7 +5883,7 @@ TEST_P(XCdrOptionalTest, boolean_align_1_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x03, // Encapsulation align_value, 0x00, 0x00, 0x00, // Alignment 0x01, 0x00, 0x01, 0x00, // ShortMemberHeader @@ -5905,21 +5913,21 @@ TEST_P(XCdrOptionalTest, boolean_align_1_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x01, // Encapsulation align_value, 0x01, // Present b_value // Boolean }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x01, // Encapsulation align_value, 0x01, // Present b_value // Boolean }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x01, // Encapsulation 0x00, 0x00, 0x00, 0x03, // DHEADER align_value, 0x01, // Present @@ -5927,7 +5935,7 @@ TEST_P(XCdrOptionalTest, boolean_align_1_optional) }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x01, // Encapsulation 0x03, 0x00, 0x00, 0x00, // DHEADER align_value, 0x01, // Present @@ -5935,7 +5943,7 @@ TEST_P(XCdrOptionalTest, boolean_align_1_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x0D, // DHEADER 0x00, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT align_value, @@ -5945,7 +5953,7 @@ TEST_P(XCdrOptionalTest, boolean_align_1_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x03, // Encapsulation 0x0D, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT align_value, @@ -5986,7 +5994,7 @@ TEST_P(XCdrOptionalTest, boolean_align_2_optional) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x03, // Encapsulation iava, fava, 0x00, 0x00, // Alignment 0x00, 0x01, 0x00, 0x01, // ShortMemberHeader @@ -5994,7 +6002,7 @@ TEST_P(XCdrOptionalTest, boolean_align_2_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x03, // Encapsulation fava, iava, 0x00, 0x00, // Alignment 0x01, 0x00, 0x01, 0x00, // ShortMemberHeader @@ -6054,7 +6062,7 @@ TEST_P(XCdrOptionalTest, boolean_align_2_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x0D, // DHEADER 0x10, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT iava, fava, @@ -6064,7 +6072,7 @@ TEST_P(XCdrOptionalTest, boolean_align_2_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x03, // Encapsulation 0x0D, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x10, // EMHEADER1(M) without NEXTINT fava, iava, @@ -6105,14 +6113,14 @@ TEST_P(XCdrOptionalTest, boolean_align_4_optional) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x03, // Encapsulation iava, iava, iava, fava, 0x00, 0x01, 0x00, 0x01, // ShortMemberHeader b_value // Boolean }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x03, // Encapsulation fava, iava, iava, iava, 0x01, 0x00, 0x01, 0x00, // ShortMemberHeader b_value // Boolean @@ -6139,21 +6147,21 @@ TEST_P(XCdrOptionalTest, boolean_align_4_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x02, // Encapsulation iava, iava, iava, fava, 0x01, // Present b_value // Boolean }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x02, // Encapsulation fava, iava, iava, iava, 0x01, // Present b_value // Boolean }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x06, // DHEADER iava, iava, iava, fava, 0x01, // Present @@ -6161,7 +6169,7 @@ TEST_P(XCdrOptionalTest, boolean_align_4_optional) }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x02, // Encapsulation 0x06, 0x00, 0x00, 0x00, // DHEADER fava, iava, iava, iava, 0x01, // Present @@ -6169,7 +6177,7 @@ TEST_P(XCdrOptionalTest, boolean_align_4_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x0D, // DHEADER 0x20, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT iava, iava, iava, fava, @@ -6178,7 +6186,7 @@ TEST_P(XCdrOptionalTest, boolean_align_4_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x03, // Encapsulation 0x0D, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x20, // EMHEADER1(M) without NEXTINT fava, iava, iava, iava, @@ -6215,7 +6223,7 @@ TEST_P(XCdrOptionalTest, octet_align_1_optional) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x03, // Encapsulation align_value, 0x00, 0x00, 0x00, // Alignment 0x00, 0x01, 0x00, 0x01, // ShortMemberHeader @@ -6223,7 +6231,7 @@ TEST_P(XCdrOptionalTest, octet_align_1_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x03, // Encapsulation align_value, 0x00, 0x00, 0x00, // Alignment 0x01, 0x00, 0x01, 0x00, // ShortMemberHeader @@ -6253,21 +6261,21 @@ TEST_P(XCdrOptionalTest, octet_align_1_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x01, // Encapsulation align_value, 0x01, // Present octet_value // Octet }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x01, // Encapsulation align_value, 0x01, // Present octet_value // Octet }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x01, // Encapsulation 0x00, 0x00, 0x00, 0x03, // DHEADER align_value, 0x01, // Present @@ -6275,7 +6283,7 @@ TEST_P(XCdrOptionalTest, octet_align_1_optional) }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x01, // Encapsulation 0x03, 0x00, 0x00, 0x00, // DHEADER align_value, 0x01, // Present @@ -6283,7 +6291,7 @@ TEST_P(XCdrOptionalTest, octet_align_1_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x0D, // DHEADER 0x00, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT align_value, @@ -6293,7 +6301,7 @@ TEST_P(XCdrOptionalTest, octet_align_1_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x03, // Encapsulation 0x0D, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT align_value, @@ -6333,7 +6341,7 @@ TEST_P(XCdrOptionalTest, octet_align_2_optional) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x03, // Encapsulation iava, fava, 0x00, 0x00, // Alignment 0x00, 0x01, 0x00, 0x01, // ShortMemberHeader @@ -6341,7 +6349,7 @@ TEST_P(XCdrOptionalTest, octet_align_2_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x03, // Encapsulation fava, iava, 0x00, 0x00, // Alignment 0x01, 0x00, 0x01, 0x00, // ShortMemberHeader @@ -6401,7 +6409,7 @@ TEST_P(XCdrOptionalTest, octet_align_2_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x0D, // DHEADER 0x10, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT iava, fava, @@ -6411,7 +6419,7 @@ TEST_P(XCdrOptionalTest, octet_align_2_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x03, // Encapsulation 0x0D, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x10, // EMHEADER1(M) without NEXTINT fava, iava, @@ -6451,14 +6459,14 @@ TEST_P(XCdrOptionalTest, octet_align_4_optional) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x03, // Encapsulation iava, iava, iava, fava, 0x00, 0x01, 0x00, 0x01, // ShortMemberHeader octet_value // Octet }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x03, // Encapsulation fava, iava, iava, iava, 0x01, 0x00, 0x01, 0x00, // ShortMemberHeader octet_value // Octet @@ -6485,21 +6493,21 @@ TEST_P(XCdrOptionalTest, octet_align_4_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x02, // Encapsulation iava, iava, iava, fava, 0x01, // Present octet_value // Octet }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x02, // Encapsulation fava, iava, iava, iava, 0x01, // Present octet_value // Octet }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x06, // DHEADER iava, iava, iava, fava, 0x01, // Present @@ -6507,7 +6515,7 @@ TEST_P(XCdrOptionalTest, octet_align_4_optional) }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x02, // Encapsulation 0x06, 0x00, 0x00, 0x00, // DHEADER fava, iava, iava, iava, 0x01, // Present @@ -6515,7 +6523,7 @@ TEST_P(XCdrOptionalTest, octet_align_4_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x0D, // DHEADER 0x20, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT iava, iava, iava, fava, @@ -6524,7 +6532,7 @@ TEST_P(XCdrOptionalTest, octet_align_4_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x03, // Encapsulation 0x0D, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x20, // EMHEADER1(M) without NEXTINT fava, iava, iava, iava, @@ -6562,7 +6570,7 @@ TEST_P(XCdrOptionalTest, char_align_1_optional) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x03, // Encapsulation align_value, 0x00, 0x00, 0x00, // Alignment 0x00, 0x01, 0x00, 0x01, // ShortMemberHeader @@ -6570,7 +6578,7 @@ TEST_P(XCdrOptionalTest, char_align_1_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x03, // Encapsulation align_value, 0x00, 0x00, 0x00, // Alignment 0x01, 0x00, 0x01, 0x00, // ShortMemberHeader @@ -6600,21 +6608,21 @@ TEST_P(XCdrOptionalTest, char_align_1_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x01, // Encapsulation align_value, 0x01, // Present valu // Char }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x01, // Encapsulation align_value, 0x01, // Present valu // Char }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x01, // Encapsulation 0x00, 0x00, 0x00, 0x03, // DHEADER align_value, 0x01, // Present @@ -6622,7 +6630,7 @@ TEST_P(XCdrOptionalTest, char_align_1_optional) }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x01, // Encapsulation 0x03, 0x00, 0x00, 0x00, // DHEADER align_value, 0x01, // Present @@ -6630,7 +6638,7 @@ TEST_P(XCdrOptionalTest, char_align_1_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x0D, // DHEADER 0x00, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT align_value, @@ -6640,7 +6648,7 @@ TEST_P(XCdrOptionalTest, char_align_1_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x03, // Encapsulation 0x0D, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT align_value, @@ -6681,7 +6689,7 @@ TEST_P(XCdrOptionalTest, char_align_2_optional) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x03, // Encapsulation iava, fava, 0x00, 0x00, // Alignment 0x00, 0x01, 0x00, 0x01, // ShortMemberHeader @@ -6689,7 +6697,7 @@ TEST_P(XCdrOptionalTest, char_align_2_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x03, // Encapsulation fava, iava, 0x00, 0x00, // Alignment 0x01, 0x00, 0x01, 0x00, // ShortMemberHeader @@ -6749,7 +6757,7 @@ TEST_P(XCdrOptionalTest, char_align_2_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x0D, // DHEADER 0x10, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT iava, fava, @@ -6759,7 +6767,7 @@ TEST_P(XCdrOptionalTest, char_align_2_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x03, // Encapsulation 0x0D, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x10, // EMHEADER1(M) without NEXTINT fava, iava, @@ -6800,14 +6808,14 @@ TEST_P(XCdrOptionalTest, char_align_4_optional) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x03, // Encapsulation iava, iava, iava, fava, 0x00, 0x01, 0x00, 0x01, // ShortMemberHeader valu // Char }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x03, // Encapsulation fava, iava, iava, iava, 0x01, 0x00, 0x01, 0x00, // ShortMemberHeader valu // Char @@ -6834,21 +6842,21 @@ TEST_P(XCdrOptionalTest, char_align_4_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x02, // Encapsulation iava, iava, iava, fava, 0x01, // Present valu // Char }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x02, // Encapsulation fava, iava, iava, iava, 0x01, // Present valu // Char }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x06, // DHEADER iava, iava, iava, fava, 0x01, // Present @@ -6856,7 +6864,7 @@ TEST_P(XCdrOptionalTest, char_align_4_optional) }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x02, // Encapsulation 0x06, 0x00, 0x00, 0x00, // DHEADER fava, iava, iava, iava, 0x01, // Present @@ -6864,7 +6872,7 @@ TEST_P(XCdrOptionalTest, char_align_4_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x0D, // DHEADER 0x20, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT iava, iava, iava, fava, @@ -6873,7 +6881,7 @@ TEST_P(XCdrOptionalTest, char_align_4_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x03, // Encapsulation 0x0D, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x20, // EMHEADER1(M) without NEXTINT fava, iava, iava, iava, @@ -6912,7 +6920,7 @@ TEST_P(XCdrOptionalTest, wchar_align_1_optional) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x02, // Encapsulation align_value, 0x00, 0x00, 0x00, // Alignment 0x00, 0x01, 0x00, 0x02, // ShortMemberHeader @@ -6920,7 +6928,7 @@ TEST_P(XCdrOptionalTest, wchar_align_1_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x02, // Encapsulation align_value, 0x00, 0x00, 0x00, // Alignment 0x01, 0x00, 0x02, 0x00, // ShortMemberHeader @@ -6980,7 +6988,7 @@ TEST_P(XCdrOptionalTest, wchar_align_1_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x0E, // DHEADER 0x00, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT align_value, @@ -6990,7 +6998,7 @@ TEST_P(XCdrOptionalTest, wchar_align_1_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x0E, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT align_value, @@ -7032,7 +7040,7 @@ TEST_P(XCdrOptionalTest, wchar_align_2_optional) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x02, // Encapsulation iava, fava, 0x00, 0x00, // Alignment 0x00, 0x01, 0x00, 0x02, // ShortMemberHeader @@ -7040,7 +7048,7 @@ TEST_P(XCdrOptionalTest, wchar_align_2_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x02, // Encapsulation fava, iava, 0x00, 0x00, // Alignment 0x01, 0x00, 0x02, 0x00, // ShortMemberHeader @@ -7070,7 +7078,7 @@ TEST_P(XCdrOptionalTest, wchar_align_2_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x06, 0x00, 0x00, // Encapsulation + 0x00, 0x06, 0x00, 0x02, // Encapsulation iava, fava, 0x01, // Present 0x00, // Alignment @@ -7078,7 +7086,7 @@ TEST_P(XCdrOptionalTest, wchar_align_2_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x07, 0x00, 0x00, // Encapsulation + 0x00, 0x07, 0x00, 0x02, // Encapsulation fava, iava, 0x01, // Present 0x00, // Alignment @@ -7086,7 +7094,7 @@ TEST_P(XCdrOptionalTest, wchar_align_2_optional) }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x06, // DHEADER iava, fava, 0x01, // Present @@ -7095,7 +7103,7 @@ TEST_P(XCdrOptionalTest, wchar_align_2_optional) }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x02, // Encapsulation 0x06, 0x00, 0x00, 0x00, // DHEADER fava, iava, 0x01, // Present @@ -7104,7 +7112,7 @@ TEST_P(XCdrOptionalTest, wchar_align_2_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x0E, // DHEADER 0x10, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT iava, fava, @@ -7114,7 +7122,7 @@ TEST_P(XCdrOptionalTest, wchar_align_2_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x0E, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x10, // EMHEADER1(M) without NEXTINT fava, iava, @@ -7156,14 +7164,14 @@ TEST_P(XCdrOptionalTest, wchar_align_4_optional) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x02, // Encapsulation iava, iava, iava, fava, 0x00, 0x01, 0x00, 0x02, // ShortMemberHeader ival, fval // WChar }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x02, // Encapsulation fava, iava, iava, iava, 0x01, 0x00, 0x02, 0x00, // ShortMemberHeader fval, ival // WChar @@ -7224,7 +7232,7 @@ TEST_P(XCdrOptionalTest, wchar_align_4_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x0E, // DHEADER 0x20, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT iava, iava, iava, fava, @@ -7233,7 +7241,7 @@ TEST_P(XCdrOptionalTest, wchar_align_4_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x0E, 0x00, 0x00, 0x00, // DHEADER 0x00, 0x00, 0x00, 0x20, // EMHEADER1(M) without NEXTINT fava, iava, iava, iava, @@ -7324,7 +7332,7 @@ TEST_P(XCdrOptionalTest, two_inner_null_optional) }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x08, 0x00, 0x00, // Encapsulation + 0x00, 0x08, 0x00, 0x03, // Encapsulation 0x00, 0x00, 0x00, 0x11, // DHEADER 0x01, // Present 0x00, 0x00, 0x00, // Alignment @@ -7337,7 +7345,7 @@ TEST_P(XCdrOptionalTest, two_inner_null_optional) }; expected_streams[0 + EncodingAlgorithmFlag::DELIMIT_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x09, 0x00, 0x00, // Encapsulation + 0x00, 0x09, 0x00, 0x03, // Encapsulation 0x11, 0x00, 0x00, 0x00, // DHEADER 0x01, // Present 0x00, 0x00, 0x00, // Alignment @@ -7400,6 +7408,7 @@ TEST_P(XCdrOptionalTest, two_inner_null_optional) cdr.serialize_member(MemberId(1), opt_value); cdr.serialize_member(MemberId(3), opt_value); cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -7482,6 +7491,7 @@ TEST_P(XCdrOptionalTest, two_inner_null_optional) cdr << MemberId(1) << opt_value; cdr << MemberId(3) << opt_value; cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -7575,7 +7585,7 @@ TEST_P(XCdrOptionalTest, two_inner_short_optional) XCdrStreamValues expected_streams; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x00, 0x00, 0x00, // Encapsulation + 0x00, 0x00, 0x00, 0x02, // Encapsulation 0x00, 0x01, 0x00, 0x06, // ShortMemberHeader 0x00, 0x03, 0x00, 0x02, // ShortMemberHeader ival, fval, // Short @@ -7586,7 +7596,7 @@ TEST_P(XCdrOptionalTest, two_inner_short_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PLAIN_CDR + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x01, 0x00, 0x00, // Encapsulation + 0x00, 0x01, 0x00, 0x02, // Encapsulation 0x01, 0x00, 0x06, 0x00, // ShortMemberHeader 0x03, 0x00, 0x02, 0x00, // ShortMemberHeader fval, ival, // Short @@ -7681,7 +7691,7 @@ TEST_P(XCdrOptionalTest, two_inner_short_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::BIG_ENDIANNESS] = { - 0x00, 0x0A, 0x00, 0x00, // Encapsulation + 0x00, 0x0A, 0x00, 0x02, // Encapsulation 0x00, 0x00, 0x00, 0x1E, // DHEADER 0x50, 0x00, 0x00, 0x01, // EMHEADER1(M) with NEXTINT 0x00, 0x00, 0x00, 0x06, // NEXTINT + DHEADER @@ -7695,7 +7705,7 @@ TEST_P(XCdrOptionalTest, two_inner_short_optional) }; expected_streams[0 + EncodingAlgorithmFlag::PL_CDR2 + Cdr::Endianness::LITTLE_ENDIANNESS] = { - 0x00, 0x0B, 0x00, 0x00, // Encapsulation + 0x00, 0x0B, 0x00, 0x02, // Encapsulation 0x1E, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x50, // EMHEADER1(M) with NEXTINT 0x06, 0x00, 0x00, 0x00, // NEXTINT + DHEADER @@ -7741,6 +7751,7 @@ TEST_P(XCdrOptionalTest, two_inner_short_optional) cdr.serialize_member(MemberId(1), opt_value); cdr.serialize_member(MemberId(3), opt_value); cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -7823,6 +7834,7 @@ TEST_P(XCdrOptionalTest, two_inner_short_optional) cdr << MemberId(1) << opt_value; cdr << MemberId(3) << opt_value; cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} diff --git a/test/xcdr/xcdrv1.cpp b/test/xcdr/xcdrv1.cpp index 97fe34dd..2925be42 100644 --- a/test/xcdr/xcdrv1.cpp +++ b/test/xcdr/xcdrv1.cpp @@ -65,6 +65,7 @@ void xcdrv1_serialize_the_value( cdr.begin_serialize_type(enc_state, encoding); cdr.serialize_member(MemberId(1), value, header_selection); cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -132,6 +133,7 @@ TEST_P(XCdrv1Test, auto_selection_on_decode) cdr << MemberId(0) << us; cdr << MemberId(1) << ul; cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); //} //{ Decode an ushort and an ulong. @@ -258,6 +260,7 @@ TEST_P(XCdrv1Test, push_origin_zero) cdr << MemberId(0) << uc; cdr << MemberId(1) << longlong_value; cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); //} //{ Test encoded content diff --git a/test/xcdr/xcdrv2.cpp b/test/xcdr/xcdrv2.cpp index 1767c5cc..71afa337 100644 --- a/test/xcdr/xcdrv2.cpp +++ b/test/xcdr/xcdrv2.cpp @@ -63,6 +63,7 @@ void xcdrv2_serialize_the_value( cdr.begin_serialize_type(enc_state, encoding); cdr.serialize_member(MemberId(1), value, header_selection); cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); Cdr::state enc_state_end(cdr); //} @@ -132,6 +133,7 @@ TEST_P(XCdrv2Test, auto_selection_on_decode) cdr << MemberId(0) << us; cdr << MemberId(1) << ul; cdr.end_serialize_type(enc_state); + cdr.set_dds_cdr_options({0, 0}); //} //{ Decode an ushort and an ulong. @@ -181,14 +183,14 @@ TEST_P(XCdrv2PLTest, pl_octet_member) XCdrStreamValues expected_streams; expected_streams[0 + Cdr::XCdrHeaderSelection::SHORT_HEADER] = { - 0x00, 0x0b, 0x00, 0x00, // Encapsulation + 0x00, 0x0b, 0x00, 0x03, // Encapsulation 0x05, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT octet_value // Octet }; expected_streams[0 + Cdr::XCdrHeaderSelection::LONG_HEADER] = { - 0x00, 0x0b, 0x00, 0x00, // Encapsulation + 0x00, 0x0b, 0x00, 0x03, // Encapsulation 0x09, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x40, // EMHEADER1(M) with NEXTINT 0x01, 0x00, 0x00, 0x00, // Member size @@ -196,14 +198,14 @@ TEST_P(XCdrv2PLTest, pl_octet_member) }; expected_streams[0 + Cdr::XCdrHeaderSelection::AUTO_WITH_SHORT_HEADER_BY_DEFAULT] = { - 0x00, 0x0b, 0x00, 0x00, // Encapsulation + 0x00, 0x0b, 0x00, 0x03, // Encapsulation 0x05, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT octet_value // Octet }; expected_streams[0 + Cdr::XCdrHeaderSelection::AUTO_WITH_LONG_HEADER_BY_DEFAULT] = { - 0x00, 0x0b, 0x00, 0x00, // Encapsulation + 0x00, 0x0b, 0x00, 0x03, // Encapsulation 0x05, 0x00, 0x00, 0x00, // DHEADER 0x01, 0x00, 0x00, 0x00, // EMHEADER1(M) without NEXTINT octet_value // Octet From 5cc8c55d967d88aff67a0e35ee82a4576362842d Mon Sep 17 00:00:00 2001 From: Miguel Company Date: Fri, 8 Nov 2024 10:06:12 +0100 Subject: [PATCH 23/33] Fail when trying to serialize `std::string` with null characters on its content (#245) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Refs #21362. Add test. Signed-off-by: Miguel Company * Refs #21362. Fix Cdr behavior. Signed-off-by: Miguel Company * Refs #21362. Fix FastCDR behavior. Signed-off-by: Miguel Company * Refs #21362. Fix dll export. Signed-off-by: Miguel Company * Refs #21362. Leave implementation in header. Signed-off-by: Miguel Company * Refs #21362. Apply suggestion. Signed-off-by: Miguel Company Co-authored-by: Mario Domínguez López <116071334+Mario-DL@users.noreply.github.com> --------- Signed-off-by: Miguel Company Co-authored-by: Mario Domínguez López <116071334+Mario-DL@users.noreply.github.com> --- include/fastcdr/Cdr.h | 18 +++++++++++++++++- include/fastcdr/FastCdr.h | 29 +++++++++++++++++++++++------ test/cdr/SimpleTest.cpp | 30 ++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+), 7 deletions(-) diff --git a/include/fastcdr/Cdr.h b/include/fastcdr/Cdr.h index 56334674..ce2e4f51 100644 --- a/include/fastcdr/Cdr.h +++ b/include/fastcdr/Cdr.h @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -703,12 +704,27 @@ class Cdr * @param string_t The string that will be serialized in the buffer. * @return Reference to the eprosima::fastcdr::Cdr object. * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + * @exception exception::BadParamException This exception is thrown when trying to serialize a string with null characters. */ TEMPLATE_SPEC Cdr& serialize( const std::string& string_t) { - return serialize(string_t.c_str()); + // An empty string is serialized as a 0 length string. + if (string_t.empty()) + { + return serialize(static_cast(0)); + } + + // Check there are no null characters in the string. + const char* c_str = string_t.c_str(); + const auto str_len = strlen(c_str); + if (string_t.size() > str_len) + { + throw exception::BadParamException("The string contains null characters"); + } + + return serialize_sequence(c_str, str_len + 1); } /*! diff --git a/include/fastcdr/FastCdr.h b/include/fastcdr/FastCdr.h index d009e99c..42e73252 100644 --- a/include/fastcdr/FastCdr.h +++ b/include/fastcdr/FastCdr.h @@ -15,10 +15,9 @@ #ifndef _FASTCDR_FASTCDR_H_ #define _FASTCDR_FASTCDR_H_ -#include "fastcdr_dll.h" -#include "FastBuffer.h" -#include "exceptions/NotEnoughMemoryException.h" -#include +#include +#include +#include #include #include @@ -28,7 +27,10 @@ #include #endif // if !__APPLE__ && !__FreeBSD__ && !__VXWORKS__ -#include +#include "fastcdr_dll.h" +#include "FastBuffer.h" +#include "exceptions/NotEnoughMemoryException.h" +#include "exceptions/BadParamException.h" namespace eprosima { namespace fastcdr { @@ -883,12 +885,27 @@ class Cdr_DllAPI FastCdr * @param string_t The string that will be serialized in the buffer. * @return Reference to the eprosima::fastcdr::FastCdr object. * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize in a position that exceeds the internal memory size. + * @exception exception::BadParamException This exception is thrown when trying to serialize a string with null characters. */ inline FastCdr& serialize( const std::string& string_t) { - return serialize(string_t.c_str()); + // An empty string is serialized as a 0 length string. + if (string_t.empty()) + { + return serialize(static_cast(0)); + } + + // Check there are no null characters in the string. + const char* c_str = string_t.c_str(); + const auto str_len = strlen(c_str); + if (string_t.size() > str_len) + { + throw exception::BadParamException("The string contains null characters"); + } + + return serialize(c_str); } /*! diff --git a/test/cdr/SimpleTest.cpp b/test/cdr/SimpleTest.cpp index be2af444..0dbef726 100644 --- a/test/cdr/SimpleTest.cpp +++ b/test/cdr/SimpleTest.cpp @@ -7081,3 +7081,33 @@ TEST(FastCDRTests, ZeroSequenceAtTheEnd) cdr_des_bool >> value >> bool_zero_sequence; }); } + +TEST(CDRTests, StringWithNullChars) +{ + std::string str{ "Hello World" }; + str[5] = '\0'; + char buffer[256]; + FastBuffer cdrbuffer(buffer, 256); + Cdr cdr_ser(cdrbuffer); + + EXPECT_THROW( + { + cdr_ser << str; + }, + BadParamException); +} + +TEST(FastCDRTests, StringWithNullChars) +{ + std::string str{ "Hello World" }; + str[5] = '\0'; + char buffer[256]; + FastBuffer cdrbuffer(buffer, 256); + FastCdr cdr_ser(cdrbuffer); + + EXPECT_THROW( + { + cdr_ser << str; + }, + BadParamException); +} From ae920520a9d7c7c3facba2445045d8a2d0b268ba Mon Sep 17 00:00:00 2001 From: Felix F Xu <84662027+felixf4xu@users.noreply.github.com> Date: Mon, 11 Nov 2024 22:17:48 +0800 Subject: [PATCH 24/33] Fix: function definition is marked dllimport (#210) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix: function definition is marked dllimport * Update src/cpp/Cdr.cpp Co-authored-by: Jesús Poderoso <120394830+JesusPoderoso@users.noreply.github.com> * Update src/cpp/Cdr.cpp Co-authored-by: Jesús Poderoso <120394830+JesusPoderoso@users.noreply.github.com> --------- Co-authored-by: Jesús Poderoso <120394830+JesusPoderoso@users.noreply.github.com> --- include/fastcdr/Cdr.h | 61 +++++++---------------------------- src/cpp/Cdr.cpp | 74 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+), 50 deletions(-) diff --git a/include/fastcdr/Cdr.h b/include/fastcdr/Cdr.h index ce2e4f51..0f836ee1 100644 --- a/include/fastcdr/Cdr.h +++ b/include/fastcdr/Cdr.h @@ -531,10 +531,7 @@ class Cdr * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. */ Cdr_DllAPI Cdr& serialize( - const uint8_t& octet_t) - { - return serialize(static_cast(octet_t)); - } + const uint8_t& octet_t); /*! * @brief This function serializes a character. @@ -552,10 +549,7 @@ class Cdr * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. */ Cdr_DllAPI Cdr& serialize( - const int8_t int8) - { - return serialize(static_cast(int8)); - } + const int8_t int8); /*! * @brief This function serializes an unsigned short. @@ -564,10 +558,7 @@ class Cdr * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. */ Cdr_DllAPI Cdr& serialize( - const uint16_t ushort_t) - { - return serialize(static_cast(ushort_t)); - } + const uint16_t ushort_t); /*! * @brief This function serializes a short. @@ -585,10 +576,7 @@ class Cdr * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. */ Cdr_DllAPI Cdr& serialize( - const uint32_t ulong_t) - { - return serialize(static_cast(ulong_t)); - } + const uint32_t ulong_t); /*! * @brief This function serializes a long. @@ -606,10 +594,7 @@ class Cdr * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. */ Cdr_DllAPI Cdr& serialize( - const wchar_t wchar) - { - return serialize(static_cast(wchar)); - } + const wchar_t wchar); /*! * @brief This function serializes an unsigned long long. @@ -618,10 +603,7 @@ class Cdr * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. */ Cdr_DllAPI Cdr& serialize( - const uint64_t ulonglong_t) - { - return serialize(static_cast(ulonglong_t)); - } + const uint64_t ulonglong_t); /*! * @brief This function serializes a long long. @@ -676,10 +658,7 @@ class Cdr * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. */ Cdr_DllAPI Cdr& serialize( - char* string_t) - { - return serialize(static_cast(string_t)); - } + char* string_t); /*! * @brief This function serializes a string. @@ -2781,10 +2760,7 @@ class Cdr */ Cdr_DllAPI Cdr& begin_serialize_type( Cdr::state& current_state, - EncodingAlgorithmFlag type_encoding) - { - return (this->*begin_serialize_type_)(current_state, type_encoding); - } + EncodingAlgorithmFlag type_encoding); /*! * @brief Tells to the encoder the encoding of the type finishes. @@ -2794,10 +2770,7 @@ class Cdr * position that exceeds the internal memory size. */ Cdr_DllAPI Cdr& end_serialize_type( - Cdr::state& current_state) - { - return (this->*end_serialize_type_)(current_state); - } + Cdr::state& current_state); /*! * @brief Tells to the encoder a new type and its members starts to be decoded. @@ -2809,10 +2782,7 @@ class Cdr */ Cdr_DllAPI Cdr& deserialize_type( EncodingAlgorithmFlag type_encoding, - std::function functor) - { - return (this->*deserialize_type_)(type_encoding, functor); - } + std::function functor); /*! * @brief Encodes an optional in the buffer. @@ -2866,16 +2836,7 @@ class Cdr * encoded. */ Cdr_DllAPI Cdr& operator <<( - const MemberId& member_id) - { - if (next_member_id_ != MEMBER_ID_INVALID) - { - throw exception::BadParamException("Member id already set and not encoded"); - } - - next_member_id_ = member_id; - return *this; - } + const MemberId& member_id); /*! * @brief Decodes an optional from the buffer. diff --git a/src/cpp/Cdr.cpp b/src/cpp/Cdr.cpp index 6d684999..5f80c157 100644 --- a/src/cpp/Cdr.cpp +++ b/src/cpp/Cdr.cpp @@ -504,6 +504,12 @@ bool Cdr::resize( return false; } +Cdr& Cdr::serialize( + const uint8_t& octet_t) +{ + return serialize(static_cast(octet_t)); +} + Cdr& Cdr::serialize( const char char_t) { @@ -519,6 +525,18 @@ Cdr& Cdr::serialize( throw NotEnoughMemoryException(NotEnoughMemoryException::NOT_ENOUGH_MEMORY_MESSAGE_DEFAULT); } +Cdr& Cdr::serialize( + const int8_t int8) +{ + return serialize(static_cast(int8)); +} + +Cdr& Cdr::serialize( + const uint16_t ushort_t) +{ + return serialize(static_cast(ushort_t)); +} + Cdr& Cdr::serialize( const int16_t short_t) { @@ -552,6 +570,12 @@ Cdr& Cdr::serialize( throw NotEnoughMemoryException(NotEnoughMemoryException::NOT_ENOUGH_MEMORY_MESSAGE_DEFAULT); } +Cdr& Cdr::serialize( + const uint32_t ulong_t) +{ + return serialize(static_cast(ulong_t)); +} + Cdr& Cdr::serialize( const int32_t long_t) { @@ -587,6 +611,18 @@ Cdr& Cdr::serialize( throw NotEnoughMemoryException(NotEnoughMemoryException::NOT_ENOUGH_MEMORY_MESSAGE_DEFAULT); } +Cdr& Cdr::serialize( + const wchar_t wchar) +{ + return serialize(static_cast(wchar)); +} + +Cdr& Cdr::serialize( + const uint64_t ulonglong_t) +{ + return serialize(static_cast(ulonglong_t)); +} + Cdr& Cdr::serialize( const int64_t longlong_t) { @@ -812,6 +848,12 @@ Cdr& Cdr::serialize( throw NotEnoughMemoryException(NotEnoughMemoryException::NOT_ENOUGH_MEMORY_MESSAGE_DEFAULT); } +Cdr& Cdr::serialize( + char* string_t) +{ + return serialize(static_cast(string_t)); +} + Cdr& Cdr::serialize( const char* string_t) { @@ -2189,6 +2231,38 @@ Cdr& Cdr::deserialize_array( throw NotEnoughMemoryException(NotEnoughMemoryException::NOT_ENOUGH_MEMORY_MESSAGE_DEFAULT); } +Cdr& Cdr::begin_serialize_type( + Cdr::state& current_state, + EncodingAlgorithmFlag type_encoding) +{ + return (this->*begin_serialize_type_)(current_state, type_encoding); +} + +Cdr& Cdr::end_serialize_type( + Cdr::state& current_state) +{ + return (this->*end_serialize_type_)(current_state); +} + +Cdr& Cdr::deserialize_type( + EncodingAlgorithmFlag type_encoding, + std::function functor) +{ + return (this->*deserialize_type_)(type_encoding, functor); +} + +Cdr& Cdr::operator <<( + const MemberId& member_id) +{ + if (next_member_id_ != MEMBER_ID_INVALID) + { + throw exception::BadParamException("Member id already set and not encoded"); + } + + next_member_id_ = member_id; + return *this; +} + Cdr& Cdr::serialize_bool_array( const std::vector& vector_t) { From bfa51aab88c3533887d81c618ec641dae242dc09 Mon Sep 17 00:00:00 2001 From: Miguel Company Date: Wed, 27 Nov 2024 10:21:01 +0100 Subject: [PATCH 25/33] Serialize single null-character for empty strings (#249) * Refs #22284. Add regression test. Signed-off-by: Miguel Company * Refs #22284. Fix issue. Signed-off-by: Miguel Company --------- Signed-off-by: Miguel Company --- include/fastcdr/Cdr.h | 6 ------ include/fastcdr/FastCdr.h | 6 ------ test/cdr/SimpleTest.cpp | 26 ++++++++++++++++++++++++++ 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/include/fastcdr/Cdr.h b/include/fastcdr/Cdr.h index 0f836ee1..c3754ca8 100644 --- a/include/fastcdr/Cdr.h +++ b/include/fastcdr/Cdr.h @@ -689,12 +689,6 @@ class Cdr Cdr& serialize( const std::string& string_t) { - // An empty string is serialized as a 0 length string. - if (string_t.empty()) - { - return serialize(static_cast(0)); - } - // Check there are no null characters in the string. const char* c_str = string_t.c_str(); const auto str_len = strlen(c_str); diff --git a/include/fastcdr/FastCdr.h b/include/fastcdr/FastCdr.h index 42e73252..1a26b9c7 100644 --- a/include/fastcdr/FastCdr.h +++ b/include/fastcdr/FastCdr.h @@ -891,12 +891,6 @@ class Cdr_DllAPI FastCdr FastCdr& serialize( const std::string& string_t) { - // An empty string is serialized as a 0 length string. - if (string_t.empty()) - { - return serialize(static_cast(0)); - } - // Check there are no null characters in the string. const char* c_str = string_t.c_str(); const auto str_len = strlen(c_str); diff --git a/test/cdr/SimpleTest.cpp b/test/cdr/SimpleTest.cpp index 0dbef726..09848fc8 100644 --- a/test/cdr/SimpleTest.cpp +++ b/test/cdr/SimpleTest.cpp @@ -7111,3 +7111,29 @@ TEST(FastCDRTests, StringWithNullChars) }, BadParamException); } + +TEST(CDRTests, EmptyStringSerializationSize) +{ + std::string str; + char buffer[256]; + FastBuffer cdrbuffer(buffer, 256); + Cdr cdr_ser(cdrbuffer); + EXPECT_NO_THROW( + { + cdr_ser << str; + }); + EXPECT_EQ(cdr_ser.get_serialized_data_length(), 5u); +} + +TEST(FastCDRTests, EmptyStringSerializationSize) +{ + std::string str; + char buffer[256]; + FastBuffer cdrbuffer(buffer, 256); + FastCdr cdr_ser(cdrbuffer); + EXPECT_NO_THROW( + { + cdr_ser << str; + }); + EXPECT_EQ(cdr_ser.get_serialized_data_length(), 5u); +} From 5f8080d8674b4ea5ace04bba0d2e1a929ec2d59f Mon Sep 17 00:00:00 2001 From: wrightsg Date: Wed, 27 Nov 2024 11:14:58 +0100 Subject: [PATCH 26/33] Fix C2512 compile error with Visual Studio 2015 (#234) Co-authored-by: Simon Wright --- include/fastcdr/xcdr/detail/optional.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/fastcdr/xcdr/detail/optional.hpp b/include/fastcdr/xcdr/detail/optional.hpp index f71474ec..3bebde9e 100644 --- a/include/fastcdr/xcdr/detail/optional.hpp +++ b/include/fastcdr/xcdr/detail/optional.hpp @@ -47,7 +47,7 @@ struct optional_storage /* *INDENT-OFF* */ template -struct optional_storage{}>::type> +struct optional_storage::value>::type> { union { From 691ba7a65518eed3e0a1a13bb8e0820962873136 Mon Sep 17 00:00:00 2001 From: Raul Sanchez-Mateos Lizano Date: Wed, 27 Nov 2024 12:25:12 +0100 Subject: [PATCH 27/33] Fix windows default version and vs-toolset default input in CI (#250) * Fix windows default version and vs-toolset Signed-off-by: Raul Sanchez-Mateos * Update default windows version and update toolset description Signed-off-by: Raul Sanchez-Mateos * Update missing default windows version Signed-off-by: Raul Sanchez-Mateos * Set windows version back to 2019 Signed-off-by: Raul Sanchez-Mateos --------- Signed-off-by: Raul Sanchez-Mateos --- .github/workflows/windows-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index 761a5430..dabd2a11 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -6,12 +6,12 @@ on: os-version: description: 'OS version to run the workflow' required: false - default: 'windows-13' + default: 'windows-2019' type: string vs-toolset: - description: 'Visual Studio toolset to use' + description: 'Visual Studio toolset to use (Default: v141 and v142)' required: false - default: 'v142' + default: '' type: string colcon-args: description: 'Extra arguments for colcon cli' From 0cb11a4d7ae79f0fbd646e2ed9115bef415a51f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Dom=C3=ADnguez=20L=C3=B3pez?= <116071334+Mario-DL@users.noreply.github.com> Date: Fri, 29 Nov 2024 11:58:40 +0100 Subject: [PATCH 28/33] Fix cmake generator evaluation (#251) Signed-off-by: Mario Dominguez --- src/cpp/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt index 7ed04422..3b8f886e 100644 --- a/src/cpp/CMakeLists.txt +++ b/src/cpp/CMakeLists.txt @@ -60,7 +60,7 @@ target_compile_definitions(${PROJECT_NAME} INTERFACE $<$:${PROJECT_NAME_UPPER}_NO_LIB> PUBLIC - $<$,SHARED_LIBRARY>:${PROJECT_NAME_UPPER}_DYN_LINK> + $<$:$<$,SHARED_LIBRARY>:${PROJECT_NAME_UPPER}_DYN_LINK>> ) # Define public headers From 750a77e5e795a95250271c2e4f8ff7da32475a57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Poderoso?= <120394830+JesusPoderoso@users.noreply.github.com> Date: Fri, 13 Dec 2024 11:58:57 +0100 Subject: [PATCH 29/33] Add EOL versions in RELEASE_SUPPORT.md (#248) * Refs #22175: Add EOL versions in RELEASE_SUPPORT.md Signed-off-by: eProsima * Refs #22175: Add latest supported versions Signed-off-by: eProsima --------- Signed-off-by: eProsima --- RELEASE_SUPPORT.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/RELEASE_SUPPORT.md b/RELEASE_SUPPORT.md index 4b58e3b1..e2755c16 100644 --- a/RELEASE_SUPPORT.md +++ b/RELEASE_SUPPORT.md @@ -6,13 +6,19 @@ Please, refer to the [master branch](https://github.com/eProsima/Fast-CDR/blob/m *eProsima Fast CDR* maintains several releases with different support cycles. **All of them are attached to different *eProsima Fast DDS* releases.** -## *eProsima Fast DDS* and *Fast CDR* version compatibility +## *eProsima Fast DDS* and *Fast CDR* supported versions compatibility |Fast DDS Version|Fast CDR Version|Fast CDR Version branch|Fast CDR Latest Release| |----------------|----------------|-----------------------|-----------------------| -|2.14|2.2|[2.2.x](https://github.com/eProsima/Fast-CDR/tree/2.2.x)|[v2.2.2](https://github.com/eProsima/Fast-CDR/releases/tag/v2.2.2)| +|3.1, 3.0, 2.14|2.2|[2.2.x](https://github.com/eProsima/Fast-CDR/tree/2.2.x)|[v2.2.5](https://github.com/eProsima/Fast-CDR/releases/tag/v2.2.5)| |2.10|1.0|[1.0.x](https://github.com/eProsima/Fast-CDR/tree/1.0.x)|[v1.0.28](https://github.com/eProsima/Fast-CDR/releases/tag/v1.0.28)| |2.6|1.0|[1.0.x](https://github.com/eProsima/Fast-CDR/tree/1.0.x)|[v1.0.28](https://github.com/eProsima/Fast-CDR/releases/tag/v1.0.28)| +|Fast DDS Version|Fast CDR Version|Fast CDR Version branch|Fast CDR Latest Release|Release Date|EOL Date| +|----------------|----------------|-----------------------|-----------------------|------------|--------| +|2.13|2.1|[2.1.x](https://github.com/eProsima/Fast-CDR/tree/2.1.x)|[v2.1.3](https://github.com/eProsima/Fast-CDR/releases/tag/v2.1.3)|December 2023|July 2024| +|2.12|2.0|[2.0.x](https://github.com/eProsima/Fast-CDR/tree/2.0.x)|[v2.0.0](https://github.com/eProsima/Fast-CDR/releases/tag/v2.0.0)|September 2023|March 2024| +|2.11|1.1|[1.1.x](https://github.com/eProsima/Fast-CDR/tree/1.1.x)|[v1.1.1](https://github.com/eProsima/Fast-CDR/releases/tag/v1.1.1)|May 2023|February 2024| + For detailed information about the lifecycle of the different *Fast DDS* versions (and their corresponding counterpart in this repository), please refer to the [release support section of the Fast DDS repository](https://github.com/eProsima/Fast-DDS/blob/master/RELEASE_SUPPORT.md). From abf6c9a52ccf6ad054578d07c5dd1a99121a9cec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Dom=C3=ADnguez=20L=C3=B3pez?= <116071334+Mario-DL@users.noreply.github.com> Date: Tue, 17 Dec 2024 09:28:12 +0100 Subject: [PATCH 30/33] Allow to run CI on external contributions (#254) Signed-off-by: Mario Dominguez --- .github/workflows/reusable-ci.yml | 7 ++++++- .github/workflows/ubuntu-ci.yml | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/reusable-ci.yml b/.github/workflows/reusable-ci.yml index c99cefda..4b69f6fc 100644 --- a/.github/workflows/reusable-ci.yml +++ b/.github/workflows/reusable-ci.yml @@ -47,6 +47,11 @@ on: required: false type: boolean default: false + add-label: + description: 'Add the ci-pending label to the PR' + required: false + type: boolean + default: false env: toolset: ${{ inputs.vs-toolset && format('-T {0}', inputs.vs-toolset) || '' }} defaults: @@ -65,7 +70,7 @@ jobs: steps: - name: Add ci-pending label if PR - if: ${{ github.event_name == 'pull_request' }} + if: ${{ github.event_name == 'pull_request' && inputs.add-label == true}} uses: eProsima/eProsima-CI/external/add_labels@v0 with: labels: ci-pending diff --git a/.github/workflows/ubuntu-ci.yml b/.github/workflows/ubuntu-ci.yml index 5d133e18..a5ee4116 100644 --- a/.github/workflows/ubuntu-ci.yml +++ b/.github/workflows/ubuntu-ci.yml @@ -63,3 +63,4 @@ jobs: run-build: ${{ !(github.event_name == 'pull_request') || !contains(github.event.pull_request.labels.*.name, 'skip-ci') }} run-tests: ${{ (inputs.run-tests == true) || ((github.event_name == 'pull_request') && (!contains(github.event.pull_request.labels.*.name, 'no-test'))) }} use-ccache: ${{ inputs.use-ccache || false }} + add-label: ${{ (github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name == github.repository) && true || false }} From 5b8025b2009cd83477a95e3037f275adac6a626b Mon Sep 17 00:00:00 2001 From: SamuelH91 Date: Tue, 17 Dec 2024 10:58:00 +0200 Subject: [PATCH 31/33] Use assign for deserialize instead of temporary std::string (#241) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Samuel Hyyppä Co-authored-by: Samuel Hyyppä --- include/fastcdr/Cdr.h | 2 +- include/fastcdr/FastCdr.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/fastcdr/Cdr.h b/include/fastcdr/Cdr.h index c3754ca8..126bf2b9 100644 --- a/include/fastcdr/Cdr.h +++ b/include/fastcdr/Cdr.h @@ -1793,7 +1793,7 @@ class Cdr { uint32_t length = 0; const char* str = read_string(length); - value = std::string(str, length); + value.assign(str, length); return *this; } diff --git a/include/fastcdr/FastCdr.h b/include/fastcdr/FastCdr.h index 1a26b9c7..4cce3920 100644 --- a/include/fastcdr/FastCdr.h +++ b/include/fastcdr/FastCdr.h @@ -1552,7 +1552,7 @@ class Cdr_DllAPI FastCdr { uint32_t length = 0; const char* str = read_string(length); - string_t = std::string(str, length); + string_t.assign(str, length); return *this; } From d7940c2736b1336b58d385cc76030a9e2172b0c8 Mon Sep 17 00:00:00 2001 From: Miguel Company Date: Tue, 17 Dec 2024 11:24:44 +0100 Subject: [PATCH 32/33] Remove EOL versions from PR template and nightly jobs (#256) * Refs #22103. Remove EOL versions from PR template backports. Signed-off-by: Miguel Company * Refs #22103. Remove EOL versions from nightly jobs. Signed-off-by: Miguel Company --------- Signed-off-by: Miguel Company --- .github/pull_request_template.md | 2 +- .github/workflows/nightly-mac-ci.yml | 10 ---------- .github/workflows/nightly-ubuntu-ci.yml | 10 ---------- .github/workflows/nightly-windows-ci.yml | 17 ----------------- 4 files changed, 1 insertion(+), 38 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 4cbefe3b..18ddf6cd 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -17,7 +17,7 @@ In case of bug fixes, please provide the list of supported branches where this fix should be also merged. Please uncomment following line, adjusting the corresponding target branches for the backport. --> - + diff --git a/.github/workflows/nightly-mac-ci.yml b/.github/workflows/nightly-mac-ci.yml index ddc9d189..98eccc0d 100644 --- a/.github/workflows/nightly-mac-ci.yml +++ b/.github/workflows/nightly-mac-ci.yml @@ -26,16 +26,6 @@ jobs: run-tests: true use-ccache: false - nightly-mac-ci-1_1_x: - uses: eProsima/Fast-CDR/.github/workflows/reusable-ci.yml@1.1.x - with: - os-version: 'macos-13' - label: 'nightly-mac-ci-1.1.x' - fastcdr-branch: '1.1.x' - run-build: true - run-tests: true - use-ccache: false - nightly-mac-ci-1_0_x: uses: eProsima/Fast-CDR/.github/workflows/reusable-ci.yml@1.0.x with: diff --git a/.github/workflows/nightly-ubuntu-ci.yml b/.github/workflows/nightly-ubuntu-ci.yml index 48cfdfa8..a183a12d 100644 --- a/.github/workflows/nightly-ubuntu-ci.yml +++ b/.github/workflows/nightly-ubuntu-ci.yml @@ -26,16 +26,6 @@ jobs: run-tests: true use-ccache: false - nightly-ubuntu-ci-1_1_x: - uses: eProsima/Fast-CDR/.github/workflows/reusable-ci.yml@1.1.x - with: - os-version: 'ubuntu-22.04' - label: 'nightly-ubuntu-ci-1.1.x' - fastcdr-branch: '1.1.x' - run-build: true - run-tests: true - use-ccache: false - nightly-ubuntu-ci-1_0_x: uses: eProsima/Fast-CDR/.github/workflows/reusable-ci.yml@1.0.x with: diff --git a/.github/workflows/nightly-windows-ci.yml b/.github/workflows/nightly-windows-ci.yml index cc292101..875867fb 100644 --- a/.github/workflows/nightly-windows-ci.yml +++ b/.github/workflows/nightly-windows-ci.yml @@ -40,23 +40,6 @@ jobs: run-tests: true use-ccache: false - nightly-windows-ci-1_1_x: - strategy: - fail-fast: false - matrix: - vs-toolset: - - 'v141' - - 'v142' - uses: eProsima/Fast-CDR/.github/workflows/reusable-ci.yml@1.1.x - with: - os-version: 'windows-2019' - vs-toolset: ${{ matrix.vs-toolset }} - label: 'nightly-windows-${{ matrix.vs-toolset }}-ci-1.1.x' - fastcdr-branch: '1.1.x' - run-build: true - run-tests: true - use-ccache: false - nightly-windows-ci-1_0_x: strategy: fail-fast: false From 9149259a1eb54a9b1104a9f622f89b00a66b6011 Mon Sep 17 00:00:00 2001 From: Miguel Company Date: Tue, 17 Dec 2024 15:03:33 +0100 Subject: [PATCH 33/33] Bump version to 2.2.6 (#258) Signed-off-by: Miguel Company --- CMakeLists.txt | 2 +- package.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4350498e..5fcc463f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,7 @@ endif() ############################################################################### # Project # ############################################################################### -project(fastcdr VERSION 2.2.5 LANGUAGES CXX) +project(fastcdr VERSION 2.2.6 LANGUAGES CXX) set(PROJECT_NAME_STYLED "FastCDR") set(PROJECT_NAME_LARGE "Fast CDR") diff --git a/package.xml b/package.xml index c00787e1..316b8f21 100644 --- a/package.xml +++ b/package.xml @@ -2,7 +2,7 @@ fastcdr - 2.2.5 + 2.2.6 *eProsima Fast CDR* is a C++ serialization library implementing the Common Data Representation (CDR) mechanism defined by the Object Management Group (OMG) consortium. CDR is the serialization mechanism used in DDS for the DDS Interoperability Wire Protocol (DDSI-RTPS).