Package: osmo-iuh / 1.7.0+dfsg1-2

fix_bigend_tests.patch Patch series | download
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
From: Debian Mobcom Maintainers
 <Debian-mobcom-maintainers@lists.alioth.debian.org>
Date: Thu, 6 Dec 2018 21:51:02 +0100
Subject: Fix test suite for big endian architectures

---
 src/ranap_msg_factory.c  | 6 ++++++
 src/tests/test-helpers.c | 5 ++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

--- a/src/ranap_msg_factory.c
+++ b/src/ranap_msg_factory.c
@@ -28,6 +28,8 @@
 #include <osmocom/ranap/ranap_common.h>
 #include <osmocom/ranap/ranap_ies_defs.h>
 #include <osmocom/ranap/ranap_msg_factory.h>
+#include <osmocom/core/byteswap.h>
+#include <osmocom/core/endian.h>
 
 #define DRANAP _ranap_DRANAP
 
@@ -139,7 +141,11 @@
 	struct msgb *msg;
 	uint32_t ctxidbuf;
 	int rc;
+#if OSMO_IS_BIG_ENDIAN == 1
+	uint16_t buf0 = 0x4223;
+#else
 	uint16_t buf0 = 0x2342;
+#endif
 
 	memset(&ies, 0, sizeof(ies));
 	if (is_ps)
--- a/tests/test-helpers.c
+++ b/tests/test-helpers.c
@@ -33,6 +33,7 @@
 #include <osmocom/gsm/gsm48.h>
 
 #include <osmocom/ranap/RANAP_LAI.h>
+#include <osmocom/core/byteswap.h>
 
 extern void *talloc_asn1_ctx;