tests: Improve 4GB file loading test to work on i386

This should test the limits of loading 4GB files on i386 platforms, such
as the Hurd CI runner. On such platforms, `sizeof(size_t) == 4`.

This should fix the compiler warning from
https://gitlab.gnome.org/GNOME/glib/-/jobs/3989442:
```
../gio/tests/file.c:2931:51: error: left shift count >= width of type [-Werror=shift-count-overflow]
 2931 | static const gsize testfile_4gb_size = ((gsize) 1 << 32) + (1 << 16); /* 4GB + a bit */
      |                                                   ^~
cc1: all warnings being treated as errors
```

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
Philip Withnall 2024-06-18 12:58:51 +01:00
parent 724709f022
commit b4085620c6
No known key found for this signature in database
GPG Key ID: DCDF5885B1F3ED73

View File

@ -2815,7 +2815,12 @@ test_load_bytes_async (void)
g_main_loop_unref (data.main_loop);
}
#if GLIB_SIZEOF_SIZE_T > 4
static const gsize testfile_4gb_size = ((gsize) 1 << 32) + (1 << 16); /* 4GB + a bit */
#else
/* Have to make do with something smaller on 32-bit platforms */
static const gsize testfile_4gb_size = G_MAXSIZE;
#endif
/* @filename will be modified as per g_mkstemp() */
static gboolean