File tree 2 files changed +5
-4
lines changed
src/test/java/org/scijava/io/handle
2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ public void testEndianesSettings() throws IOException {
113
113
@ Test
114
114
public void testReading () throws IOException {
115
115
try (final DataHandle <? extends Location > handle = createHandle ()) {
116
- checkBasicReadMethods (handle );
116
+ checkBasicReadMethods (handle , true );
117
117
checkEndiannessReading (handle );
118
118
}
119
119
}
@@ -168,13 +168,14 @@ public void populateData(final OutputStream out) throws IOException {
168
168
* Checks basic byte reading methods.
169
169
*
170
170
* @param handle the handle to test
171
+ * @param lengthKnown whether the length of the handle is know
171
172
* @throws IOException
172
173
*/
173
174
public <L extends Location > void checkBasicReadMethods (
174
- final DataHandle <L > handle ) throws IOException
175
+ final DataHandle <L > handle , boolean lengthKnown ) throws IOException
175
176
{
176
177
assertEquals (0 , handle .offset ());
177
- assertEquals (BYTES .length , handle .length ());
178
+ assertEquals (lengthKnown ? BYTES .length : - 1 , handle .length ());
178
179
assertEquals ("UTF-8" , handle .getEncoding ());
179
180
180
181
// test read()
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ public void testSmallBuffer() throws IOException {
64
64
new ReadBufferDataHandle (handle , 5 ))
65
65
{
66
66
// check with small buffersize
67
- checkBasicReadMethods (bufferedHandle );
67
+ checkBasicReadMethods (bufferedHandle , true );
68
68
checkEndiannessReading (bufferedHandle );
69
69
}
70
70
}
You can’t perform that action at this time.
0 commit comments