Skip to content

Conversation

@bocchino
Copy link
Collaborator

@bocchino bocchino commented Mar 11, 2025

  • Update the code generators for ports and components
    • Incidental: Revise the "FpConfig.hpp" header include to <FpConfig.hpp> to conform to F Prime conventions
    • Regenerate unit tests
  • Add unit tests to cover the new behavior

Closes #651.

A small change to F Prime was required. To run the check-cpp tests, use this branch: bocchino/fprime@b6cf5cc.

@bocchino bocchino requested review from Kronos3 and jwest115 March 11, 2025 18:26
Copy link
Collaborator

@Kronos3 Kronos3 left a comment

Choose a reason for hiding this comment

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

Looks good. I wonder if the if this still works if you return a type with a string nested in another type like a struct or an array?

@bocchino
Copy link
Collaborator Author

It should work because structs and arrays use Fw::ExternalString for string members. Are you suggesting that we add a test case for this kind of return type?

@bocchino
Copy link
Collaborator Author

Note that there are fpp-to-cpp tests for structs and arrays with string members, in the struct and array subdirectories.

Copy link
Collaborator

@Kronos3 Kronos3 left a comment

Choose a reason for hiding this comment

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

Ah right, and Fw::ExternalString will have a buffer managed by the port handler in the derived component code so it doesn't concern the base class at all.

@bocchino bocchino merged commit 5f5e4ab into main Mar 14, 2025
11 checks passed
@bocchino bocchino deleted the issue-651-port-string branch March 14, 2025 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Returning a string from a port does not work

3 participants