LCOV - code coverage report
Current view: top level - seahorn/jobs/hash_table_clear - aws_hash_table_clear_harness.c (source / functions) Hit Total Coverage
Test: all_fuzz.info Lines: 17 17 100.0 %
Date: 2021-04-23 16:28:21 Functions: 1 1 100.0 %

          Line data    Source code
       1             : #include <aws/common/hash_table.h>
       2             : #include <aws/common/private/hash_table_impl.h>
       3             : 
       4             : #include <seahorn/seahorn.h>
       5             : 
       6             : #include <config.h>
       7             : #include <hash_table_helper.h>
       8             : #include <proof_allocators.h>
       9             : #include <utils.h>
      10             : 
      11      150000 : int main(void) {
      12      150000 :   struct aws_hash_table map;
      13      150000 :   initialize_bounded_aws_hash_table(&map, MAX_TABLE_SIZE);
      14      150000 :   assume(aws_hash_table_is_valid(&map));
      15      150000 :   ensure_hash_table_has_valid_destroy_functions(&map);
      16      150000 : 
      17      150000 :   size_t empty_slot_idx;
      18      150000 :   assume(aws_hash_table_has_an_empty_slot(&map, &empty_slot_idx));
      19      150000 :   aws_hash_table_clear(&map);
      20      150000 :   sassert(aws_hash_table_is_valid(&map));
      21      150000 :   sassert(map.p_impl->entry_count == 0);
      22      150000 :   struct hash_table_state *impl = map.p_impl;
      23      150000 :   // check that the bytes in slots were zeroed
      24      150000 :   assert_all_zeroes((uint8_t *)&impl->slots[0],
      25      150000 :                     impl->size * sizeof(impl->slots[0]));
      26      150000 :   return 0;
      27      150000 : }

Generated by: LCOV version 1.13