Branch Coverage

bpc_refCount.c
Criterion Covered Total %
branch 0 132 0.0


line true false branch
60 0 0 if ( d->key.key == digest ) {
75 0 0 if ( !d ) return -1;
83 0 0 if ( !d ) return -1;
91 0 0 if ( d->key.key == digest ) {
99 0 0 if ( BPC_LogLevel >= 8 ) {
111 0 0 if ( !d ) return -1;
133 0 0 while ( p < out->bufP ) {
135 0 0 if ( nWrite < 0 ) {
136 0 0 if ( errno == EINTR ) continue;
153 0 0 if ( *nRead > 0 ) memmove(buf, *bufPP, *nRead);
158 0 0 } while ( thisRead < 0 && errno == EINTR );
0 0 } while ( thisRead < 0 && errno == EINTR );
159 0 0 if ( thisRead < 0 ) {
163 0 0 if ( BPC_LogLevel >= 8 ) bpc_logMsgf("bpc_poolRef_read_more_data: read %d bytes (nRead = %d, sizeof(buf) = %d)\n", thisRead, *nRead, bufSize);
165 0 0 } while ( thisRead > 0 && *nRead < sizeof(buf) );
0 0 } while ( thisRead > 0 && *nRead < sizeof(buf) );
181 0 0 if ( bufP < bufLast ) {
186 0 0 while ( bufP < bufLast && (c & 0x80) ) {
0 0 while ( bufP < bufLast && (c & 0x80) ) {
192 0 0 if ( negative ) result = -result;
207 0 0 if ( value < 0 ) {
211 0 0 if ( bufP < bufLast ) {
214 0 0 if ( value ) c |= 0x80;
217 0 0 while ( value && bufP < bufLast ) {
0 0 while ( value && bufP < bufLast ) {
220 0 0 if ( value ) c |= 0x80;
228 0 0 if ( out->bufP > out->buf + sizeof(out->buf) - BPC_DIGEST_LEN_MAX - 16 ) write_file_flush(out);
245 0 0 if ( out.fd < 0 ) {
252 0 0 if ( (p = strrchr(dir, '/')) ) {
257 0 0 if ( out.fd < 0 ) {
275 0 0 if ( out.bufP > out.buf ) write_file_flush(&out);
276 0 0 if ( close(out.fd) < 0 ) {
297 0 0 if ( fd < 0 ) {
301 0 0 if ( bpc_poolRef_read_more_data(fd, buf, sizeof(buf), &nRead, &bufP, fileName) < 0 ) {
308 0 0 if ( magic != BPC_POOL_REF_MAGIC ) {
314 0 0 if ( BPC_LogLevel >= 4 ) bpc_logMsgf("bpc_poolRefFileRead: got %d entries (nRead = %d)\n", entryCnt, nRead);
320 0 0 for ( i = 0 ; i < entryCnt ; i++ ) {
323 0 0 if ( nRead == sizeof(buf) && bufP > buf + nRead - 64
0 0 if ( nRead == sizeof(buf) && bufP > buf + nRead - 64
324 0 0 && bpc_poolRef_read_more_data(fd, buf, sizeof(buf), &nRead, &bufP, fileName) < 0 ) {
329 0 0 if ( digest.len > (int)sizeof(digest.digest) ) digest.len = sizeof(digest.digest);
334 0 0 if ( BPC_LogLevel >= 7 ) bpc_logMsgf("bpc_poolRefFileRead: entry %d: digest len = %d, digest = 0x%02x%02x%02x...., count = %d\n",
339 0 0 if ( digestInfo->key.key == digest.digest ) {
367 0 0 if ( (fd = open(fileName, O_CREAT | O_WRONLY, 0660)) < 0 ) {
386 0 0 if ( snprintf(info->targetDir, sizeof(info->targetDir), "%s", hostDir)
408 0 0 if ( !info ) info = &DeltaInfoOld; /* backward compatibility */
409 0 0 if ( !info->refCnt[0].initDone ) return 1;
410 0 0 for ( compress = 0 ; compress < 2 ; compress++ ) {
413 0 0 if ( entryCnt == 0 ) continue;
416 0 0 if ( snprintf(tempFileName, sizeof(tempFileName), "%s/refCnt/tpoolCntDelta_%d_%d_%d_%d",
421 0 0 if ( (fd = open(tempFileName, O_RDONLY, 0666)) >= 0 ) {
425 0 0 } while ( fd >= 0 );
429 0 0 if ( snprintf(finalFileName, sizeof(finalFileName), "%s/refCnt/poolCntDelta_%d_%d_%d_%d",
435 0 0 if ( errorCnt ) {
439 0 0 if ( rename(tempFileName, finalFileName) != 0 ) {
444 0 0 if ( !errorCnt ) {
449 0 0 if ( errorCnt ) {
462 0 0 if ( !info ) info = &DeltaInfoOld; /* backward compatibility */
463 0 0 if ( !digest || digest->len == 0 ) return;
0 0 if ( !digest || digest->len == 0 ) return;
464 0 0 if ( !info->refCnt[0].initDone ) return;
467 0 0 if ( digestInfo->key.key == digest->digest ) {
475 0 0 if ( BPC_LogLevel >= 8 ) {
481 0 0 if ( bpc_hashtable_entryCount(&info->refCnt[compress ? 1 : 0].ht) > (1 << 20) ) {
488 0 0 if ( !info ) info = &DeltaInfoOld; /* backward compatibility */
489 0 0 if ( !info->refCnt[0].initDone ) return;