aboutsummaryrefslogtreecommitdiff
path: root/src/bitvec.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2009-04-01 23:49:04 +0000
committerdrh <drh@noemail.net>2009-04-01 23:49:04 +0000
commit64f798dddc6d55ebe17b5a251e9b80cdaac1a851 (patch)
tree1d73d6ca4c0b6e930f2c50691b668cd52ddf49b2 /src/bitvec.c
parent2206a2b6abfeb90a0e1e02854f3f8d1997ef881a (diff)
downloadsqlite-64f798dddc6d55ebe17b5a251e9b80cdaac1a851.tar.gz
sqlite-64f798dddc6d55ebe17b5a251e9b80cdaac1a851.zip
Increase test coverage of bitvec.c slightly. Fix the line length on a
comment in bitvec.c. (CVS 6432) FossilOrigin-Name: ca3aa3ba7d751be1c2bcd100a203cd9c794a6cef
Diffstat (limited to 'src/bitvec.c')
-rw-r--r--src/bitvec.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/bitvec.c b/src/bitvec.c
index 39513ffda..b6420a7f2 100644
--- a/src/bitvec.c
+++ b/src/bitvec.c
@@ -34,7 +34,7 @@
** start of a transaction, and is thus usually less than a few thousand,
** but can be as large as 2 billion for a really big database.
**
-** @(#) $Id: bitvec.c,v 1.13 2009/01/20 17:06:27 danielk1977 Exp $
+** @(#) $Id: bitvec.c,v 1.14 2009/04/01 23:49:04 drh Exp $
*/
#include "sqliteInt.h"
@@ -94,8 +94,9 @@
*/
struct Bitvec {
u32 iSize; /* Maximum bit index. Max iSize is 4,294,967,296. */
- u32 nSet; /* Number of bits that are set - only valid for aHash element */
- /* Max nSet is BITVEC_NINT. For BITVEC_SZ of 512, this would be 125. */
+ u32 nSet; /* Number of bits that are set - only valid for aHash
+ ** element. Max is BITVEC_NINT. For BITVEC_SZ of 512,
+ ** this would be 125. */
u32 iDivisor; /* Number of bits handled by each apSub[] entry. */
/* Should >=0 for apSub element. */
/* Max iDivisor is max(u32) / BITVEC_NPTR + 1. */
@@ -377,7 +378,8 @@ int sqlite3BitvecBuiltinTest(int sz, int *aOp){
** is found.
*/
rc = sqlite3BitvecTest(0,0) + sqlite3BitvecTest(pBitvec, sz+1)
- + sqlite3BitvecTest(pBitvec, 0);
+ + sqlite3BitvecTest(pBitvec, 0)
+ + (sqlite3BitvecSize(pBitvec) - sz);
for(i=1; i<=sz; i++){
if( (TESTBIT(pV,i))!=sqlite3BitvecTest(pBitvec,i) ){
rc = i;