tests: Do not always skip array overflow checks

The preprocessor check for SIZE_WIDTH fails if stdint.h is not included.
Also, adjust the error messages for clarity.
This commit is contained in:
Tobias Stoeckmann
2025-07-15 20:26:13 +02:00
parent 1eabe6c6b1
commit 932ef1765c

View File

@@ -26,10 +26,11 @@
#undef G_DISABLE_ASSERT
#include "glib.h"
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "glib.h"
/* Test data to be passed to any function which calls g_array_new(), providing
* the parameters for that call. Most #GArray tests should be repeated for all
@@ -343,7 +344,7 @@ static void
array_new_take_overflow (void)
{
#if SIZE_WIDTH <= UINT_WIDTH
g_test_skip ("Overflow test requires UINT_WIDTH > SIZE_WIDTH.");
g_test_skip ("Overflow test requires SIZE_WIDTH > UINT_WIDTH.");
#else
if (!g_test_undefined ())
return;
@@ -1328,7 +1329,7 @@ static void
pointer_array_new_take_overflow (void)
{
#if SIZE_WIDTH <= UINT_WIDTH
g_test_skip ("Overflow test requires UINT_WIDTH > SIZE_WIDTH.");
g_test_skip ("Overflow test requires SIZE_WIDTH > UINT_WIDTH.");
#else
if (!g_test_undefined ())
return;
@@ -1633,7 +1634,7 @@ static void
pointer_array_new_from_array_overflow (void)
{
#if SIZE_WIDTH <= UINT_WIDTH
g_test_skip ("Overflow test requires UINT_WIDTH > SIZE_WIDTH.");
g_test_skip ("Overflow test requires SIZE_WIDTH > UINT_WIDTH.");
#else
if (!g_test_undefined ())
return;
@@ -2871,7 +2872,7 @@ static void
byte_array_new_take_overflow (void)
{
#if SIZE_WIDTH <= UINT_WIDTH
g_test_skip ("Overflow test requires G_MAXSIZE > G_MAXUINT.");
g_test_skip ("Overflow test requires SIZE_WIDTH > UINT_WIDTH.");
#else
GByteArray* arr;