summaryrefslogtreecommitdiff
path: root/libs/androidfw/tests
diff options
context:
space:
mode:
author Shammi Khattar <skhattar@codeaurora.org> 2016-04-06 15:33:03 -0700
committer Narayan Kamath <narayan@google.com> 2016-04-28 15:07:34 +0000
commit7134ce35406f942dd640a95583430b39e770f0da (patch)
tree8e20bbd6fcb41e4af7bacc93c4dc08f4a3e08cc9 /libs/androidfw/tests
parent5bddeaa9bce6325c900eeabaa6a1cdfaf83910c6 (diff)
ZipUtils: Fix wrong timestamps when getEntryInfo
"tm_mon" format should align with "ZipEntry::setModWhen" in aapt. "tm_isdst" should be initialized, or it will because random value and cause error in function mktime(). BUG:28021145 (cherry picked from commit bb0eb3f4cb33c077b296a18555a9a1a966ff696b) Change-Id: Ia39cf63fcd4bb39c24af080562960279106f526c
Diffstat (limited to 'libs/androidfw/tests')
-rw-r--r--libs/androidfw/tests/ZipUtils_test.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/libs/androidfw/tests/ZipUtils_test.cpp b/libs/androidfw/tests/ZipUtils_test.cpp
index c6038b597f4e..7293843e066a 100644
--- a/libs/androidfw/tests/ZipUtils_test.cpp
+++ b/libs/androidfw/tests/ZipUtils_test.cpp
@@ -45,7 +45,7 @@ TEST_F(ZipUtilsTest, ZipTimeConvertSuccess) {
EXPECT_EQ(2011, t.tm_year + 1900)
<< "Year was improperly converted.";
- EXPECT_EQ(6, t.tm_mon)
+ EXPECT_EQ(5, t.tm_mon)
<< "Month was improperly converted.";
EXPECT_EQ(29, t.tm_mday)
@@ -59,6 +59,11 @@ TEST_F(ZipUtilsTest, ZipTimeConvertSuccess) {
EXPECT_EQ(40, t.tm_sec)
<< "Second was improperly converted.";
+
+ // We don't have enough information to determine timezone related info.
+ EXPECT_EQ(-1, t.tm_isdst);
+ EXPECT_EQ(0, t.tm_gmtoff);
+ EXPECT_EQ(nullptr, t.tm_zone);
}
}