bug-gnulib
[Top][All Lists]
Advanced

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

Re: proposed new module intprops-test


From: Paul Eggert
Subject: Re: proposed new module intprops-test
Date: Tue, 10 May 2011 12:50:14 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Thunderbird/3.1.10

On 05/10/11 10:07, Eric Blake wrote:

> ./gnulib-tool --with-tests --test intprops

Thanks, I ran that and it worked.

> verify (! TYPE_IS_INTEGER (void *));

No, TYPE_IS_INTEGER is defined only for arithmetic types, so I left
that alone.

> verify (TYPE_SIGNED (double));

Thanks, I added that (see below).

> Isn't int32_t guaranteed by POSIX?

Yes, though the #ifdef doesn't hurt.  I added a comment about that.

>From 14b9b935e021650830394757d6c6d89c0306f11a Mon Sep 17 00:00:00 2001
From: Paul Eggert <address@hidden>
Date: Tue, 10 May 2011 12:45:50 -0700
Subject: [PATCH] * tests/test-intprops.c (TYPE_SIGNED): Also check floating
 types.

---
 tests/test-intprops.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/tests/test-intprops.c b/tests/test-intprops.c
index f0d6437..f414c34 100644
--- a/tests/test-intprops.c
+++ b/tests/test-intprops.c
@@ -60,6 +60,9 @@ verify (TYPE_SIGNED (long int));
 verify (! TYPE_SIGNED (unsigned long int));
 verify (TYPE_SIGNED (intmax_t));
 verify (! TYPE_SIGNED (uintmax_t));
+verify (TYPE_SIGNED (float));
+verify (TYPE_SIGNED (double));
+verify (TYPE_SIGNED (long double));
 
 /* TYPE_MINIMUM, TYPE_MAXIMUM.  */
 verify (TYPE_MINIMUM (char) == CHAR_MIN);
@@ -90,7 +93,7 @@ verify (INT_BITS_STRLEN_BOUND (1) == 1);
 verify (INT_BITS_STRLEN_BOUND (2620) == 789);
 
 /* INT_STRLEN_BOUND, INT_BUFSIZE_BOUND.  */
-#ifdef INT32_MAX
+#ifdef INT32_MAX /* POSIX guarantees int32_t; this ports to non-POSIX hosts */
 verify (INT_STRLEN_BOUND (int32_t) == sizeof ("-2147483648") - 1);
 verify (INT_BUFSIZE_BOUND (int32_t) == sizeof ("-2147483648"));
 #endif
-- 
1.7.4.4





reply via email to

[Prev in Thread] Current Thread [Next in Thread]