diff options
| author | Elliott Hughes <enh@google.com> | 2013-08-22 11:37:32 -0700 |
|---|---|---|
| committer | Elliott Hughes <enh@google.com> | 2013-08-22 12:23:47 -0700 |
| commit | f0c10a4a16c74f5099cf6b272c0a2f11f454e63c (patch) | |
| tree | 53ad4eb99fb160a3805bec57ee18a6883476de15 /tests/time_test.cpp | |
| parent | 9ef1fbb644bf85fa211588853316efa4848547c6 (diff) | |
Work around tzcode's reliance on signed overflow.
I've mailed the tz list about this, and will switch to whatever upstream
fix comes along as soon as it's available.
Bug: 10310929
(cherry picked from commit 7843d44a594270bcb56e98b130603c054f8a9d38)
Change-Id: I205e2440703444c50cecd91d3458d33613ddbc59
Diffstat (limited to 'tests/time_test.cpp')
| -rw-r--r-- | tests/time_test.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/time_test.cpp b/tests/time_test.cpp index 0ad4763a1d..02163a554f 100644 --- a/tests/time_test.cpp +++ b/tests/time_test.cpp @@ -54,3 +54,16 @@ TEST(time, gmtime) { ASSERT_EQ(0, broken_down->tm_mon); ASSERT_EQ(1970, broken_down->tm_year + 1900); } + +#ifdef __BIONIC__ +TEST(time, mktime_10310929) { + struct tm t; + memset(&t, 0, sizeof(tm)); + t.tm_year = 200; + t.tm_mon = 2; + t.tm_mday = 10; + + ASSERT_EQ(-1, mktime(&t)); + ASSERT_EQ(-1, mktime_tz(&t, "UTC")); +} +#endif |
