| 59 | |
| 60 | |
| 61 | int 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 | |
| 89 | void test_tz_dynamic(time_t t) |
no test coverage detected