1 #undef G_DISABLE_ASSERT
4 #ifdef GLIB_COMPILATION
5 #undef GLIB_COMPILATION
15 g_date_debug_print (GDate* d)
17 if (!d) g_print("NULL!\n");
19 g_print("julian: %u (%s) DMY: %u %u %u (%s)\n",
21 d->julian ? "valid" : "invalid",
25 d->dmy ? "valid" : "invalid");
30 /* These only work in the POSIX locale, maybe C too -
31 * type POSIX into the program to check them
33 char* posix_tests [] = {
46 int main(int argc, char** argv)
52 loc = setlocale(LC_ALL,"");
54 g_print("\nLocale set to %s\n", loc);
56 g_print("\nLocale unchanged\n");
60 while (fgets(input, 1023, stdin))
64 g_print("Enter a date to parse and press enter, or type `POSIX':\n");
68 if (strcmp(input,"POSIX\n") == 0)
70 char** s = posix_tests;
72 g_date_set_parse(d, *s);
74 g_print("POSIXy parse test `%s' ...", *s);
78 g_print(" failed.\n");
84 g_date_strftime(buf,100," parsed `%x' (%B %d %Y)\n",
94 g_date_set_parse(d, input);
98 g_print("Parse failed.\n");
104 g_date_strftime(buf,100,"Parsed: `%x' (%B %d %Y)\n",