Branch Coverage

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


line true false branch
13 0 530498 assert(table_capacity >= 0);
17 3740 526758 if (memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP) {
20 526758 0 else if (memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_PERMANENT) {
28 368751 161747 if (table_capacity == 0) {
36 3740 526758 if (memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP) {
39 526758 0 else if (memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_PERMANENT) {
51 3740 526758 if (memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP) {
54 526758 0 else if (memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_PERMANENT) {
64 3740 526758 if (memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP) {
67 526758 0 else if (memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_PERMANENT) {
94 0 1900518 assert(hash);
95 0 1900518 assert(key);
96 0 1900518 assert(length >= 0);
99 102083 1798435 if (hash->entries_length > hash->table_capacity * 0.75) {
115 0 18637023 assert(hash);
116 0 18637023 assert(length >= 0);
122 16559848 2077175 if (hash->table[table_index] != -1) {
126 0 23758047 assert(entry_index >= -1);
127 20846893 2911154 if (entry_index != -1) {
131 132712 20714181 if (length == 0 && key_length == 0) {
129527 3185 if (length == 0 && key_length == 0) {
134 15939095 4778271 else if (key_length == length && memcmp(key, &hash->key_buffer[hash->entries[entry_index].key_index + sizeof(int32_t)], length) == 0) {
15596342 342753 else if (key_length == length && memcmp(key, &hash->key_buffer[hash->entries[entry_index].key_index + sizeof(int32_t)], length) == 0) {
138 15725869 5121024 if (match) {
143 833979 4287045 if (hash->entries[entry_index].next_index == -1) {
161 0 3738 assert(hash);
163 3738 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 3502019 assert(hash);
185 0 3502019 assert(entries_length >= 0);
189 481079 3020940 if (entries_length >= entries_capacity) {
193 2 481077 if (hash->memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP) {
196 481077 0 else if (hash->memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_PERMANENT) {
204 2 481077 if (hash->memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP) {
207 0 481077 else if (hash->memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_PERMANENT) {
224 0 3502019 assert(hash);
228 0 3502019 assert(key_buffer_length >= 0);
232 571682 2930337 if (key_buffer_length + length + (int32_t)sizeof(int32_t) >= key_buffer_capacity) {
236 19 571663 if (hash->memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP) {
239 571663 0 else if (hash->memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_PERMANENT) {
247 19 571663 if (hash->memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP) {
250 0 571663 else if (hash->memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_PERMANENT) {
265 0 3502019 assert(hash);
266 0 3502019 assert(key);
294 0 102083 assert(hash);
295 0 102083 assert(new_table_capacity > 0);
305 1656092 102083 for (i = 0; i < hash->entries_length; i++) {
317 2 102081 if (hash->memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP) {
322 0 102081 else if (hash->memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_PERMANENT) {
339 2 102081 if (hash->memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP) {
342 0 102081 else if (hash->memory_block_type == SPVM_ALLOCATOR_C_ALLOC_TYPE_PERMANENT) {
352 0 3556610 assert(hash);
353 0 3556610 assert(key);
354 0 3556610 assert(length >= 0);
359 0 3556610 assert(hash->table[table_index] >= -1);
361 852473 2704137 if (hash->table[table_index] != -1) {
368 9312 1021827 if (key_length == 0 && length == 0) {
18 9294 if (key_length == 0 && length == 0) {
371 138058 893063 else if (key_length == length && memcmp(key, &hash->key_buffer[hash->entries[entry_index].key_index + sizeof(int32_t)], length) == 0) {
54573 83485 else if (key_length == length && memcmp(key, &hash->key_buffer[hash->entries[entry_index].key_index + sizeof(int32_t)], length) == 0) {
375 54591 976548 if (match) {
380 178666 797882 if (hash->entries[entry_index].next_index != -1) {
399 0 22193633 assert(len >= 0);
403 225059125 22193633 while (len--) {
407 6864154 15329479 if (hash < 0) {