summaryrefslogtreecommitdiffstats
path: root/spec/testsuites/validation/c-library.yml
blob: 4514917595be1728277afce931c9854b60fff39b (plain) (blame)
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
copyrights:
- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
enabled-by: true
links: []
test-actions:
- action: |
    void *p;

    p = aligned_alloc(128, 4);
  checks:
  - check: |
      T_step_not_null(${step}, p);
    description: |
      Check that the returned pointer is not NULL.
    links: []
  - check: |
      T_step_eq_uptr(${step}, (uintptr_t) p % 128, 0);
    description: |
      Check that the returned pointer is aligned by 128 bytes.
    links: []
  description: |
    Allocate four bytes with an alignment of 128 bytes with aligned_alloc().
  links: []
- action: |
    void *p;

    p = rtems_malloc(4);
  checks:
  - check: |
      T_step_not_null(${step}, p);
    description: |
      Check that the returned pointer is not NULL.
    links: []
  description: |
    Allocate four bytes with rtems_malloc().
  links: []
- action: |
    int d;

    d = 1;
    memset(&d, 0, sizeof(d));
  checks:
  - check: |
      T_step_eq_int(${step}, d, 0);
    description: |
      Check that the integer variable is equal to zero.
    links: []
  description: |
    Set an integer variable to one and then to zero with memset().
  links: []
- action: |
    int s;
    int d;

    s = 1;
    d = 2;
    memcpy(&d, &s, sizeof(d));
  checks:
  - check: |
      T_step_eq_int(${step}, d, 1);
    description: |
      Check that the destination integer variable is equal to one.
    links: []
  description: |
    Set a source integer variable to one, set a destination integer variable to
    two, and copy the source to the destination variable through memcpy().
  links: []
test-brief: |
  This test case calls functions of the C Library which are included in the
  space profile.
test-context: []
test-context-support: null
test-description: null
test-header: null
test-includes:
- rtems.h
- stdlib.h
- rtems/malloc.h
test-local-includes: []
test-setup: null
test-stop: null
test-support: null
test-target: testsuites/validation/tc-space-profile.c
test-teardown: null
type: test-case