LCOV - code coverage report
Current view: top level - src/tests - sizes.c (source / functions) Hit Total Coverage
Test: passgen-test.info Lines: 12 12 100.0 %
Date: 2024-11-29 06:05:05 Functions: 6 6 100.0 %

          Line data    Source code
       1             : #include "passgen/container/array.h"
       2             : #include "passgen/container/hashmap.h"
       3             : #include "passgen/container/stack.h"
       4             : #include "passgen/markov.h"
       5             : #include "passgen/parser/parser.h"
       6             : #include "passgen/pattern/group.h"
       7             : #include "passgen/pattern/literal.h"
       8             : #include "passgen/pattern/pattern.h"
       9             : #include "passgen/pattern/range.h"
      10             : #include "passgen/pattern/repeat.h"
      11             : #include "passgen/pattern/segment.h"
      12             : #include "passgen/pattern/segment_item.h"
      13             : #include "passgen/pattern/set.h"
      14             : #include "passgen/pattern/special.h"
      15             : #include "passgen/wordlist.h"
      16             : #include "tests.h"
      17             : #include <string.h>
      18             : 
      19           1 : test_result test_sizes_builtin(void) {
      20             :     assert_eq(sizeof(void *), 8);
      21             :     assert_eq(sizeof(size_t), 8);
      22           1 :     return test_ok;
      23             : }
      24             : 
      25           1 : test_result test_sizes_parser(void) {
      26             :     assert_eq(sizeof(passgen_parser), 48);
      27             :     assert_eq(sizeof(passgen_parser_state), 24);
      28           1 :     return test_ok;
      29             : }
      30             : 
      31           1 : test_result test_sizes_tokenizer(void) {
      32             :     assert_eq(sizeof(passgen_token), 24);
      33             :     assert_eq(sizeof(passgen_token_parser), 40);
      34           1 :     return test_ok;
      35             : }
      36             : 
      37           1 : test_result test_sizes_pattern(void) {
      38             :     assert_eq(sizeof(passgen_pattern), 40);
      39             :     assert_eq(sizeof(passgen_pattern_repeat), 16);
      40             :     assert_eq(sizeof(passgen_pattern_group), 40);
      41             :     assert_eq(sizeof(passgen_pattern_segment), 40);
      42             :     assert_eq(sizeof(passgen_pattern_item), 72);
      43             :     assert_eq(sizeof(passgen_pattern_range), 16);
      44             :     assert_eq(sizeof(passgen_pattern_literal), 32);
      45             :     assert_eq(sizeof(passgen_pattern_set), 40);
      46             :     assert_eq(sizeof(passgen_pattern_special), 24);
      47           1 :     return test_ok;
      48             : }
      49             : 
      50           1 : test_result test_sizes_wordlist(void) {
      51             :     assert_eq(sizeof(passgen_markov), 24);
      52             :     assert_eq(sizeof(passgen_markov_leaf), 16);
      53             :     assert_eq(sizeof(passgen_markov_node), 8);
      54             :     assert_eq(sizeof(passgen_wordlist), 72);
      55           1 :     return test_ok;
      56             : }
      57             : 
      58           1 : test_result test_sizes_util(void) {
      59             :     assert_eq(sizeof(passgen_hashmap), 40);
      60             :     assert_eq(sizeof(passgen_hashmap_context), 32);
      61             :     assert_eq(sizeof(passgen_hashmap_entry), 16);
      62             :     assert_eq(sizeof(passgen_stack), 32);
      63             :     assert_eq(sizeof(passgen_random), 1024 + 4 * 8);
      64             :     assert_eq(sizeof(passgen_array), 24);
      65           1 :     return test_ok;
      66             : }

Generated by: LCOV version 1.14