1 /* gztime.c Shishi generalized time self tests.
2 * Copyright (C) 2002, 2003 Simon Josefsson
4 * This file is part of Shishi.
6 * Shishi is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * Shishi is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with Shishi; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25 test (Shishi
* handle
)
30 /* shishi_authenticator_ctime_set() */
31 p
= shishi_generalize_time (handle
, (time_t) 4711);
34 if (p
&& memcmp (p
, "19700101011831Z", 15) == 0)
35 success ("shishi_generalize_time() OK\n");
37 fail ("shishi_generalize_time() failed\n");
39 /* shishi_generalize_ctime() */
40 n
= (int) shishi_generalize_ctime (handle
, p
);
42 printf ("shishi_generalize_ctime () => `%d'.\n", n
);
44 success ("shishi_generalize_ctime() OK\n");
46 fail ("shishi_generalize_ctime() failed\n");