Branch Coverage

hash.c
Criterion Covered Total %
branch 71 84 84.5


line true false branch
36 81 612 new->copyKey = copyKey &&
6 75 new->copyKey = copyKey &&
37 6 0 (keyClass==SQLITE_HASH_STRING || keyClass==SQLITE_HASH_BINARY);
54 103 873 if( pH->ht ) sqliteFree(pH->ht);
57 834 976 while( elem ){
59 729 105 if( pH->copyKey && elem->pKey ){
729 0 if( pH->copyKey && elem->pKey ){
100 941 1895 if( n1!=n2 ) return n2-n1;
110 17589 928 while( nKey-- > 0 ){
116 0 458 if( n1!=n2 ) return n2-n1;
173 0 197 if( new_ht==0 ) return;
174 52 145 if( pH->ht ) sqliteFree(pH->ht);
178 664 197 for(elem=pH->first, pH->first=0; elem; elem = next_elem){
182 190 474 if( x ){
185 52 138 if( x->prev ) x->prev->next = elem;
190 422 52 if( pH->first ) pH->first->prev = elem;
213 4110 153 if( pH->ht ){
217 3294 2195 while( count-- && elem ){
3294 0 while( count-- && elem ){
218 1915 1379 if( (*xCompare)(elem->pKey,elem->nKey,pKey,nKey)==0 ){
235 116 197 if( elem->prev ){
240 213 100 if( elem->next ){
243 311 2 if( pH->ht[h].chain==elem ){
247 253 60 if( pH->ht[h].count<=0 ){
250 0 313 if( pH->copyKey && elem->pKey ){
0 0 if( pH->copyKey && elem->pKey ){
266 2947 0 if( pH==0 || pH->ht==0 ) return 0;
352 2595 if( pH==0 || pH->ht==0 ) return 0;
272 1402 1193 return elem ? elem->data : 0;
304 513 1155 if( elem ){
306 313 200 if( data==0 ){
313 8 1147 if( data==0 ) return 0;
315 0 1147 if( new_elem==0 ) return data;
316 729 418 if( pH->copyKey && pKey!=0 ){
729 0 if( pH->copyKey && pKey!=0 ){
318 0 729 if( new_elem->pKey==0 ){
328 145 1002 if( pH->htsize==0 ) rehash(pH,8);
329 0 1147 if( pH->htsize==0 ){
334 52 1095 if( pH->count > pH->htsize ){
340 419 728 if( elem ){
343 376 43 if( elem->prev ){ elem->prev->next = new_elem; }
349 575 153 if( pH->first ){ pH->first->prev = new_elem; }