[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: proposed new module intprops-test
From: |
Eric Blake |
Subject: |
Re: proposed new module intprops-test |
Date: |
Tue, 10 May 2011 11:07:15 -0600 |
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 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10 |
On 05/10/2011 10:57 AM, Paul Eggert wrote:
> Here's a proposed module to test 'intprops'. It assumes the revised
> patch for integer overflow checking that I emailed a few minutes ago.
>
> I don't know the recommended way to test this with gnulib-tool;
> I read the --help output and the documentation, but couldn't figure
> it out. I tested it by hand, though.
./gnulib-tool --with-tests --test intprops
> +/* TYPE_IS_INTEGER. */
...
> +verify (! TYPE_IS_INTEGER (long double));
Is TYPE_IS_INTEGER supposed to work on composite types? In which case,
should we add things like:
verify (! TYPE_IS_INTEGER (void *));
> +verify (TYPE_SIGNED (intmax_t));
> +verify (! TYPE_SIGNED (uintmax_t));
Does TYPE_SIGNED work on floating types? That is, should we add lines like:
verify (TYPE_SIGNED (double));
> +/* TYPE_MINIMUM, TYPE_MAXIMUM. */
> +verify (TYPE_MINIMUM (char) == CHAR_MIN);
> +/* INT_STRLEN_BOUND, INT_BUFSIZE_BOUND. */
> +#ifdef INT32_MAX
Isn't int32_t guaranteed by POSIX?
> +verify (INT_STRLEN_BOUND (int32_t) == sizeof ("-2147483648") - 1);
> +verify (INT_BUFSIZE_BOUND (int32_t) == sizeof ("-2147483648"));
> +#endif
> +#ifdef INT64_MAX
whereas I agree that int64_max is optional (but likely exists everywhere
these days, if via the gnulib replacements).
--
Eric Blake address@hidden +1-801-349-2682
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- proposed new module intprops-test, Paul Eggert, 2011/05/10
- Re: proposed new module intprops-test,
Eric Blake <=
- Re: proposed new module intprops-test, Paul Eggert, 2011/05/10
- Re: proposed new module intprops-test, Bruno Haible, 2011/05/18
- Re: proposed new module intprops-test, Paul Eggert, 2011/05/19
- Re: proposed new module intprops-test, Bruno Haible, 2011/05/19
- Re: proposed new module intprops-test, Paul Eggert, 2011/05/19
- Re: proposed new module intprops-test, Bruno Haible, 2011/05/20
- Re: proposed new module intprops-test, Paul Eggert, 2011/05/20