LCOV - code coverage report
Current view: top level - app/test-eventdev - evt_test.c (source / functions) Hit Total Coverage
Test: Code coverage Lines: 0 12 0.0 %
Date: 2024-12-01 18:57:19 Functions: 0 3 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /* SPDX-License-Identifier: BSD-3-Clause
       2                 :            :  * Copyright(c) 2017 Cavium, Inc
       3                 :            :  */
       4                 :            : 
       5                 :            : #include <stdio.h>
       6                 :            : #include <unistd.h>
       7                 :            : #include <sys/queue.h>
       8                 :            : 
       9                 :            : #include "evt_test.h"
      10                 :            : 
      11                 :            : static STAILQ_HEAD(, evt_test_entry) head = STAILQ_HEAD_INITIALIZER(head);
      12                 :            : 
      13                 :            : void
      14                 :          0 : evt_test_register(struct evt_test_entry *entry)
      15                 :            : {
      16                 :          0 :         STAILQ_INSERT_TAIL(&head, entry, next);
      17                 :          0 : }
      18                 :            : 
      19                 :            : struct evt_test*
      20                 :          0 : evt_test_get(const char *name)
      21                 :            : {
      22                 :            :         struct evt_test_entry *entry;
      23                 :            : 
      24                 :          0 :         if (!name)
      25                 :            :                 return NULL;
      26                 :            : 
      27                 :          0 :         STAILQ_FOREACH(entry, &head, next)
      28                 :          0 :                 if (!strncmp(entry->test.name, name, strlen(name)))
      29                 :          0 :                         return &entry->test;
      30                 :            : 
      31                 :            :         return NULL;
      32                 :            : }
      33                 :            : 
      34                 :            : void
      35                 :          0 : evt_test_dump_names(void)
      36                 :            : {
      37                 :            :         struct evt_test_entry *entry;
      38                 :            : 
      39                 :          0 :         STAILQ_FOREACH(entry, &head, next)
      40                 :          0 :                 if (entry->test.name)
      41                 :            :                         printf("\t %s\n", entry->test.name);
      42                 :          0 : }

Generated by: LCOV version 1.14