Blame SOURCES/0002-gvariant-test-Also-force-alignment-for-tuple-test-da.patch

d1ed09
From 4ef58e5661849317a1110c9b93957f2c608677dd Mon Sep 17 00:00:00 2001
d1ed09
From: Simon McVittie <smcv@collabora.com>
d1ed09
Date: Thu, 3 Jan 2019 08:21:40 +0000
d1ed09
Subject: [PATCH 2/2] gvariant test: Also force alignment for tuple test data
d1ed09
d1ed09
glib!552 (commit 9eed22b3) fixed this for the tests that failed on i686,
d1ed09
but this additional test failed on Debian's s390x port
d1ed09
(IBM z/Architecture, 64-bit big-endian).
d1ed09
d1ed09
Signed-off-by: Simon McVittie <smcv@collabora.com>
d1ed09
---
d1ed09
 glib/tests/gvariant.c | 7 +++++--
d1ed09
 1 file changed, 5 insertions(+), 2 deletions(-)
d1ed09
d1ed09
diff --git a/glib/tests/gvariant.c b/glib/tests/gvariant.c
d1ed09
index a7b19826d..c4a996c1f 100644
d1ed09
--- a/glib/tests/gvariant.c
d1ed09
+++ b/glib/tests/gvariant.c
d1ed09
@@ -4820,6 +4820,7 @@ test_normal_checking_array_offsets (void)
d1ed09
 static void
d1ed09
 test_normal_checking_tuple_offsets (void)
d1ed09
 {
d1ed09
+  gpointer aligned_data;
d1ed09
   const guint8 data[] = {
d1ed09
     0x07, 0xe5, 0x00, 0x07, 0x00, 0x07,
d1ed09
     '(', 'a', 's', 'a', 's', 'a', 's', 'a', 's', 'a', 's', 'a', 's', ')',
d1ed09
@@ -4828,13 +4829,15 @@ test_normal_checking_tuple_offsets (void)
d1ed09
   GVariant *variant = NULL;
d1ed09
   GVariant *normal_variant = NULL;
d1ed09
 
d1ed09
-  variant = g_variant_new_from_data (G_VARIANT_TYPE_VARIANT, data, size,
d1ed09
-                                     FALSE, NULL, NULL);
d1ed09
+  aligned_data = g_memdup (data, size); /* guarantee alignment */
d1ed09
+  variant = g_variant_new_from_data (G_VARIANT_TYPE_VARIANT, aligned_data,
d1ed09
+                                     size, FALSE, NULL, NULL);
d1ed09
   g_assert_nonnull (variant);
d1ed09
 
d1ed09
   normal_variant = g_variant_get_normal_form (variant);
d1ed09
   g_assert_nonnull (normal_variant);
d1ed09
 
d1ed09
+  g_free (aligned_data);
d1ed09
   g_variant_unref (normal_variant);
d1ed09
   g_variant_unref (variant);
d1ed09
 }
d1ed09
-- 
d1ed09
2.19.1
d1ed09