Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Added Unit test for Android Issue 782 #49

Merged
merged 1 commit into from
Feb 17, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/androidTest/java/com/couchbase/cbforest/C4DatabaseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,18 @@ public void testCreateMultipleRevisions() throws ForestException {
}

public void testInsertRevisionWithHistory() throws ForestException {
_testInsertRevisionWithHistory(20);
}

public void testInsertRevisionWith512History() throws ForestException {
_testInsertRevisionWithHistory(512);
}

public void testInsertRevisionWith1024History() throws ForestException {
_testInsertRevisionWithHistory(1024);
}

public void _testInsertRevisionWithHistory(int kHistoryCount) throws ForestException {
String kBody2 = "{\"ok\":\"go\"}";
createRev(kDocID, kRevID, kBody.getBytes());
createRev(kDocID, kRev2ID, kBody2.getBytes());
Expand All @@ -236,9 +248,8 @@ public void testInsertRevisionWithHistory() throws ForestException {

// Add 18 revisions; the last two entries in the history repeat the two existing revs:
Random r = new Random();
int kHistoryCount = 20;
List<String> revIDs = new ArrayList<String>();
for(int i = kHistoryCount - 1; i >= 2; i--){
for (int i = kHistoryCount - 1; i >= 2; i--) {
String revID = String.format("%d-%08x", i + 1, r.nextInt());
revIDs.add(revID);
}
Expand Down