Tests: getAllDocuments returns a wrong number of docs.
Tests: getAllDocuments returns a wrong number of docs.

getAllDocuments depends on
TD_Dtabase:getDocsWithIDs:options:. This method gets all
the revisions in the database and returns the winning
revisions. However, it applies a LIMIT to the SELECT
equal to current number of documents, not the number of
revisions.

What we are doing in these tests is to create two
conflicting revisions per each document and then we
create an odd number of documents. For example, we
create 3 documents with 6 conflicting revisions. When
getDocsWithIDs:options: reads the revisions, it gets 3
revisions, 2 of them are for the same document
but the last one is for the next document. Thefore it
returns 2 documents. The next time it reads the second
revision for the document mentioned before and the 2
revisions for the last document. It returns again 2
documents, in total we get 4 documents intead of 3.

Another variant is to create an odd number of documents
plus one non-conflicting document. For example, 3
conflicting documents (2 revisions per each document)
plus 1 non-conflicting document (with one revision).
In this case, getDocsWithIDs:options: reads the
non-conflicting document, 2 revisions for 1 document
and 1 revision for another document.

jhs/CDTDatastore,cloudant/CDTDatastore,phatblat/CDTDatastore,phatblat/CDTDatastore,cloudant/CDTDatastore,jhs/CDTDatastore,cloudant/CDTDatastore,phatblat/CDTDatastore,jhs/CDTDatastore,cloudant/CDTDatastore