Page MenuHomeFreeBSD

libc/tests: add test for *_MAX, *_MIN, and *_WIDTH
Needs ReviewPublic

Authored by fuz on Wed, Nov 19, 7:28 PM.
Tags
None
Referenced Files
F137244763: D53831.id166796.diff
Fri, Nov 21, 6:43 PM
F137244760: D53831.id.diff
Fri, Nov 21, 6:43 PM
F137244234: D53831.diff
Fri, Nov 21, 6:34 PM
Unknown Object (File)
Thu, Nov 20, 4:11 AM
Unknown Object (File)
Thu, Nov 20, 1:44 AM
Unknown Object (File)
Thu, Nov 20, 1:42 AM
Unknown Object (File)
Thu, Nov 20, 1:36 AM
Unknown Object (File)
Wed, Nov 19, 11:55 PM
Subscribers
None

Details

Reviewers
markj
imp
Summary

This file checks the correctness of the various _MAX, _MIN, and
_WIDTH macros defined for the libc types. It assumes that none
of the types have padding bits.

Test Plan

this is the test for D53830

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 68745
Build 65628: arc lint + arc unit

Event Timeline

fuz requested review of this revision.Wed, Nov 19, 7:28 PM
fuz created this revision.

This looks like it's really testing the host's (cross-)build environment. That seems useful, but it's not the same as testing the installation itself, e.g., a test could invoke cc to compile this file or something similar and verify that it succeeded. Should we do both? Is there some reason this test on its own is sufficient?

This looks like it's really testing the host's (cross-)build environment. That seems useful, but it's not the same as testing the installation itself, e.g., a test could invoke cc to compile this file or something similar and verify that it succeeded. Should we do both? Is there some reason this test on its own is sufficient?

The point of this test is to check that I got the definitions right, as we do them manually. We could actually use compiler builtins for the various sys/$ARCH/include files to directly grab the types from the C compiler, but we don't. So the point is to check if what I added to the headers matches what the compiler thinks the type sizes and ranges should be. As we use the same compiler for cross-building as we install on the target, I don't see why adding another set of tests would add more certainty.