Branch Coverage

lib/SPVM/Builder/src/spvm_hash.c
Criterion Covered Total %
branch 96 130 73.8


line true false branch
13 0 523144 assert(table_capacity >= 0);
17 3662 519482 if (memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP) {
20 519482 0 else if (memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_PERMANENT) {
28 363653 159491 if (table_capacity == 0) {
36 3662 519482 if (memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP) {
39 519482 0 else if (memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_PERMANENT) {
51 3662 519482 if (memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP) {
54 519482 0 else if (memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_PERMANENT) {
64 3662 519482 if (memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP) {
67 519482 0 else if (memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_PERMANENT) {
94 0 1875076 assert(hash);
95 0 1875076 assert(key);
96 0 1875076 assert(length >= 0);
99 100647 1774429 if (hash->entries_length > hash->table_capacity * 0.75) {
115 0 18399878 assert(hash);
116 0 18399878 assert(length >= 0);
122 16346547 2053331 if (hash->table[table_index] != -1) {
126 0 23406319 assert(entry_index >= -1);
127 20533433 2872886 if (entry_index != -1) {
131 130740 20402693 if (length == 0 && key_length == 0) {
127617 3123 if (length == 0 && key_length == 0) {
134 15737764 4668052 else if (key_length == length && memcmp(key, &hash->key_buffer[hash->entries[entry_index].key_index + sizeof(int32_t)], length) == 0) {
15399375 338389 else if (key_length == length && memcmp(key, &hash->key_buffer[hash->entries[entry_index].key_index + sizeof(int32_t)], length) == 0) {
138 15526992 5006441 if (match) {
143 819555 4186886 if (hash->entries[entry_index].next_index == -1) {
161 0 3660 assert(hash);
163 3660 0 if (hash->memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP) {
169 0 0 else if (hash->memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_PERMANENT) {
181 0 3454359 assert(hash);
185 0 3454359 assert(entries_length >= 0);
189 474179 2980180 if (entries_length >= entries_capacity) {
193 2 474177 if (hash->memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP) {
196 474177 0 else if (hash->memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_PERMANENT) {
204 2 474177 if (hash->memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP) {
207 0 474177 else if (hash->memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_PERMANENT) {
224 0 3454359 assert(hash);
228 0 3454359 assert(key_buffer_length >= 0);
232 563529 2890830 if (key_buffer_length + length + (int32_t)sizeof(int32_t) >= key_buffer_capacity) {
236 19 563510 if (hash->memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP) {
239 563510 0 else if (hash->memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_PERMANENT) {
247 19 563510 if (hash->memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP) {
250 0 563510 else if (hash->memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_PERMANENT) {
265 0 3454359 assert(hash);
266 0 3454359 assert(key);
294 0 100647 assert(hash);
295 0 100647 assert(new_table_capacity > 0);
305 1633874 100647 for (i = 0; i < hash->entries_length; i++) {
317 2 100645 if (hash->memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP) {
322 0 100645 else if (hash->memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_PERMANENT) {
339 2 100645 if (hash->memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP) {
342 0 100645 else if (hash->memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_PERMANENT) {
352 0 3508950 assert(hash);
353 0 3508950 assert(key);
354 0 3508950 assert(length >= 0);
359 0 3508950 assert(hash->table[table_index] >= -1);
361 838723 2670227 if (hash->table[table_index] != -1) {
368 9189 1005695 if (key_length == 0 && length == 0) {
18 9171 if (key_length == 0 && length == 0) {
371 137032 877834 else if (key_length == length && memcmp(key, &hash->key_buffer[hash->entries[entry_index].key_index + sizeof(int32_t)], length) == 0) {
54573 82459 else if (key_length == length && memcmp(key, &hash->key_buffer[hash->entries[entry_index].key_index + sizeof(int32_t)], length) == 0) {
375 54591 960293 if (match) {
380 176161 784132 if (hash->entries[entry_index].next_index != -1) {
399 0 21908828 assert(len >= 0);
403 222285290 21908828 while (len--) {
407 6705385 15203443 if (hash < 0) {