bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org
Subject: c32is*: Avoid test failures on MidnightBSD
Date: Sun, 07 Feb 2021 17:22:56 +0100	[thread overview]
Message-ID: <115196926.zuznfjxeYG@omega> (raw)

MidnightBSD is a FreeBSD derivative [1]. At the uname level, it identifies
itself as "MidnightBSD", but on the preprocessor level it merely defines
__FreeBSD__.

I see a couple of test failures on MidnightBSD 1.1:

FAIL: test-c32isalnum.sh
========================

../../gltests/test-c32isalnum.c:155: assertion 'is != 0' failed
Abort trap
FAIL test-c32isalnum.sh (exit status: 1)

FAIL: test-c32isalpha.sh
========================

../../gltests/test-c32isalpha.c:153: assertion 'is != 0' failed
Abort trap
FAIL test-c32isalpha.sh (exit status: 1)

FAIL: test-c32isblank.sh
========================

../../gltests/test-c32isblank.c:107: assertion 'is == 0' failed
Abort trap
FAIL test-c32isblank.sh (exit status: 1)

FAIL: test-c32islower.sh
========================

../../gltests/test-c32islower.c:162: assertion 'is != 0' failed
Abort trap
FAIL test-c32islower.sh (exit status: 1)

FAIL: test-c32isupper.sh
========================

../../gltests/test-c32isupper.c:157: assertion 'is != 0' failed
Abort trap
FAIL test-c32isupper.sh (exit status: 1)

This patch fixes them.

[1] https://en.wikipedia.org/wiki/MidnightBSD


2021-02-07  Bruno Haible  <bruno@clisp.org>

	c32is*: Avoid test failures on MidnightBSD.
	* tests/test-c32isalnum.c (main): On FreeBSD, disable tests that fail on
	MidnightBSD 1.1.
	* tests/test-c32isalpha.c (main): Likewise.
	* tests/test-c32isblank.c (main): Likewise.
	* tests/test-c32islower.c (main): Likewise.
	* tests/test-c32isupper.c (main): Likewise.

diff --git a/tests/test-c32isalnum.c b/tests/test-c32isalnum.c
index 3720810..8f61ad9 100644
--- a/tests/test-c32isalnum.c
+++ b/tests/test-c32isalnum.c
@@ -149,7 +149,7 @@ main (int argc, char *argv[])
           /* U+00D7 MULTIPLICATION SIGN */
           is = for_character ("\241\337", 2);
           ASSERT (is == 0);
-        #if !(defined __APPLE__ && defined __MACH__)
+        #if !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__)
           /* U+00D8 LATIN CAPITAL LETTER O WITH STROKE */
           is = for_character ("\217\251\254", 3);
           ASSERT (is != 0);
@@ -165,7 +165,7 @@ main (int argc, char *argv[])
           is = for_character ("\243\261", 2);
           ASSERT (is != 0);
         #endif
-        #if !((defined __APPLE__ && defined __MACH__) || defined __NetBSD__)
+        #if !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __NetBSD__)
           /* U+FF4D FULLWIDTH LATIN SMALL LETTER M */
           is = for_character ("\243\355", 2);
           ASSERT (is != 0);
diff --git a/tests/test-c32isalpha.c b/tests/test-c32isalpha.c
index 5be0178..9b07186 100644
--- a/tests/test-c32isalpha.c
+++ b/tests/test-c32isalpha.c
@@ -147,7 +147,7 @@ main (int argc, char *argv[])
           /* U+00D7 MULTIPLICATION SIGN */
           is = for_character ("\241\337", 2);
           ASSERT (is == 0);
-        #if !(defined __APPLE__ && defined __MACH__)
+        #if !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__)
           /* U+00D8 LATIN CAPITAL LETTER O WITH STROKE */
           is = for_character ("\217\251\254", 3);
           ASSERT (is != 0);
@@ -163,7 +163,7 @@ main (int argc, char *argv[])
           is = for_character ("\243\261", 2);
           ASSERT (is == 0);
         #endif
