[glib/wip/smcv/aligned-alloc-tests: 1/3] tests: Don't assume that all platforms are 64-bit




commit d04f3491afcee3350e4cd8e478cb1eb459b68e1f
Author: Simon McVittie <smcv collabora com>
Date:   Tue Feb 15 10:47:28 2022 +0000

    tests: Don't assume that all platforms are 64-bit
    
    On ILP32 platforms, 4 is a valid alignment for g_aligned_alloc(), so
    use 2 as our invalid alignment instead.
    
    Signed-off-by: Simon McVittie <smcv collabora com>

 glib/tests/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/glib/tests/utils.c b/glib/tests/utils.c
index 9dbdd2c8c..53fdbce9d 100644
--- a/glib/tests/utils.c
+++ b/glib/tests/utils.c
@@ -943,7 +943,7 @@ aligned_alloc_nmov (void)
   gpointer a;
 
   /* Test an alignment that’s not a multiple of sizeof(void*) */
-  a = g_aligned_alloc (16, sizeof(char), 4);
+  a = g_aligned_alloc (16, sizeof(char), sizeof(void *) / 2);
   g_assert_null (a);
   exit (0);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]