[BACK]Return to test-strptime.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

File: [cvsweb.bsd.lv] / mandoc / test-strptime.c (download)

Revision 1.2, Sat Jan 4 01:11:00 2014 UTC (10 years, 2 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_3, VERSION_1_13_2, VERSION_1_13_1, VERSION_1_12_4, VERSION_1_12
Changes since 1.1: +5 -4 lines

Clean up feature tests:
* Split the configure steering script out of the Makefile.
* Let the configure step depend on the test sources.
* Clean up the test programs such that they can be run.

#if defined(__linux__) || defined(__MINT__)
# define _GNU_SOURCE /* strptime() */
#endif

#include <time.h>

int
main(void)
{
	struct tm tm;
	const char input[] = "2014-01-04";
	return( ! (input+10 == strptime(input, "%Y-%m-%d", &tm) &&
	    114 == tm.tm_year && 0 == tm.tm_mon && 4 == tm.tm_mday));
}