forked from upstream-mirrors/OpenTracks
Merge heads
This commit is contained in:
+1
-1
@@ -161,7 +161,7 @@ public class CreateAndSendTrackTest extends ActivityInstrumentationTestCase2<Tra
|
||||
if (EndToEndTestUtils.hasActionBar) {
|
||||
// Check the title is Recording.
|
||||
assertTrue(EndToEndTestUtils.SOLO.searchText(activityMyTracks
|
||||
.getString(R.string.icon_recording)));
|
||||
.getString(R.string.generic_recording)));
|
||||
}
|
||||
|
||||
createWaypoint();
|
||||
|
||||
@@ -237,6 +237,34 @@ public class TrackWriterTest extends AndroidTestCase {
|
||||
mocksControl.verify();
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests when a track only contains invalid locations. Make sure an empty
|
||||
* track is written.
|
||||
*/
|
||||
public void testWriteDocument_oneInvalidLocation() throws Exception {
|
||||
writer = new TrackWriterImpl(getContext(), providerUtils, track, formatWriter);
|
||||
|
||||
Location[] locs = { new Location("fake0") };
|
||||
fillLocations(locs);
|
||||
|
||||
// Make location invalid
|
||||
locs[0].setLatitude(100);
|
||||
|
||||
assertEquals(locs.length, providerUtils.bulkInsertTrackPoint(locs, locs.length, TRACK_ID));
|
||||
|
||||
formatWriter.writeHeader();
|
||||
formatWriter.writeBeginTrack(null);
|
||||
formatWriter.writeEndTrack(null);
|
||||
formatWriter.writeFooter();
|
||||
formatWriter.close();
|
||||
|
||||
mocksControl.replay();
|
||||
writer.writeDocument();
|
||||
|
||||
assertTrue(writer.wasSuccess());
|
||||
mocksControl.verify();
|
||||
}
|
||||
|
||||
public void testWriteDocument() throws Exception {
|
||||
writer = new TrackWriterImpl(getContext(), providerUtils, track, formatWriter);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user