OSDN Git Service
(root)
/
android-x86
/
bionic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8a36369
)
Add a trivial gmtime(3) test.
author
Elliott Hughes
<enh@google.com>
Fri, 12 Jul 2013 18:25:20 +0000
(11:25 -0700)
committer
Elliott Hughes
<enh@google.com>
Fri, 12 Jul 2013 18:25:20 +0000
(11:25 -0700)
Change-Id: I849f200a455cd6971646fa45766ab22ba19fb866
tests/time_test.cpp
patch
|
blob
|
history
diff --git
a/tests/time_test.cpp
b/tests/time_test.cpp
index
9a5a706
..
0ad4763
100644
(file)
--- a/
tests/time_test.cpp
+++ b/
tests/time_test.cpp
@@
-42,3
+42,15
@@
TEST(time, mktime_tz) {
ASSERT_EQ(2678400, mktime_tz(&epoch, "PST"));
}
#endif
+
+TEST(time, gmtime) {
+ time_t t = 0;
+ tm* broken_down = gmtime(&t);
+ ASSERT_TRUE(broken_down != NULL);
+ ASSERT_EQ(0, broken_down->tm_sec);
+ ASSERT_EQ(0, broken_down->tm_min);
+ ASSERT_EQ(0, broken_down->tm_hour);
+ ASSERT_EQ(1, broken_down->tm_mday);
+ ASSERT_EQ(0, broken_down->tm_mon);
+ ASSERT_EQ(1970, broken_down->tm_year + 1900);
+}