]> git.proxmox.com Git - libgit2.git/blob - tests/libgit2/date/date.c
82b5c67282e250b811fe893bc41265b3c6f8d401
[libgit2.git] / tests / libgit2 / date / date.c
1 #include "clar_libgit2.h"
2
3 #include "date.h"
4
5 void test_date_date__overflow(void)
6 {
7 #ifdef __LP64__
8 git_time_t d2038, d2039;
9
10 /* This is expected to fail on a 32-bit machine. */
11 cl_git_pass(git_date_parse(&d2038, "2038-1-1"));
12 cl_git_pass(git_date_parse(&d2039, "2039-1-1"));
13 cl_assert(d2038 < d2039);
14 #endif
15 }
16
17 void test_date_date__invalid_date(void)
18 {
19 git_time_t d;
20 cl_git_fail(git_date_parse(&d, ""));
21 cl_git_fail(git_date_parse(&d, "NEITHER_INTEGER_NOR_DATETIME"));
22 }