1
0
mirror of https://git.savannah.gnu.org/git/gnulib.git synced 2026-10-24 00:48:56 +03:00

tests: Avoid some more runtime errors with Fil-C.

* tests/test-c32ispunct.c (main): Skip a test case that fails on Fil-C.
* tests/test-free.c (main): Avoid converting from a pointer to uintptr_t
and back.
* tests/test-explicit_bzero.c (test_heap): Skip this test on Fil-C.
* tests/test-memset_explicit.c (test_heap): Likewise.
* tests/test-sigsegv-catch-segv1.c: Skip the entire test on Fil-C, since
it relies on converting an uintptr_t value to a pointer.
* tests/test-sigsegv-catch-segv2.c: Likewise.
This commit is contained in:
Bruno Haible
2026-07-28 22:37:55 +02:00
parent fe23958753
commit c7b777b265
7 changed files with 28 additions and 10 deletions

View File

@@ -1,3 +1,15 @@
2026-07-28 Bruno Haible <bruno@clisp.org>
tests: Avoid some more runtime errors with Fil-C.
* tests/test-c32ispunct.c (main): Skip a test case that fails on Fil-C.
* tests/test-free.c (main): Avoid converting from a pointer to uintptr_t
and back.
* tests/test-explicit_bzero.c (test_heap): Skip this test on Fil-C.
* tests/test-memset_explicit.c (test_heap): Likewise.
* tests/test-sigsegv-catch-segv1.c: Skip the entire test on Fil-C, since
it relies on converting an uintptr_t value to a pointer.
* tests/test-sigsegv-catch-segv2.c: Likewise.
2026-07-28 Paul Eggert <eggert@cs.ucla.edu>
Bruno Haible <bruno@clisp.org>

View File

@@ -255,7 +255,7 @@ main (int argc, char *argv[])
is = for_character ("\360\235\204\200", 4);
ASSERT (is != 0);
#endif
#if !(defined __GLIBC__ || (defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ || defined _AIX || defined __sun || defined __CYGWIN__ || (defined _WIN32 && !defined __CYGWIN__) || defined __ANDROID__)
#if !(defined __GLIBC__ || (defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ || defined _AIX || defined __sun || defined __CYGWIN__ || (defined _WIN32 && !defined __CYGWIN__) || defined __ANDROID__ || defined __FILC__)
/* U+E003A TAG COLON */
is = for_character ("\363\240\200\272", 4);
ASSERT (is == 0);

View File

@@ -61,11 +61,14 @@ test_static (void)
/* =============== Verify operation on heap-allocated memory =============== */
/* Skip this part when an address sanitizer is in use, because it would report
a "heap use after free". */
a "heap use after free".
Skip it also with Fil-C, because that environment does not support the
conversion of uintptr_t to a pointer or the re-use of a freed pointer. */
#ifndef __has_feature
# define __has_feature(a) 0
#endif
#if defined __SANITIZE_ADDRESS__ || __has_feature (address_sanitizer)
#if defined __SANITIZE_ADDRESS__ || __has_feature (address_sanitizer) \
|| defined __FILC__
static void
test_heap (void)
@@ -141,7 +144,7 @@ test_heap (void)
printf ("test_heap: address range is unmapped after free().\n");
}
#endif /* ! address sanitizer enabled */
#endif /* ! (address sanitizer enabled || Fil-C) */
/* =============== Verify operation on stack-allocated memory =============== */

View File

@@ -131,7 +131,7 @@ main ()
/* Do a large memory allocation. */
size_t big_size = 0x1000000;
void *ptr = malloc (big_size - 0x100);
char *ptr_aligned = (char *) ((uintptr_t) ptr & ~(pagesize - 1));
char *ptr_aligned = (char *) ptr - ((uintptr_t) ptr & (pagesize - 1));
/* This large memory allocation allocated a memory area
from ptr_aligned to ptr_aligned + big_size.
Enlarge this memory area by adding a page before and a page

View File

@@ -87,11 +87,14 @@ test_static (void)
/* =============== Verify operation on heap-allocated memory =============== */
/* Skip this part when an address sanitizer is in use, because it would report
a "heap use after free". */
a "heap use after free".
Skip it also with Fil-C, because that environment does not support the
conversion of uintptr_t to a pointer or the re-use of a freed pointer. */
#ifndef __has_feature
# define __has_feature(a) 0
#endif
#if defined __SANITIZE_ADDRESS__ || __has_feature (address_sanitizer)
#if defined __SANITIZE_ADDRESS__ || __has_feature (address_sanitizer) \
|| defined __FILC__
static void
test_heap (void)
@@ -167,7 +170,7 @@ test_heap (void)
printf ("test_heap: address range is unmapped after free().\n");
}
#endif /* ! address sanitizer enabled */
#endif /* ! (address sanitizer enabled || Fil-C) */
/* =============== Verify operation on stack-allocated memory =============== */

View File

@@ -24,7 +24,7 @@
#include <stdint.h>
#include <stdio.h>
#if HAVE_SIGSEGV_RECOVERY
#if HAVE_SIGSEGV_RECOVERY && !defined __FILC__
# include "mmap-anon-util.h"
# include <stdlib.h>

View File

@@ -24,7 +24,7 @@
#include <stdint.h>
#include <stdio.h>
#if HAVE_SIGSEGV_RECOVERY
#if HAVE_SIGSEGV_RECOVERY && !defined __FILC__
# if defined _WIN32 && !defined __CYGWIN__
/* Windows doesn't have sigset_t. */