-
-
Notifications
You must be signed in to change notification settings - Fork 39
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 test cases for checkExternalDecimal() #152
Conversation
Launched a grinder to verify the change; |
Launched another grinder because previous timed out. |
Launched a new grinder with just the DAA tests and longer timeout value |
Grinder passed without any failures. @r30shah This is ready for review. |
c8864d4
to
7a9fc93
Compare
9732331
to
0ad5885
Compare
Signed-off-by: Shubham Verma <[email protected]>
0ad5885
to
3677515
Compare
Assert.assertEquals("bytesWithSpaces < 0 should result in return code of 3", 3, result); | ||
|
||
result = ExternalDecimal.checkExternalDecimal(a, 2, 5, DecimalData.EBCDIC_SIGN_EMBEDDED_TRAILING, 1); | ||
Assert.assertEquals("bytesWithSpaces < 0 should result in return code of 3", 2, result); |
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.
We expect this test case to return 2 or 3? Comment and expected value does not match here.
ExternalDecimal.checkExternalDecimal(a, 0, -5, DecimalData.EBCDIC_SIGN_EMBEDDED_TRAILING, 5); | ||
} | ||
catch (IllegalArgumentException e) { | ||
e.getMessage().contains("Precision must be greater than 0"); |
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.
Assuming this is testing for IllegalArgumentException, shouldn't we pass or fail based on the result. Also contains
method call do return boolean. Shouldn't we compare it ?
ExternalDecimal.checkExternalDecimal(a, 0, 0, DecimalData.EBCDIC_SIGN_EMBEDDED_TRAILING, 5); | ||
} | ||
catch (IllegalArgumentException e) { | ||
e.getMessage().contains("Precision must be greater than 0"); |
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.
Same comment as previous.
ExternalDecimal.checkExternalDecimal(a, -1, 3, DecimalData.EBCDIC_SIGN_EMBEDDED_TRAILING, 5); | ||
} | ||
catch (IllegalArgumentException e) { | ||
e.getMessage().contains("Offset must be non-negative integer"); |
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.
Same comment as previous.
ExternalDecimal.checkExternalDecimal(a, 0, 3, 23, 5); | ||
} | ||
catch (IllegalArgumentException e) { | ||
e.getMessage().contains("Invalid decimalType"); |
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.
same comment as previous.
ExternalDecimal.checkExternalDecimal(a, 0, 9, DecimalData.EBCDIC_SIGN_EMBEDDED_TRAILING, 5); | ||
} | ||
catch (ArrayIndexOutOfBoundsException e) { | ||
e.getMessage().contains("Array access index out of bounds"); |
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.
Same comment as previous.
int result = ExternalDecimal.checkExternalDecimal(a, 0, 5, DecimalData.EBCDIC_SIGN_EMBEDDED_TRAILING, 1); // rc = 2 | ||
Assert.assertEquals("Result code for signEmbeddedTrailingPrefered(a) should have been 0", 0, result); // hardware returns 2 | ||
|
||
// Debugging - Start |
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.
Why do we have this comment?
|
||
// Debugging - Start | ||
result = ExternalDecimal.checkExternalDecimal(a, 0, 5, DecimalData.EBCDIC_SIGN_EMBEDDED_TRAILING, 2); // rc = 0 | ||
// it honors DSC < DC but maybe it needs it to be +1 than actual value? |
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.
Also why do we have this comment ?
7a539af
to
1585adb
Compare
Signed-off-by: Shubham Verma <[email protected]>
1585adb
to
45bd5f5
Compare
@r30shah I have updated the PR based on your suggestions. I have tested these changes locally with my openj9 change and no failures. |
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.
LGTM, @VermaSh can you confirm if you have tested these changes with corresponding API changes in OpenJ9 (Which is merged now)?
I have tested it with the openj9 PR but not with merged eclipse branch. Let me test it again with eclipse branches. |
|
@VermaSh is this safe to merge? i.e, have you verified as mentioned in #152 (comment)? |
@r30shah yup, this is safe to merge. |
Thanks @VermaSh , merging changes based on the testing done so far. |
@r30shah do we expect this PR to be included in April release (0.44)? If so, we will need to re-tag this repo and update |
Hi @llxia , No, this PR adds unit test for the changes @VermaSh has made in the DAA api (eclipse-openj9/openj9#18272) which was merged after 0.44 and we do not plan to backport new API changes in 0.44. Do we need to make any changes in that case? |
No, if we do not plan to backport new API changes in 0.44, then no action is needed. Thanks @r30shah |
Unit tests for eclipse-openj9/openj9#18272