forked from upstream-mirrors/OpenTracks
self-review
This commit is contained in:
@@ -175,7 +175,6 @@ public class DatabaseImporter {
|
|||||||
}
|
}
|
||||||
case ContentTypeIds.BLOB_TYPE_ID: {
|
case ContentTypeIds.BLOB_TYPE_ID: {
|
||||||
int blobLength = reader.readInt();
|
int blobLength = reader.readInt();
|
||||||
System.err.println("read blob length " + blobLength);
|
|
||||||
if (blobLength != 0) {
|
if (blobLength != 0) {
|
||||||
byte[] blob = new byte[blobLength];
|
byte[] blob = new byte[blobLength];
|
||||||
int readBytes = reader.read(blob, 0, blobLength);
|
int readBytes = reader.read(blob, 0, blobLength);
|
||||||
|
|||||||
+10
-10
@@ -204,16 +204,6 @@ public class DatabaseDumperTest extends TestCase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private String readBlob(InputStream reader, int length) throws Exception {
|
|
||||||
if (length == 0) {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
byte[] blob = new byte[length];
|
|
||||||
assertEquals(length, reader.read(blob));
|
|
||||||
return new String(blob);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testFewerRows() throws Exception {
|
public void testFewerRows() throws Exception {
|
||||||
// Dump only the first two rows
|
// Dump only the first two rows
|
||||||
DatabaseDumper dumper = new DatabaseDumper(COLUMN_NAMES, COLUMN_TYPES, false);
|
DatabaseDumper dumper = new DatabaseDumper(COLUMN_NAMES, COLUMN_TYPES, false);
|
||||||
@@ -267,4 +257,14 @@ public class DatabaseDumperTest extends TestCase {
|
|||||||
assertEquals(COLUMN_TYPES[i], reader.readByte());
|
assertEquals(COLUMN_TYPES[i], reader.readByte());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String readBlob(InputStream reader, int length) throws Exception {
|
||||||
|
if (length == 0) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
byte[] blob = new byte[length];
|
||||||
|
assertEquals(length, reader.read(blob));
|
||||||
|
return new String(blob);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user