From f2b48de26b8f8c48c293423eda712831544924f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= Date: Wed, 17 Aug 2022 15:22:29 +0200 Subject: qt,tests: Make sure expiration time is interpreted as unsigned number * lang/qt/tests/t-addexistingsubkey.cpp, lang/qt/tests/t-changeexpiryjob.cpp: Convert expiration time to uint_least32_t. -- This doesn't change the outcome of the tests (they also pass without this change because of the expiration dates of the test keys), but it's still good practise to treat the expiration time as an unsigned number if the assertions check that the expiration time is in some range. GnuPG-bug-id: 6137 --- lang/qt/tests/t-addexistingsubkey.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lang/qt/tests/t-addexistingsubkey.cpp') diff --git a/lang/qt/tests/t-addexistingsubkey.cpp b/lang/qt/tests/t-addexistingsubkey.cpp index 2e654cec..87eadf43 100644 --- a/lang/qt/tests/t-addexistingsubkey.cpp +++ b/lang/qt/tests/t-addexistingsubkey.cpp @@ -222,9 +222,9 @@ private Q_SLOTS: // several times const auto allowedDeltaTSeconds = 1; const auto expectedExpirationRange = std::make_pair( - sourceSubkey.expirationTime() - allowedDeltaTSeconds, - sourceSubkey.expirationTime() + allowedDeltaTSeconds); - const auto actualExpiration = key.subkey(2).expirationTime(); + uint_least32_t(sourceSubkey.expirationTime()) - allowedDeltaTSeconds, + uint_least32_t(sourceSubkey.expirationTime()) + allowedDeltaTSeconds); + const auto actualExpiration = uint_least32_t(key.subkey(2).expirationTime()); QVERIFY2(actualExpiration >= expectedExpirationRange.first, ("actual: " + std::to_string(actualExpiration) + "; expected: " + std::to_string(expectedExpirationRange.first)).c_str()); -- cgit v1.2.3