diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2014-11-10 12:32:10 +0100 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2014-11-10 12:32:10 +0100 |
commit | d2ee409530405d0004787ca734455f6679904a56 (patch) | |
tree | 6a0182c4aac3163fe76d0c35e67e6d598a1401c6 /app | |
parent | c49db40ebe75329e1e94885fe2467f7588e8b6ce (diff) | |
download | AntennaPod-d2ee409530405d0004787ca734455f6679904a56.zip |
Bugfix: Playbackhistory had wrong sort order
fixes #540
Diffstat (limited to 'app')
-rw-r--r-- | app/src/androidTest/java/de/test/antennapod/storage/DBReaderTest.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/app/src/androidTest/java/de/test/antennapod/storage/DBReaderTest.java b/app/src/androidTest/java/de/test/antennapod/storage/DBReaderTest.java index 63286d11d..33f7fb350 100644 --- a/app/src/androidTest/java/de/test/antennapod/storage/DBReaderTest.java +++ b/app/src/androidTest/java/de/test/antennapod/storage/DBReaderTest.java @@ -325,8 +325,9 @@ public class DBReaderTest extends InstrumentationTestCase { public void testGetPlaybackHistory() { final Context context = getInstrumentation().getTargetContext(); - final int numItems = 10; - final int playedItems = 5; + final int numItems = (DBReader.PLAYBACK_HISTORY_SIZE+1) * 2; + final int playedItems = DBReader.PLAYBACK_HISTORY_SIZE + 1; + final int numReturnedItems = Math.min(playedItems, DBReader.PLAYBACK_HISTORY_SIZE); final int numFeeds = 1; Feed feed = DBTestUtils.saveFeedlist(context, numFeeds, numItems, true).get(0); @@ -344,8 +345,8 @@ public class DBReaderTest extends InstrumentationTestCase { List<FeedItem> saved = DBReader.getPlaybackHistory(context); assertNotNull(saved); - assertEquals("Wrong size: ", playedItems, saved.size()); - for (int i = 0; i < playedItems; i++) { + assertEquals("Wrong size: ", numReturnedItems, saved.size()); + for (int i = 0; i < numReturnedItems; i++) { FeedItem item = saved.get(i); assertNotNull(item.getMedia().getPlaybackCompletionDate()); assertEquals("Wrong sort order: ", item.getId(), ids[i]); |