File tree 3 files changed +5
-7
lines changed
src/test/java/org/scijava/io/handle
3 files changed +5
-7
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
}
@@ -127,7 +127,6 @@ public void testLargeRead() throws Exception {
127
127
}
128
128
129
129
@ Test
130
- @ Ignore
131
130
@ Override
132
131
public void testWriting () throws IOException {
133
132
// nothing to do here
Original file line number Diff line number Diff line change @@ -64,14 +64,12 @@ public DataHandle<? extends Location> createHandle() {
64
64
}
65
65
66
66
@ Test
67
- @ Ignore
68
67
@ Override
69
68
public void testReading () throws IOException {
70
69
// nothing to do
71
70
}
72
71
73
72
@ Test
74
- @ Ignore
75
73
@ Override
76
74
public void checkSkip () throws IOException {
77
75
// nothing to do
You can’t perform that action at this time.
0 commit comments