forked from acouzens/open5gs
test: for checking issues #736
This commit is contained in:
parent
235a041b8d
commit
79b0552bb0
|
@ -233,7 +233,7 @@ uint64_t ogs_sbi_bitrate_from_string(char *str)
|
|||
|
||||
#define MAX_TIMESTR_LEN 128
|
||||
|
||||
static int ogs_strftimezone(char *str, size_t size, int tm_gmtoff)
|
||||
int ogs_strftimezone(char *str, size_t size, int tm_gmtoff)
|
||||
{
|
||||
uint8_t off_sign;
|
||||
int off;
|
||||
|
|
|
@ -46,6 +46,7 @@ ogs_sockaddr_t *ogs_sbi_getaddr_from_uri(char *uri);
|
|||
char *ogs_sbi_bitrate_to_string(uint64_t bitrate, int unit);
|
||||
uint64_t ogs_sbi_bitrate_from_string(char *str);
|
||||
|
||||
int ogs_strftimezone(char *str, size_t size, int tm_gmtoff);
|
||||
char *ogs_sbi_localtime_string(ogs_time_t time);
|
||||
char *ogs_sbi_gmtime_string(ogs_time_t time);
|
||||
char *ogs_sbi_timezone_string(int tm_offset);
|
||||
|
|
|
@ -469,6 +469,13 @@ static void sbi_message_test4(abts_case *tc, void *data)
|
|||
|
||||
static void sbi_message_test5(abts_case *tc, void *data)
|
||||
{
|
||||
struct tm tm;
|
||||
|
||||
#define MAX_TIMESTR_LEN 128
|
||||
char datetime[MAX_TIMESTR_LEN];
|
||||
char timezone[MAX_TIMESTR_LEN];
|
||||
int len;
|
||||
|
||||
char *str = NULL;
|
||||
|
||||
str = ogs_sbi_timezone_string(-18000);
|
||||
|
@ -482,6 +489,12 @@ static void sbi_message_test5(abts_case *tc, void *data)
|
|||
str = ogs_sbi_timezone_string(0);
|
||||
ABTS_STR_EQUAL(tc, "+00:00", str);
|
||||
ogs_free(str);
|
||||
|
||||
ogs_localtime(ogs_time_sec(ogs_time_now()), &tm);
|
||||
ogs_strftime(datetime, sizeof datetime, "%Y-%m-%dT%H:%M:%S", &tm);
|
||||
|
||||
len = ogs_strftimezone(timezone, MAX_TIMESTR_LEN, tm.tm_gmtoff);
|
||||
ABTS_INT_EQUAL(tc, 6, len);
|
||||
}
|
||||
|
||||
abts_suite *test_sbi_message(abts_suite *suite)
|
||||
|
|
Loading…
Reference in New Issue