LCOV - code coverage report
Current view: top level - app/test - test_version.c (source / functions) Hit Total Coverage
Test: Code coverage Lines: 6 7 85.7 %
Date: 2025-03-01 20:23:48 Functions: 2 2 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 3 6 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                 :            : #include <string.h>
       7                 :            : #include <stdint.h>
       8                 :            : 
       9                 :            : #include <rte_common.h>
      10                 :            : #include <rte_version.h>
      11                 :            : 
      12                 :            : #include "test.h"
      13                 :            : 
      14                 :            : 
      15                 :            : static int
      16                 :          1 : test_version(void)
      17                 :            : {
      18                 :          1 :         const char *version = rte_version();
      19         [ +  - ]:          1 :         if (version == NULL)
      20                 :            :                 return -1;
      21                 :            :         printf("Version string: '%s'\n", version);
      22         [ +  - ]:          1 :         if (*version == '\0' ||
      23         [ -  + ]:          1 :                         strncmp(version, RTE_VER_PREFIX, sizeof(RTE_VER_PREFIX)-1) != 0)
      24                 :          0 :                 return -1;
      25                 :            :         return 0;
      26                 :            : }
      27                 :            : 
      28                 :        252 : REGISTER_FAST_TEST(version_autotest, true, true, test_version);

Generated by: LCOV version 1.14