Uh oh!
There was an error while loading. Please reload this page.
add-some-Unit-Tests Added some Unit Tests to increase code coverage. - #33
add-some-Unit-Tests Added some Unit Tests to increase code coverage.#33TheRealHaui wants to merge 6 commits into
Conversation
TheRealHaui
commented
Jun 13, 2017
@bodewig |
bodewig
commented
Jun 14, 2017
Fortunately I'm not the only one who could merge this :-) More seriously, it may take a bit of time until I get there, but I will. |
bodewig
commented
Jun 15, 2017
Thanks @TheRealHaui I agree with your comment on Also, the Commons Compress community has decided to not use author tags, I'd have to strip yours before merging the PR. Could you please remove them yourself if you modify this PR? Feel free to add yourself as a contributor to the POM. |
…on in class ChecksumCalculatingInputStreamTest. Test represented a bug/defect which is going to be fixed in a different branch.
…ted" by Stefan Bodewig.
TheRealHaui
commented
Jun 16, 2017
@bodewig Therefore I've made all the changes you requested/proposed. Furthermore I've created a Jira Task for the bespoken bug: https://issues.apache.org/jira/browse/COMPRESS-412 |
TheRealHaui
commented
Jun 16, 2017
Link to the pull request: #35 |
bodewig
commented
Jun 17, 2017
Thanks a lot. |
| xZCompressorOutputStream.write(4590); | ||
| assertEquals(24, byteArrayOutputStream.size()); | ||
| assertEquals("\uFFFD7zXZ\u0000\u0000\u0004\uFFFD\u05B4F\u0002\u0000!\u0001\u0016\u0000\u0000\u0000t/\uFFFD", byteArrayOutputStream.toString()); |
There was a problem hiding this comment.
It's usually not a good idea to convert an arbitrary byte array to a string, as on can't rely on a specific default charset, and you may end up with characters mangled /mapped.
I thinkThat hamcrest has array matchers; if not, assertTrue(Arrays.equals(exp,act)) should be OK.
I can't remember if there's an assertEquals for byte[]
There was a problem hiding this comment.
Thank you for catching this. I've reformulated the test with commit b53ead4 - I think we are not that much interested in the exact bytes created but rather that using write creates a valid XZ output.
JUnit's Assert class contains assertArrayEquals.
TheRealHaui
commented
Jun 20, 2017
@bodewig |
I have added some Unit Tests to increase code coverage and want to contribute them.