Remove broken attempt at parsing date-only

g_time_val_from_iso8601 was attempting to parse strings
having only a date, but failed to actually set the timeval
despite returning TRUE. Since the docs state that the function
only parses strings containing a date and a time, just return
FALSE in this case.

Also remove an incomplete testcase for this behaviour that was
just checking the boolean return value, but not timeval.
This commit is contained in:
Matthias Clasen
2013-12-29 13:43:28 -05:00
parent 680c348bb4
commit 27e352985b
2 changed files with 7 additions and 12 deletions

View File

@@ -1347,7 +1347,7 @@ various_string_tests (void)
g_assert (g_time_val_from_iso8601 (REF_INVALID1, &date) == FALSE);
g_assert (g_time_val_from_iso8601 (REF_INVALID2, &date) == FALSE);
g_assert (g_time_val_from_iso8601 (REF_INVALID3, &date) == FALSE);
g_assert (g_time_val_from_iso8601 (REF_STR_DATE_ONLY, &date) != FALSE);
g_assert (g_time_val_from_iso8601 (REF_STR_DATE_ONLY, &date) == FALSE);
g_assert (g_time_val_from_iso8601 (REF_STR_UTC, &date) != FALSE);
if (g_test_verbose())
g_print ("\t=> UTC stamp = %ld.%06ld (should be: %ld.%06ld) (%ld.%06ld off)\n",