listsockets: Add TODO comment and update test.

This commit is contained in:
RealKindOne committed 2026-10-01 20:00:11 -04:00
1 parent bc25a36972
commit f5c865015c
2 files changed
+6 -1

No files matched your search

+2
View File
@@ -155,6 +155,8 @@ class CListSockets : public CModule {
unsigned long long iStartTime = pSocket->GetStartTime();
unsigned long long iNow = CUtils::GetMillTime();
// TODO This code would look simpler with std::chrono instead.
// Especially if socket API is changed to use that.
timeval tv = CUtils::GetTime();
unsigned long long iAgeUs = (iNow - iStartTime) * 1000;
+4 -1
View File
@@ -1222,8 +1222,11 @@ TEST_F(ZNCTest, ListSocketsModule) {
client.Write("znc loadmod listsockets");
client.ReadUntil("Loaded module");
client.Write("PRIVMSG *listsockets :list");
int year = QDate::currentDate().year();
ASSERT_THAT(client.ReadRemainder().toStdString(),
Not(HasSubstr("1970-")));
AnyOf(HasSubstr(std::to_string(year - 1) + "-"),
HasSubstr(std::to_string(year) + "-"),
HasSubstr(std::to_string(year + 1) + "-")));
}
} // namespace