Coverage Report

Created: 2026-06-30 06:14

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