-        #if !((defined __APPLE__ && defined __MACH__) || defined __NetBSD__)
+        #if !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __NetBSD__)
           /* U+FF4D FULLWIDTH LATIN SMALL LETTER M */
           is = for_character ("\243\355", 2);
           ASSERT (is != 0);
diff --git a/tests/test-c32isblank.c b/tests/test-c32isblank.c
index 984d0d8..a615388 100644
--- a/tests/test-c32isblank.c
+++ b/tests/test-c32isblank.c
@@ -74,7 +74,7 @@ main (int argc, char *argv[])
       switch (c)
         {
         case '\t':
-        #if !defined __NetBSD__
+        #if !(defined __FreeBSD__ || defined __NetBSD__)
         case '\v':
         #endif
         case '\f':
diff --git a/tests/test-c32islower.c b/tests/test-c32islower.c
index 8bcffaf..0b811fd 100644
--- a/tests/test-c32islower.c
+++ b/tests/test-c32islower.c
@@ -156,12 +156,12 @@ main (int argc, char *argv[])
           /* U+00C9 LATIN CAPITAL LETTER E WITH ACUTE */
           is = for_character ("\217\252\261", 3);
           ASSERT (is == 0);
-        #if !((defined __APPLE__ && defined __MACH__) || defined __NetBSD__ || defined __CYGWIN__)
+        #if !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __NetBSD__ || defined __CYGWIN__)
           /* U+00DF LATIN SMALL LETTER SHARP S */
           is = for_character ("\217\251\316", 3);
           ASSERT (is != 0);
         #endif
-        #if !((defined __APPLE__ && defined __MACH__) || defined __NetBSD__)
+        #if !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __NetBSD__)
           /* U+00E9 LATIN SMALL LETTER E WITH ACUTE */
           is = for_character ("\217\253\261", 3);
           ASSERT (is != 0);
@@ -172,7 +172,7 @@ main (int argc, char *argv[])
           /* U+0141 LATIN CAPITAL LETTER L WITH STROKE */
           is = for_character ("\217\251\250", 3);
           ASSERT (is == 0);
-        #if !((defined __APPLE__ && defined __MACH__) || defined __NetBSD__)
+        #if !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __NetBSD__)
           /* U+0142 LATIN SMALL LETTER L WITH STROKE */
           is = for_character ("\217\251\310", 3);
           ASSERT (is != 0);
@@ -269,7 +269,7 @@ main (int argc, char *argv[])
           /* U+00B2 SUPERSCRIPT TWO */
           is = for_character ("\201\060\205\065", 4);
           ASSERT (is == 0);
-        #if !(defined __GLIBC__ || (defined __APPLE__ && defined __MACH__) || defined __NetBSD__)
+        #if !(defined __GLIBC__ || (defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __NetBSD__)
           /* U+00B5 MICRO SIGN */
           is = for_character ("\201\060\205\070", 4);
           ASSERT (is == 0);
diff --git a/tests/test-c32isupper.c b/tests/test-c32isupper.c
index 05b969d..5604a8f 100644
--- a/tests/test-c32isupper.c
+++ b/tests/test-c32isupper.c
@@ -151,7 +151,7 @@ main (int argc, char *argv[])
       case '2':
         /* Locale encoding is EUC-JP.  */
         {
-        #if !((defined __APPLE__ && defined __MACH__) || defined __NetBSD__)
+        #if !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __NetBSD__)
           /* U+00C9 LATIN CAPITAL LETTER E WITH ACUTE */
           is = for_character ("\217\252\261", 3);
           ASSERT (is != 0);
@@ -165,7 +165,7 @@ main (int argc, char *argv[])
           /* U+00FF LATIN SMALL LETTER Y WITH DIAERESIS */
           is = for_character ("\217\253\363", 3);
           ASSERT (is == 0);
-        #if !((defined __APPLE__ && defined __MACH__) || defined __NetBSD__)
+        #if !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __NetBSD__)
           /* U+0141 LATIN CAPITAL LETTER L WITH STROKE */
           is = for_character ("\217\251\250", 3);
           ASSERT (is != 0);



                 reply	other threads:[~2021-02-07 16:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=115196926.zuznfjxeYG@omega \
    --to=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).