MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / cmtr

Function cmtr

modules/cfgutils/test/cfgutils.c:61–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59
60
61int cmtr(const char *_rec, unsigned int ts)
62{
63 char *rec;
64 int rc1, rc2;
65 tmrec *tr;
66
67 /* it seems _tmrec_check_str() writes to the input buffer, so dup it! */
68 rec = shm_strdup(_rec);
69
70 /* rc1: quick string parsing & evaluation */
71 rc1 = check_time_rec(NULL, rec, &ts);
72
73 /* rc2: parse -> eval -> free */
74 tr = tmrec_expr_parse(rec, SHM_ALLOC);
75 if (!tr) {
76 rc2 = -2;
77 } else {
78 rc2 = _tmrec_expr_check(tr, (time_t)ts);
79 tmrec_expr_free(tr);
80 }
81
82 ok(rc1 == rc2);
83 shm_free(rec);
84
85 return rc1;
86}
87
88
89void test_tz_dynamic(time_t t)

Callers 1

test_check_tmrec_exprFunction · 0.85

Calls 6

shm_strdupFunction · 0.85
check_time_recFunction · 0.85
tmrec_expr_parseFunction · 0.85
_tmrec_expr_checkFunction · 0.85
tmrec_expr_freeFunction · 0.85
shm_freeFunction · 0.85

Tested by

no test coverage detected