Skip to content

Commit

Permalink
test: Utility::UnixTimeToLargeIntegerFiletime (#12030)
Browse files Browse the repository at this point in the history
  • Loading branch information
DeepDiver1975 authored Jan 20, 2025
1 parent 7353726 commit 84fd55e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/testutility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@

#include "common/filesystembase.h"
#include "common/utility.h"
#ifdef Q_OS_WIN
#include "common/utility_win.h"
#endif

using namespace std::chrono_literals;

Expand Down Expand Up @@ -322,6 +325,17 @@ private Q_SLOTS:
QVERIFY(Tags::remove(fn, testKey));
QVERIFY(!Tags::get(fn, testKey).has_value());
}
#ifdef Q_OS_WIN
void testUtilityUnixTimeToLargeIntegerFiletime()
{
// Sun Jan 31 2038 23:00:00 GMT+0000
time_t y2k38 = 2148591600;
LARGE_INTEGER out;
OCC::Utility::UnixTimeToLargeIntegerFiletime(y2k38, &out);
// (2148591600 * 10000000) + 116444736000000000
QCOMPARE(out.QuadPart, 137930652000000000);
}
#endif
};

QTEST_GUILESS_MAIN(TestUtility)
Expand Down

0 comments on commit 84fd55e

Please sign in to comment.