LCOV - code coverage report
Current view: top level - ccan/array_size/test - run.c (source / functions) Hit Total Coverage
Test: skiboot.info Lines: 6 6 100.0 %
Date: 2024-01-02 21:04:04 Functions: 1 1 100.0 %
Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : #include <ccan/array_size/array_size.h>
       2                 :            : #include <ccan/tap/tap.h>
       3                 :            : 
       4                 :            : static char array1[1];
       5                 :            : static int array2[2];
       6                 :            : static unsigned long array3[3][5];
       7                 :            : struct foo {
       8                 :            :         unsigned int a, b;
       9                 :            :         char string[100];
      10                 :            : };
      11                 :            : static struct foo array4[4];
      12                 :            : 
      13                 :            : /* Make sure they can be used in initializers. */
      14                 :            : static int array1_size = ARRAY_SIZE(array1);
      15                 :            : static int array2_size = ARRAY_SIZE(array2);
      16                 :            : static int array3_size = ARRAY_SIZE(array3);
      17                 :            : static int array4_size = ARRAY_SIZE(array4);
      18                 :            : 
      19                 :          2 : int main(void)
      20                 :            : {
      21                 :            :         plan_tests(8);
      22                 :          2 :         ok1(array1_size == 1);
      23                 :          2 :         ok1(array2_size == 2);
      24                 :          2 :         ok1(array3_size == 3);
      25                 :          2 :         ok1(array4_size == 4);
      26                 :            : 
      27                 :            :         ok1(ARRAY_SIZE(array1) == 1);
      28                 :            :         ok1(ARRAY_SIZE(array2) == 2);
      29                 :            :         ok1(ARRAY_SIZE(array3) == 3);
      30                 :            :         ok1(ARRAY_SIZE(array4) == 4);
      31                 :            : 
      32                 :          2 :         return exit_status();
      33                 :            : }

Generated by: LCOV version 1.14