-
Notifications
You must be signed in to change notification settings - Fork 3
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
Remade CheckAlgorithms.java test to be a little more advanced #31
Conversation
// Check if the shouldHonorFips is "true" or "false" | ||
if (!args[0].equalsIgnoreCase("true") && !args[0].equalsIgnoreCase("false")) { | ||
// Check if the shouldHonorFips is valid value | ||
List<String> possibleFirstArgs = Arrays.asList("true", "false", "only-algorithms", "only-providers"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is duplicated with help. Please make it static final, immutable, and in the hel, stream.join it. it od not need to be perfect, but bbetter then duplicate it.
if (!testCategory.equalsIgnoreCase("algorithms") && !testCategory.equalsIgnoreCase("providers")) { | ||
System.err.println("Invalid test category: " + testCategory); | ||
// Check if the test category is "algorithms", "providers" or "both" | ||
List<String> possibleSecondArgs = Arrays.asList("algorithms", "providers", "both"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is duplicated with help. Please make it static final, immutable, and in the help, stream.join it. it od not need to be perfect, but bbetter then duplicate it.
At the end this is just vey minor, backward compatibel enhancment, right? I still dont like the it is twelve possible combinations, but only subset gave sense. Thus the first parameter is whether we are testing or jsut listing, but second is what. algortighms, or providers, or both. Currently, the test is printing in both listing and testing cases, and that is correct. It may be good to think about oen more option, silent-test, which will skip the printing. (as in case of correclty written 'what is tested against what' the asserting output may be enough). |
Some new updates:
Example output for arguments
What do you think? Is this output format ok or should I change? |
Thanx, lets go with it as it is and tune it on the fly |
Updated
CheckAlgorithms.java
, these are the main changes:algorithms
orproviders
, I added the option forboth
which first lists/checks the algorithms and then the providerstrue/false
switches for checking FIPS compatibility, I addedonly-algorithms
andonly-providers
for checking FIPS compatibility only on the specified categorySince there are still the same switches (
true/false
andalgorithms/providers
) in the same order available, the test should be backwards compatible and should not break anything.