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

CmdLineParser: return enum from parseFromArgs() instead of using additional member #5698

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

firewave
Copy link
Collaborator

No description provided.

@firewave
Copy link
Collaborator Author

Requires #5676 to be merged first.

@@ -104,6 +104,19 @@ class TestCmdlineParser : public TestFixture {
// TODO: verify that the redirect output is empty
}

// add specialization so the enums can be compared without a cast
template<typename T, typename U>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I had to add the general version because I cannot create a specialization for the template in the parent class.

}

template<>
bool assertEquals<CmdLineParser::Result, CmdLineParser::Result>(const char* const filename, const unsigned int linenr, const CmdLineParser::Result& expected, const CmdLineParser::Result& actual) const
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added the specialization so I didn't have to introduce hundreds of static_cast into the asserts.

Copy link
Collaborator Author

@firewave firewave Nov 24, 2023

Choose a reason for hiding this comment

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

If we find a way to simply this specialization we can clean up other tests.

@firewave firewave force-pushed the cmd-ret branch 2 times, most recently from 866868a to 2b48af7 Compare November 25, 2023 20:13
@firewave firewave marked this pull request as ready for review November 25, 2023 20:13
@firewave firewave marked this pull request as draft November 25, 2023 21:13
@firewave firewave marked this pull request as ready for review November 26, 2023 13:41
@firewave firewave merged commit a937862 into danmar:main Nov 27, 2023
68 checks passed
@firewave firewave deleted the cmd-ret branch November 27, 2023 11:06
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