mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[liba] stdint size checks
This commit is contained in:
@@ -7,6 +7,7 @@ typedef unsigned long uint32_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
|
||||
typedef signed char int8_t;
|
||||
typedef signed int int16_t;
|
||||
typedef signed long int32_t;
|
||||
typedef signed long long int64_t;
|
||||
|
||||
|
||||
@@ -2,11 +2,28 @@
|
||||
#include <stdint.h>
|
||||
#include <assert.h>
|
||||
|
||||
QUIZ_CASE(liba_stdint) {
|
||||
int8_t i = -1;
|
||||
int j = -1;
|
||||
assert(i == -1);
|
||||
assert(i == j);
|
||||
QUIZ_CASE(liba_stdint_size) {
|
||||
assert(sizeof(uint8_t) == 1);
|
||||
assert(sizeof(uint16_t) == 2);
|
||||
assert(sizeof(uint32_t) == 4);
|
||||
assert(sizeof(uint64_t) == 8);
|
||||
|
||||
assert(sizeof(int8_t) == 1);
|
||||
assert(sizeof(int16_t) == 2);
|
||||
assert(sizeof(int32_t) == 4);
|
||||
assert(sizeof(int64_t) == 8);
|
||||
}
|
||||
|
||||
QUIZ_CASE(liba_stdint_signedness) {
|
||||
int8_t i8 = -1;
|
||||
assert(i8 == -1);
|
||||
|
||||
int16_t i16 = -1;
|
||||
assert(i16 == -1);
|
||||
|
||||
int32_t i32 = -1;
|
||||
assert(i32 == -1);
|
||||
|
||||
int64_t i64 = -1;
|
||||
assert(i64 == -1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user