MCPcopy Create free account
hub / github.com/SmingHub/Sming / checkHttpDates

Method checkHttpDates

tests/HostTests/modules/DateTime.cpp:140–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138 }
139
140 void checkHttpDates(const FSTR::Array<TestDate>& dates)
141 {
142 for(auto date : dates) {
143 DateTime dt;
144 String s(*date.stringToParse);
145 Serial << s << endl;
146 REQUIRE(dt.fromHttpDate(s));
147 REQUIRE_EQ(date.unixTimestamp, dt.toUnixTime());
148
149 dt.setTime(date.unixTimestamp);
150 REQUIRE_EQ(date.unixTimestamp, dt.toUnixTime());
151
152 REQUIRE_EQ(String(*date.expectedString), dt.toHTTPDate());
153 Serial.println();
154 }
155 }
156
157 void checkIsoTimes(const FSTR::Array<TestDate>& dates, bool timeOnly)
158 {

Callers

nothing calls this directly

Calls 6

fromHttpDateMethod · 0.80
toUnixTimeMethod · 0.80
toHTTPDateMethod · 0.80
printlnMethod · 0.80
StringClass · 0.50
setTimeMethod · 0.45

Tested by

no test coverage detected