}
}
-/* converts a broken down date representation, relative to UTC, to
- * a timestamp; it uses timegm() if it's available.
+/* converts a broken down date representation, relative to UTC,
+ * to a timestamp; it uses timegm() if it's available.
*/
static time_t
mktime_utc (struct tm *tm)
g_return_val_if_fail (iso_date != NULL, FALSE);
g_return_val_if_fail (time_ != NULL, FALSE);
- /* Ensure that the first character is a digit,
- * the first digit of the date, otherwise we don't
- * have an ISO 8601 date */
+ /* Ensure that the first character is a digit, the first digit
+ * of the date, otherwise we don't have an ISO 8601 date
+ */
while (g_ascii_isspace (*iso_date))
iso_date++;
}
if (*iso_date != 'T')
- {
- /* Date only */
- if (*iso_date == '\0')
- return TRUE;
- return FALSE;
- }
+ return FALSE;
iso_date++;
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",