[glib] tests: always use four digit years for date parsing tests
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] tests: always use four digit years for date parsing tests
- Date: Mon, 9 Apr 2012 19:49:28 +0000 (UTC)
commit c39d6954d3219472b3e9187bb86931051d313582
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Mon Apr 9 15:47:29 2012 -0400
tests: always use four digit years for date parsing tests
Or some system with different locale settings might get confused whether
a two digit year is to be parsed with regard to the current century or
as an absolute year.
glib/tests/date.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/glib/tests/date.c b/glib/tests/date.c
index 81635aa..38ccc68 100644
--- a/glib/tests/date.c
+++ b/glib/tests/date.c
@@ -130,17 +130,17 @@ test_parse (void)
g_assert_cmpint (g_date_get_day (d), ==, 10);
g_assert_cmpint (g_date_get_year (d), ==, 2000);
- g_date_set_parse (d, "10 10 10");
+ g_date_set_parse (d, "10 10 2010");
g_assert (g_date_valid (d));
g_assert_cmpint (g_date_get_month (d), ==, 10);
g_assert_cmpint (g_date_get_day (d), ==, 10);
- g_assert_cmpint (g_date_get_year (d), ==, 10);
+ g_assert_cmpint (g_date_get_year (d), ==, 2010);
- g_date_set_parse (d, "10 March 10");
+ g_date_set_parse (d, "10 March 2010");
g_assert (g_date_valid (d));
g_assert_cmpint (g_date_get_month (d), ==, 3);
g_assert_cmpint (g_date_get_day (d), ==, 10);
- g_assert_cmpint (g_date_get_year (d), ==, 10);
+ g_assert_cmpint (g_date_get_year (d), ==, 2010);
g_date_free (d);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]