Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Utility::UnixTimeToLargeIntegerFiletime #12030

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 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,16 @@ 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);
QCOMPARE(out.QuadPart, 2147483647);
}
#endif
};

QTEST_GUILESS_MAIN(TestUtility)
Expand Down
Loading