File: 0024-Make-the-tests-pass-on-big-endian-systems.patch

package info (click to toggle)
qtpim-opensource-src 5.0~git20201102.f9a8f0fc%2Bdfsg1-6
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 18,236 kB
  • sloc: cpp: 82,965; xml: 91; makefile: 81; javascript: 67
file content (55 lines) | stat: -rw-r--r-- 2,405 bytes parent folder | download | duplicates (2)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
From 783eba83161c85b2c503ad163e22ad3eefe01c05 Mon Sep 17 00:00:00 2001
From: Dmitry Shachnev <mitya57@gmail.com>
Date: Sat, 31 Oct 2020 20:47:35 +0300
Subject: [PATCH 24/32] Make the tests pass on big endian systems

Make sure the generated item IDs are the same as on little endian
systems, e.g. 05000000 and not 00000005.

Change-Id: Iafa16f616a4ef56905e177e2509e1e02c3de0e9c
Reviewed-by: Christopher Adams <chris.adams@jolla.com>
Signed-off-by: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
---
 tests/auto/contacts/qcontactfilter/tst_qcontactfilter.cpp       | 2 ++
 .../organizer/qorganizeritemfilter/tst_qorganizeritemfilter.cpp | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/tests/auto/contacts/qcontactfilter/tst_qcontactfilter.cpp b/tests/auto/contacts/qcontactfilter/tst_qcontactfilter.cpp
index 4ccbbd1d..6114f0b8 100644
--- a/tests/auto/contacts/qcontactfilter/tst_qcontactfilter.cpp
+++ b/tests/auto/contacts/qcontactfilter/tst_qcontactfilter.cpp
@@ -39,11 +39,13 @@ Q_DECLARE_METATYPE(QContactFilter)
 
 static inline QContactId makeId(const QString &managerName, uint id)
 {
+    id = qToLittleEndian(id);
     return QContactId(QStringLiteral("qtcontacts:basic%1:").arg(managerName), QByteArray(reinterpret_cast<const char *>(&id), sizeof(uint)));
 }
 
 static inline QContactCollectionId makeCollectionId(uint id)
 {
+    id = qToLittleEndian(id);
     return QContactCollectionId(QStringLiteral("qtcontacts:basic:"), QByteArray(reinterpret_cast<const char *>(&id), sizeof(uint)));
 }
 
diff --git a/tests/auto/organizer/qorganizeritemfilter/tst_qorganizeritemfilter.cpp b/tests/auto/organizer/qorganizeritemfilter/tst_qorganizeritemfilter.cpp
index 7af4bf26..16020b11 100644
--- a/tests/auto/organizer/qorganizeritemfilter/tst_qorganizeritemfilter.cpp
+++ b/tests/auto/organizer/qorganizeritemfilter/tst_qorganizeritemfilter.cpp
@@ -40,11 +40,13 @@ Q_DECLARE_METATYPE(QOrganizerItemDetailFieldFilter)
 
 static inline QOrganizerItemId makeItemId(uint id)
 {
+    id = qToLittleEndian(id);
     return QOrganizerItemId(QStringLiteral("qtorganizer:basic:"), QByteArray(reinterpret_cast<const char *>(&id), sizeof(uint)));
 }
 
 static inline QOrganizerCollectionId makeCollectionId(uint id)
 {
+    id = qToLittleEndian(id);
     return QOrganizerCollectionId(QStringLiteral("qtorganizer:basic:"), QByteArray(reinterpret_cast<const char *>(&id), sizeof(uint)));
 }
 
-- 
2.30.2