![]() |
Nilorea Library
C utilities for networking, threading, graphics
|
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include "nilorea/n_common.h"#include "nilorea/n_log.h"#include "nilorea/n_time.h"Go to the source code of this file.
Data Structures | |
| struct | date_vector |
| a timestamp and what PHP prints for it More... | |
Functions | |
| static void | expect_true (const char *what, int ok) |
| count a failed check | |
| int | main (int argc, char **argv) |
| run the checks | |
| static int | parses (int http, const char *s, int ok, long long want) |
| parse s with the given parser and compare with want (or expect failure) | |
| static int | process_args (int argc, char **argv) |
| read -V | |
| static void | test_format (void) |
| formatting, compared with PHP's output | |
| static void | test_parse (void) |
| parsing | |
Variables | |
| static int | failures = 0 |
| failed checks | |
| static int | log_level = 3 |
| log level from -V | |
| struct date_vector |
a timestamp and what PHP prints for it
Definition at line 73 of file ex_time_formats.c.
|
static |
| int main | ( | int | argc, |
| char ** | argv ) |
run the checks
| argc | argument count |
| argv | arguments |
Definition at line 191 of file ex_time_formats.c.
References failures, LOG_ERR, log_level, LOG_NOTICE, n_log, process_args(), set_log_level(), test_format(), and test_parse().
|
static |
parse s with the given parser and compare with want (or expect failure)
| http | non-zero: HTTP date parser, else RFC 3339 |
| s | the text |
| ok | expected success |
| want | expected time when ok |
Definition at line 131 of file ex_time_formats.c.
References n_time_parse_http_date(), and n_time_parse_rfc3339().
Referenced by test_parse().
|
static |
read -V
| argc | argument count |
| argv | arguments |
Definition at line 59 of file ex_time_formats.c.
References log_level.
|
static |
formatting, compared with PHP's output
Definition at line 84 of file ex_time_formats.c.
References expect_true(), n_time_http_date(), N_TIME_HTTP_DATE_LEN, n_time_rfc2822(), N_TIME_RFC2822_LEN, n_time_rfc3339(), and N_TIME_RFC3339_LEN.
Referenced by main().
|
static |
parsing
Definition at line 140 of file ex_time_formats.c.
References expect_true(), failures, LOG_ERR, n_log, n_time_http_date(), n_time_parse_http_date(), n_time_parse_rfc3339(), n_time_rfc3339(), and parses().
|
static |
failed checks
Definition at line 41 of file ex_time_formats.c.
|
static |
log level from -V
Definition at line 39 of file ex_time_formats.c.