date.c 496 Bytes
Newer Older
1 2
#include "clar_libgit2.h"

3
#include "date.h"
4 5 6

void test_date_date__overflow(void)
{
7
#ifdef __LP64__
8 9
   git_time_t d2038, d2039;

10
   /* This is expected to fail on a 32-bit machine. */
11 12
   cl_git_pass(git_date_parse(&d2038, "2038-1-1"));
   cl_git_pass(git_date_parse(&d2039, "2039-1-1"));
13
   cl_assert(d2038 < d2039);
14
#endif
15
}
16 17 18 19

void test_date_date__invalid_date(void)
{
   git_time_t d;
20 21
   cl_git_fail(git_date_parse(&d, ""));
   cl_git_fail(git_date_parse(&d, "NEITHER_INTEGER_NOR_DATETIME"));
22
}