File: test_api_seap_number.c

package info (click to toggle)
openscap 1.0.9-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 129,588 kB
  • ctags: 26,325
  • sloc: xml: 611,156; ansic: 90,367; sh: 26,693; makefile: 2,463; python: 804; perl: 445; cpp: 123
file content (70 lines) | stat: -rw-r--r-- 1,718 bytes parent folder | download | duplicates (3)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <sexp.h>
#include <string.h>
#include <stdint.h>

int main (void)
{
        SEXP_t *s_exp;
        
        int8_t   i8 = -1;
        uint8_t  u8 =  1;
        int16_t  i16 = -32000;
        uint16_t u16 =  65000;
        int32_t  i32 = -100000;
        uint32_t u32 =  100000;
        int64_t  i64 = -1 * 1<<30;
        uint64_t u64 = (uint64_t)1 << 48;
        double   f   = 123.456;
        
        s_exp = SEXP_number_newi_8 (i8);
        SEXP_fprintfa (stdout, s_exp);
        putc('\n', stdout);
        SEXP_free (s_exp);

        s_exp = SEXP_number_newu_8 (u8);
        SEXP_fprintfa (stdout, s_exp);
        putc('\n', stdout);
        SEXP_free (s_exp);

        s_exp = SEXP_number_newi_16 (i16);
        SEXP_fprintfa (stdout, s_exp);
        putc('\n', stdout);
        SEXP_free (s_exp);

        s_exp = SEXP_number_newu_16 (u16);
        SEXP_fprintfa (stdout, s_exp);
        putc('\n', stdout);
        SEXP_free (s_exp);

        s_exp = SEXP_number_newi_32 (i32);
        SEXP_fprintfa (stdout, s_exp);
        putc('\n', stdout);
        SEXP_free (s_exp);

        s_exp = SEXP_number_newu_32 (u32);
        SEXP_fprintfa (stdout, s_exp);
        putc('\n', stdout);
        SEXP_free (s_exp);

        s_exp = SEXP_number_newi_64 (i64);
        SEXP_fprintfa (stdout, s_exp);
        putc('\n', stdout);
        SEXP_free (s_exp);

        s_exp = SEXP_number_newu_64 (u64);
        SEXP_fprintfa (stdout, s_exp);
        putc('\n', stdout);
        SEXP_free (s_exp);

        s_exp = SEXP_number_newf (f);
        SEXP_fprintfa (stdout, s_exp);
        putc('\n', stdout);
        SEXP_free (s_exp);
        
        return (0);
}