| 144 | } |
| 145 | |
| 146 | void DoTestMilitaryZones(char firstChar, char lastChar) { |
| 147 | const time_t utcTime = 1109964885; // Fri, 4 Mar 2005 19:34:45 UT |
| 148 | char text[] = "Fri, 4 Mar 2005 19:34:45 A"; |
| 149 | const size_t zoneCharIndex = strlen(text) - 1; |
| 150 | |
| 151 | for (char militaryZone = firstChar; militaryZone <= lastChar; ++militaryZone) { |
| 152 | time_t t = 0; |
| 153 | const time_t offset = GetOffset(militaryZone); |
| 154 | // the last character is replaced with next zone symbol |
| 155 | text[zoneCharIndex] = militaryZone; |
| 156 | |
| 157 | UNIT_ASSERT(ParseRFC822DateTime(text, t)); |
| 158 | UNIT_ASSERT_EQUAL(t, utcTime - offset); |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | Y_UNIT_TEST(TestRfc822MilitaryZones) { |
| 163 | DoTestMilitaryZones('A', 'I'); |
no test coverage detected