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

Commit

Permalink
Merge pull request #49 from couchbaselabs/feature/issue_782_forestdb_…
Browse files Browse the repository at this point in the history
…pullrepl_crash

Added Unit test for Android Issue 782
  • Loading branch information
Hideki Itakura committed Feb 17, 2016
2 parents ce28c5d + d5b37be commit 4009ccc
Showing 1 changed file with 13 additions and 2 deletions.
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

0 comments on commit 4009ccc

Please sign in to comment.