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

Add checkVector test helper equivalent to checkMatrix, NativePrint for std::unordered_map and std::array #5293

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

PDoakORNL
Copy link
Contributor

Expanded Utilities/for_testing.

Proposed changes

See title
Incoming PR's will have tests that use these and provide coverage.

What type(s) of changes does this code introduce?

Delete the items that do not apply

  • New feature
  • Documentation or build script changes

Does this introduce a breaking change?

  • No

What systems has this change been tested on?

Checklist

  • Yes This PR is up to date with current the current state of 'develop'
  • Yes. Code added or changed in the PR has been clang-formatted
  • No. This PR adds tests to cover any new code, or to catch a bug that is being fixed
  • Yes/No. Documentation has been added (if appropriate)

{
bool result;
std::string result_message;
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use empty return error_message for pass instead of this two element struct? Just return the error_string.

Copy link
Contributor

Choose a reason for hiding this comment

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

Did you miss this one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not a big fan of check for null as success semantics and this turns out quite readable with the catch macros for checkMatrix. I want this to have the same semantics. See: test_ConstantSPOSet.cpp, test_cuBLAS_LU.cpp, test_spline_applyrotation.cpp, etc.

Copy link
Contributor

Choose a reason for hiding this comment

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

The current CheckXXXResults is not concise.
If results=true, it is unclear what non-empty result_message should be used for or should I care?
If results=false, but results_message is empty. Should I concerned about an empty result_message? Is that a bug?
I don't like undefined behvaviors.
A single string is neat. If empty, pass. If non-empty, error info is given.
Do you have good ways to prevent any UB with CheckXXXResults?

src/Utilities/for_testing/checkVector.hpp Show resolved Hide resolved
@PDoakORNL
Copy link
Contributor Author

test this please

@PDoakORNL PDoakORNL requested a review from ye-luo January 30, 2025 18:15
@PDoakORNL PDoakORNL force-pushed the more_testing_utilities branch from 52acdd8 to b802536 Compare January 31, 2025 18:04
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.

2 participants