Coverage Report

Created: 2026-08-17 06:12

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/open5gs/lib/sbi/openapi/model/protection_result.c
Line
Count
Source
1
2
#include <stdlib.h>
3
#include <string.h>
4
#include <stdio.h>
5
#include "protection_result.h"
6
7
char* OpenAPI_protection_result_ToString(OpenAPI_protection_result_e protection_result)
8
0
{
9
0
    const char *protection_resultArray[] =  { "NULL", "PERFORMED", "NOT_PERFORMED" };
10
0
    size_t sizeofArray = sizeof(protection_resultArray) / sizeof(protection_resultArray[0]);
11
0
    if (protection_result < sizeofArray)
12
0
        return (char *)protection_resultArray[protection_result];
13
0
    else
14
0
        return (char *)"Unknown";
15
0
}
16
17
OpenAPI_protection_result_e OpenAPI_protection_result_FromString(char* protection_result)
18
0
{
19
0
    int stringToReturn = 0;
20
0
    const char *protection_resultArray[] =  { "NULL", "PERFORMED", "NOT_PERFORMED" };
21
0
    size_t sizeofArray = sizeof(protection_resultArray) / sizeof(protection_resultArray[0]);
22
0
    while (stringToReturn < sizeofArray) {
23
0
        if (strcmp(protection_result, protection_resultArray[stringToReturn]) == 0) {
24
0
            return stringToReturn;
25
0
        }
26
0
        stringToReturn++;
27
0
    }
28
0
    return 0;
29
0
}
30