Allow string lengths to be set at compile time#175
Merged
andrewcoughtrie merged 10 commits intoMetOffice:mainfrom May 15, 2025
Merged
Allow string lengths to be set at compile time#175andrewcoughtrie merged 10 commits intoMetOffice:mainfrom
andrewcoughtrie merged 10 commits intoMetOffice:mainfrom
Conversation
Protect the default string buffer size of 100 with a pre-processor directive and add a build option to allow the size to be changed at compile time using a cmake directive.
Document the new STRING_LENGTH option in the build instructions and include details of the value if the option is not set.
This makes various improvements including: * Changing the STRING_LENGTH option setting to check the value passed by the user by applying a sensible minimum. Issue a warning if the value is too small. * Move the hashtable macros from the source file to the header, making them available to other components * Add a test to check that the framework exits with an error if the label is too long
According to clang-format, line 129 in test_hashtable.cpp should not be wrapped!
andrewcoughtrie
requested changes
May 14, 2025
Collaborator
andrewcoughtrie
left a comment
There was a problem hiding this comment.
A few things to look at nothing major though.
Comment on lines
100
to
101
| - Maximum length of the identifier string. Default if | ||
| unspecified is truncate strings at 100 characters. |
Collaborator
There was a problem hiding this comment.
More correct to say default is 100 and vernier will error if length is greater than 100
Whitespace clean-up Co-authored-by: Andrew Coughtrie <24609575+andrewcoughtrie@users.noreply.github.com>
Co-authored-by: Andrew Coughtrie <24609575+andrewcoughtrie@users.noreply.github.com>
Co-authored-by: Andrew Coughtrie <24609575+andrewcoughtrie@users.noreply.github.com>
andrewcoughtrie
requested changes
May 15, 2025
Collaborator
andrewcoughtrie
left a comment
There was a problem hiding this comment.
The changes look good but there is a failure in the testing when the string length is set to 256 in my case, so that needs fixing.
Scope must be INFERFACE not PRIVATE otherwise STRING_LENGTH setting will not be propagated to the test harness.
andrewcoughtrie
approved these changes
May 15, 2025
Collaborator
andrewcoughtrie
left a comment
There was a problem hiding this comment.
This all looks good to me now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a cmake option to allow string length to be changed at compile time from their default value of 100 characters. This is necessary because psyclone inserts timers with longer names.