test-message-date.c revision 39025a2dabfcfaeee3790988b9ea00d19887a3d3
39025a2dabfcfaeee3790988b9ea00d19887a3d3Timo Sirainen/* Copyright (c) 2007-2009 Dovecot authors, see the included COPYING file */
39025a2dabfcfaeee3790988b9ea00d19887a3d3Timo Sirainen static const char *input[] = {
39025a2dabfcfaeee3790988b9ea00d19887a3d3Timo Sirainen "Thu, 01 Jan 1970 01:59:59 +0200",
39025a2dabfcfaeee3790988b9ea00d19887a3d3Timo Sirainen "Fri, 13 Dec 1901 20:45:53 +0000",
39025a2dabfcfaeee3790988b9ea00d19887a3d3Timo Sirainen#if (TIME_T_MAX_BITS > 32 || !defined(TIME_T_SIGNED))
39025a2dabfcfaeee3790988b9ea00d19887a3d3Timo Sirainen "Sun, 07 Feb 2106 06:28:15 +0000",
39025a2dabfcfaeee3790988b9ea00d19887a3d3Timo Sirainen "Wed, 07 Nov 2007 01:07:20 +0200",
39025a2dabfcfaeee3790988b9ea00d19887a3d3Timo Sirainen "Wed, 07 Nov 2007 01:07:20",
39025a2dabfcfaeee3790988b9ea00d19887a3d3Timo Sirainen "Thu, 01 Jan 1970 02:00:00 +0200",
39025a2dabfcfaeee3790988b9ea00d19887a3d3Timo Sirainen "Tue, 19 Jan 2038 03:14:07 +0000",
39025a2dabfcfaeee3790988b9ea00d19887a3d3Timo Sirainen "Tue, 19 Jan 2038"
39025a2dabfcfaeee3790988b9ea00d19887a3d3Timo Sirainen static struct test_message_date_output output[] = {
39025a2dabfcfaeee3790988b9ea00d19887a3d3Timo Sirainen#if (TIME_T_MAX_BITS > 32 || !defined(TIME_T_SIGNED))
39025a2dabfcfaeee3790988b9ea00d19887a3d3Timo Sirainen unsigned int i;
39025a2dabfcfaeee3790988b9ea00d19887a3d3Timo Sirainen ret = message_date_parse((const unsigned char *)input[i],
39025a2dabfcfaeee3790988b9ea00d19887a3d3Timo Sirainen (ret == output[i].ret && t == output[i].time &&
39025a2dabfcfaeee3790988b9ea00d19887a3d3Timo Sirainen test_out(t_strdup_printf("message_date_parse(%d)", i), success);
39025a2dabfcfaeee3790988b9ea00d19887a3d3Timo Sirainen static void (*test_functions[])(void) = {