LCOV - code coverage report
Current view: top level - app/test - test_cmdline.c (source / functions) Hit Total Coverage
Test: Code coverage Lines: 22 23 95.7 %
Date: 2025-02-01 18:54:23 Functions: 2 2 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 20 40 50.0 %

           Branch data     Line data    Source code
       1                 :            : /* SPDX-License-Identifier: BSD-3-Clause
       2                 :            :  * Copyright(c) 2010-2014 Intel Corporation
       3                 :            :  */
       4                 :            : 
       5                 :            : #include <stdio.h>
       6                 :            : 
       7                 :            : #include "test.h"
       8                 :            : #include "test_cmdline.h"
       9                 :            : 
      10                 :            : static int
      11                 :          1 : test_cmdline(void)
      12                 :            : {
      13                 :            :         printf("Testind parsing ethernet addresses...\n");
      14         [ +  - ]:          1 :         if (test_parse_etheraddr_valid() < 0)
      15                 :            :                 return -1;
      16         [ +  - ]:          1 :         if (test_parse_etheraddr_invalid_data() < 0)
      17                 :            :                 return -1;
      18         [ +  - ]:          1 :         if (test_parse_etheraddr_invalid_param() < 0)
      19                 :            :                 return -1;
      20                 :            :         printf("Testind parsing port lists...\n");
      21         [ +  - ]:          1 :         if (test_parse_portlist_valid() < 0)
      22                 :            :                 return -1;
      23         [ +  - ]:          1 :         if (test_parse_portlist_invalid_data() < 0)
      24                 :            :                 return -1;
      25         [ +  - ]:          1 :         if (test_parse_portlist_invalid_param() < 0)
      26                 :            :                 return -1;
      27                 :            :         printf("Testind parsing numbers...\n");
      28         [ +  - ]:          1 :         if (test_parse_num_valid() < 0)
      29                 :            :                 return -1;
      30         [ +  - ]:          1 :         if (test_parse_num_invalid_data() < 0)
      31                 :            :                 return -1;
      32         [ +  - ]:          1 :         if (test_parse_num_invalid_param() < 0)
      33                 :            :                 return -1;
      34                 :            :         printf("Testing parsing IP addresses...\n");
      35         [ +  - ]:          1 :         if (test_parse_ipaddr_valid() < 0)
      36                 :            :                 return -1;
      37         [ +  - ]:          1 :         if (test_parse_ipaddr_invalid_data() < 0)
      38                 :            :                 return -1;
      39         [ +  - ]:          1 :         if (test_parse_ipaddr_invalid_param() < 0)
      40                 :            :                 return -1;
      41                 :            :         printf("Testing parsing strings...\n");
      42         [ +  - ]:          1 :         if (test_parse_string_valid() < 0)
      43                 :            :                 return -1;
      44         [ +  - ]:          1 :         if (test_parse_string_invalid_data() < 0)
      45                 :            :                 return -1;
      46         [ +  - ]:          1 :         if (test_parse_string_invalid_param() < 0)
      47                 :            :                 return -1;
      48                 :            :         printf("Testing circular buffer...\n");
      49         [ +  - ]:          1 :         if (test_cirbuf_char() < 0)
      50                 :            :                 return -1;
      51         [ +  - ]:          1 :         if (test_cirbuf_string() < 0)
      52                 :            :                 return -1;
      53         [ +  - ]:          1 :         if (test_cirbuf_align() < 0)
      54                 :            :                 return -1;
      55         [ +  - ]:          1 :         if (test_cirbuf_invalid_param() < 0)
      56                 :            :                 return -1;
      57                 :            :         printf("Testing library functions...\n");
      58         [ -  + ]:          1 :         if (test_cmdline_lib() < 0)
      59                 :          0 :                 return -1;
      60                 :            :         return 0;
      61                 :            : }
      62                 :            : 
      63                 :        252 : REGISTER_FAST_TEST(cmdline_autotest, true, true, test_cmdline);

Generated by: LCOV version 1.14