Blame view

build6/epsilon-master/liba/test/stdint.c 781 Bytes
6663b6c9   adorian   projet complet av...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
  #include <quiz.h>
  #include <stdint.h>
  #include <assert.h>
  #include "helpers.h"
  
  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);
  
    assert(sizeof(uintptr_t) == sizeof(void *));
    assert(sizeof(intptr_t) == sizeof(void *));
  }
  
  QUIZ_CASE(liba_stdint_signedness) {
    assert_signed(int8_t);
    assert_signed(int16_t);
    assert_signed(int32_t);
    assert_signed(int64_t);
  
    assert_unsigned(uint8_t);
    assert_unsigned(uint16_t);
    assert_unsigned(uint32_t);
    assert_unsigned(uint64_t);
  
    assert_signed(intptr_t);
    assert_unsigned(uintptr_t);
  }