Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[21393] Add new tests for testing new key hash calculation according to DDS-XTypes 1.3 #5091

Merged
merged 9 commits into from
Aug 2, 2024

Conversation

richiware
Copy link
Member

@richiware richiware commented Jul 19, 2024

Description

This PR increases the number of tests of the DynamicTypes feature for testing the new key hash calculation according to DDS-XTypes 1.3

Depends on:

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
  • N/A Any new/modified methods have been properly documented using Doxygen.
  • N/A Any new configuration API has an equivalent XML API (with the corresponding XSD extension)
  • N/A Changes are backport compatible: they do NOT break ABI nor change library core behavior.
  • Changes are API compatible.
  • N/A New feature has been added to the versions.md file (if applicable).
  • N/A New feature has been documented/Current behavior is correctly described in the documentation.
  • N/A 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.
  • N/A: If this is a critical bug fix, backports to the critical-only supported branches have been requested.
  • Check CI results: changes do not issue any warning.
  • Check CI results: failing tests are unrelated with the changes.

@richiware richiware added this to the v3.0.0 milestone Jul 19, 2024
@richiware richiware changed the title Add new tests for testing new key hash calculation according to DDS-XTypes 1.3 [21393] Add new tests for testing new key hash calculation according to DDS-XTypes 1.3 Jul 19, 2024
MiguelCompany
MiguelCompany previously approved these changes Jul 26, 2024
Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev>
Signed-off-by: eduponz <eduardoponz@eprosima.com>
Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev>
Signed-off-by: eduponz <eduardoponz@eprosima.com>
Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev>
Signed-off-by: eduponz <eduardoponz@eprosima.com>
Signed-off-by: eduponz <eduardoponz@eprosima.com>
MiguelCompany
MiguelCompany previously approved these changes Jul 30, 2024
Copy link
Member

@MiguelCompany MiguelCompany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with green CI

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
MiguelCompany
MiguelCompany previously approved these changes Jul 31, 2024
Copy link
Member

@MiguelCompany MiguelCompany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with green CI

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
…are conditions. Let compare n bytes only

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
@Mario-DL
Copy link
Member

Mario-DL commented Aug 1, 2024

These former commits propose a fix for the DDSTypesTest_KeyedLongDoubleStruct test which was failing only in ubuntu github ci, not being reproducible in local.

sizeof(long double) is meant, to at least, have 8 bytes. However, its typical values are 10, 12 or 16.
Fast CDR detects system's size for long double and uses it in consequence.
The problem that came was that, despite the system returns that supports a size of 16 for a long double, experimental analysis revealed that the 6 least significant bytes after reinterpret_cast<const char*>() of a long double were trash or, at least subject to rounding issues. The following link leads to a simple script in godbolt. By running multiple times, the least 6 significant bytes change from one run to another but, the reconstructed value remains always the same.

Bearing this in mind, the proposed fix makes the test only compare the first 10 bytes of the structure (in reality, the latter 10 bytes since the key hash is computed with BIG_ENDIAN).
It can be discussed that we could change the logic also in Fast CDR but from my point of view it is doing things coherently in the sense that it is serializing the full 16 bytes, because it is what the system says it supports for a long double.

@Mario-DL Mario-DL self-requested a review August 1, 2024 14:00
@Mario-DL Mario-DL added ready-to-merge Ready to be merged. CI and changes have been reviewed and approved. and removed ci-pending PR which CI is running labels Aug 2, 2024
@juanlofer-eprosima juanlofer-eprosima merged commit 5a75fc4 into master Aug 2, 2024
16 of 17 checks passed
@juanlofer-eprosima juanlofer-eprosima deleted the feature/21385 branch August 2, 2024 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge Ready to be merged. CI and changes have been reviewed and approved.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants