CompiletimeTest StdTypes

Test size and signedness of standard types like size_t, int16_t, ...

Summary
CompiletimeTest StdTypesTest size and signedness of standard types like size_t, int16_t, ...
CopyrightThis program is free software.
Files
C-kern/test/compiletime/stdtypes.hHeader file of CompiletimeTest StdTypes.
C-kern/api/test/compiletime.hIncluded from Compiletime-Tests.
sizeof(char) TestAsserts that sizeof(char) is 1 byte.
int_t TestAsserts that all integer standard types have the correct size and signedness.
limit TestAsserts that all application defined limits (OFF_MAX) of the standard types have the correct value.

Copyright

This program is free software.  You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.

Author

© 2011 Jörg Seebohn

Files

C-kern/test/compiletime/stdtypes.h

Header file of CompiletimeTest StdTypes.

C-kern/api/test/compiletime.h

Included from Compiletime-Tests.

sizeof(char) Test

Asserts that sizeof(char) is 1 byte.  Some components managing space rely uppon the fact that sizeof(cahr) is one.  Mostly used as a “+ 1” in sizeof calculations for storage size of strings.  Or in calculations where a string ius allocated after the a structure:

size_t memsize = sizeof(type_t) + strlen(string) + 1

int_t Test

Asserts that all integer standard types have the correct size and signedness.

limit Test

Asserts that all application defined limits (OFF_MAX) of the standard types have the correct value.

Test size and signedness of standard types like size_t, int16_t, ...
Includes all tests performed during compilation time.
#define OFF_MAX INT64_MAX
Declares the maximum value of type off_t.
Close