Skip to content

Cross-Language Verification Tests #1099

@elfenpiff

Description

@elfenpiff

Goal

Ensure that the container StaticVec & StaticString can be used in an inter-process communication context (C++ <-> Rust) without serialization.

Therefore, we require tests that ensure

  1. an identical memory layout of that classes
  • the order/offsets of the members must be identical
  • the size and alignment of the members
  • the semantic type of the members (see int64_t vs u64 in the size member)
  1. the have the same content contracts
  • see StaticString that supports only characters < 128, if one programming language is able to add illegal characters it would break the contract on the other side

Implementation

1. Identifcal memory layout

This requires whitebox testing on C++ and Rust side. We could introduce a testing.hpp file in the C++ library and a new iceoryx2-bb-container-conformance-tests crate on the C++ side.

  • Introduce C function that can and return the size, alignment, offset and type of the members and return it
    • for the type we actually need only to know if the m_size variable is an unsigned integer, the rest can be deduced from the size
  • Use bindgen and build.rs to generate a rust file to access the testing.hpp functions within a rust test suite
  • write integration tests in iceoryx2-bb-container-conformance-tests that uses the testing.hpp functions and compares the layout with the rust counterpart

2. Same content contract

Introduce a new root folder called component-tests and structure it identical to the examples folder.

  • component-tests/cxx
  • component-tests/rust
  • component-tests/e2e-tests

Write a request response process, where the client requests a change in a given container and the server responds with the performed change. See:

The output can be verified with expect like it is done in the cross-language-end-to-end-tests in the examples folder. The character to add request can be parameterized via cli arguments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions