Commit 4849b3e3 by ibaker Committed by Christos Tsilopoulos

Remove zero-byte resource from FileDataSourceContractTest

This was added due to a misunderstanding - we're more interested in
testing the edge case of trying to read the last zero bytes of a
non-zero-byte resource.

In a future change I want to be able test reading a subrange, so each
TestResource will need to be at least N bytes long.

PiperOrigin-RevId: 347980843
parent 8da4eaa3
......@@ -24,7 +24,6 @@ import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import okhttp3.internal.Util;
import org.junit.Before;
import org.junit.Rule;
import org.junit.rules.TemporaryFolder;
......@@ -39,12 +38,10 @@ public class FileDataSourceContractTest extends DataSourceContractTest {
@Rule public final TemporaryFolder tempFolder = new TemporaryFolder();
private Uri simpleUri;
private Uri zeroBytesUri;
@Before
public void writeFiles() throws Exception {
simpleUri = writeFile(DATA);
zeroBytesUri = writeFile(Util.EMPTY_BYTE_ARRAY);
}
@Override
......@@ -54,11 +51,6 @@ public class FileDataSourceContractTest extends DataSourceContractTest {
.setName("simple")
.setUri(simpleUri)
.setExpectedBytes(DATA)
.build(),
new TestResource.Builder()
.setName("zero-bytes")
.setUri(zeroBytesUri)
.setExpectedBytes(Util.EMPTY_BYTE_ARRAY)
.build());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment