-
Notifications
You must be signed in to change notification settings - Fork 11.6k
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
fix BitsArray upper boundary validate bug #8664
base: develop
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #8664 +/- ##
=============================================
+ Coverage 47.44% 48.79% +1.34%
- Complexity 11515 12654 +1139
=============================================
Files 1277 1282 +5
Lines 89442 96028 +6586
Branches 11502 13257 +1755
=============================================
+ Hits 42436 46854 +4418
- Misses 41801 43690 +1889
- Partials 5205 5484 +279
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@Test(expected = IllegalArgumentException.class) | ||
public void testByteBoundaryOverflow() { | ||
BitsArray bitsArray = BitsArray.create(16); | ||
assertThat(bitsArray.byteLength() ).isEqualTo(2); |
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.
这里多了一个空格,style插件会报错
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.
好的~已经处理
@chi3316 为啥集成测试失败了~我在本地看是没问题的 |
ci环境资源比较紧张,有时候会遇到一些测试偶发性失败的问题。可以试着改动几个空行再提交来重新触发一下ci |
@@ -195,7 +195,7 @@ protected int position(int bitPos) { | |||
|
|||
protected void checkBytePosition(int bytePos, BitsArray bitsArray) { | |||
checkInitialized(bitsArray); | |||
if (bytePos > bitsArray.byteLength()) { | |||
if (bytePos >= bitsArray.byteLength()) { | |||
throw new IllegalArgumentException("BytePos is greater than " + bytes.length); |
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.
fix error message
fix BitsArray upper boundary validate bug