| OLD | NEW |
| 1 // Copyright 2015 The Crashpad Authors. All rights reserved. | 1 // Copyright 2015 The Crashpad Authors. All rights reserved. |
| 2 // | 2 // |
| 3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
| 5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
| 6 // | 6 // |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 // | 8 // |
| 9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 std::string daylight_name; | 116 std::string daylight_name; |
| 117 | 117 |
| 118 system_snapshot().TimeZone(&dst_status, | 118 system_snapshot().TimeZone(&dst_status, |
| 119 &standard_offset_seconds, | 119 &standard_offset_seconds, |
| 120 &daylight_offset_seconds, | 120 &daylight_offset_seconds, |
| 121 &standard_name, | 121 &standard_name, |
| 122 &daylight_name); | 122 &daylight_name); |
| 123 | 123 |
| 124 // |standard_offset_seconds| gives seconds east of UTC, and |timezone| gives | 124 // |standard_offset_seconds| gives seconds east of UTC, and |timezone| gives |
| 125 // seconds west of UTC. | 125 // seconds west of UTC. |
| 126 #if _MSC_VER >= 1900 |
| 127 long timezone = 0; |
| 128 _get_timezone(&timezone); |
| 129 #endif |
| 126 EXPECT_EQ(-timezone, standard_offset_seconds); | 130 EXPECT_EQ(-timezone, standard_offset_seconds); |
| 127 | 131 |
| 128 // In contemporary usage, most time zones have an integer hour offset from | 132 // In contemporary usage, most time zones have an integer hour offset from |
| 129 // UTC, although several are at a half-hour offset, and two are at 15-minute | 133 // UTC, although several are at a half-hour offset, and two are at 15-minute |
| 130 // offsets. Throughout history, other variations existed. See | 134 // offsets. Throughout history, other variations existed. See |
| 131 // http://www.timeanddate.com/time/time-zones-interesting.html. | 135 // http://www.timeanddate.com/time/time-zones-interesting.html. |
| 132 EXPECT_EQ(0, standard_offset_seconds % (15 * 60)) | 136 EXPECT_EQ(0, standard_offset_seconds % (15 * 60)) |
| 133 << "standard_offset_seconds " << standard_offset_seconds; | 137 << "standard_offset_seconds " << standard_offset_seconds; |
| 134 | 138 |
| 135 if (dst_status == SystemSnapshot::kDoesNotObserveDaylightSavingTime) { | 139 if (dst_status == SystemSnapshot::kDoesNotObserveDaylightSavingTime) { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 148 FAIL() << "dst_delta_seconds " << dst_delta_seconds; | 152 FAIL() << "dst_delta_seconds " << dst_delta_seconds; |
| 149 } | 153 } |
| 150 | 154 |
| 151 EXPECT_NE(standard_name, daylight_name); | 155 EXPECT_NE(standard_name, daylight_name); |
| 152 } | 156 } |
| 153 } | 157 } |
| 154 | 158 |
| 155 } // namespace | 159 } // namespace |
| 156 } // namespace test | 160 } // namespace test |
| 157 } // namespace crashpad | 161 } // namespace crashpad |
| OLD | NEW |