1 #undef G_DISABLE_ASSERT
4 #ifdef GLIB_COMPILATION
5 #undef GLIB_COMPILATION
14 void g_date_debug_print(GDate* d)
16 if (!d) g_print("NULL!\n");
18 g_print("julian: %u (%s) DMY: %u %u %u (%s)\n",
20 d->julian ? "valid" : "invalid",
24 d->dmy ? "valid" : "invalid");
29 /* These only work in the POSIX locale, maybe C too -
30 * type POSIX into the program to check them
32 char* posix_tests [] = {
45 int main(int argc, char** argv)
51 loc = setlocale(LC_ALL,"");
53 g_print("\nLocale set to %s\n", loc);
55 g_print("\nLocale unchanged\n");
59 while (fgets(input, 1023, stdin))
63 g_print("Enter a date to parse and press enter, or type `POSIX':\n");
67 if (strcmp(input,"POSIX\n") == 0)
69 char** s = posix_tests;
71 g_date_set_parse(d, *s);
73 g_print("POSIXy parse test `%s' ...", *s);
77 g_print(" failed.\n");
83 g_date_strftime(buf,100," parsed `%x' (%B %d %Y)\n",
93 g_date_set_parse(d, input);
97 g_print("Parse failed.\n");
103 g_date_strftime(buf,100,"Parsed: `%x' (%B %d %Y)\n",