summaryrefslogtreecommitdiff
path: root/user/gpgme/0002-Make-sure-expiration-time-is-interpreted-as-unsigned.patch
blob: 558cacda03c88d621a3d5f8a49035b6f4647caa7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From 6a79e90dedc19877ae1c520fed875b57089a5425 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= <dev@ingo-kloecker.de>
Date: Thu, 8 Jul 2021 11:54:06 +0200
Subject: [PATCH] Make sure expiration time is interpreted as unsigned number

* lang/qt/tests/t-various.cpp (testSignKeyWithExpiration): Convert
expiration time to uint_least32_t.
--

This fixes the test on 32-bit systems where time_t (the return type of
expirationTime()) is a signed 32-bit integer type.

GnuPG-bug-id: 5522
---
 lang/qt/tests/t-various.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lang/qt/tests/t-various.cpp b/lang/qt/tests/t-various.cpp
index 8563b681..72a2487a 100644
--- a/lang/qt/tests/t-various.cpp
+++ b/lang/qt/tests/t-various.cpp
@@ -355,7 +355,7 @@ private Q_SLOTS:
         target.update();
         const auto keySignature = target.userID(0).signature(target.userID(0).numSignatures() - 1);
         QVERIFY(!keySignature.neverExpires());
-        const auto expirationDate = QDateTime::fromSecsSinceEpoch(keySignature.expirationTime()).date();
+        const auto expirationDate = QDateTime::fromSecsSinceEpoch(uint_least32_t(keySignature.expirationTime())).date();
         QCOMPARE(expirationDate, QDate(2106, 2, 6));  // expiration date is capped at 2106-02-06
     }