summaryrefslogtreecommitdiffstats
path: root/testsuites/libtests/rbheap01/rbheap.doc
blob: bc64fb2679075099b0723940932140831ffbd711 (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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# SPDX-License-Identifier: BSD-2-Clause

#  COPYRIGHT (c) 2014.
#  On-Line Applications Research Corporation (OAR).
#  Cynthia Rempel <cynthia@rtems.org>
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
This file describes the directives and concepts tested by this test set.

test set name: rbheap01

test_init_chunk_alignment:

test_init_begin_greater_than_end:
directives:
  + rtems_rbheap_initialize

concepts:
  + verifies RTEMS_INVALID_ADDRESS is returned when the beginning address is
    larger than the ending address.

test_init_begin_greater_than_aligned_begin:
directives:
  + rtems_rbheap_initialize

concepts:
  + verifies RTEMS_INVALID_ADDRESS is returned when the beginning address has a
    negative offset from an address aligned with the pagesize.

test_init_aligned_begin_greater_than_aligned_end:
directives:
  + rtems_rbheap_initialize

concepts:
  + verifies RTEMS_INVALID_ADDRESS is returned when the beginning address has a
    positive offset from the ending address.

test_init_empty_descriptors:
directives:
  + rtems_rbheap_initialize

concepts:
  + verifies RTEMS_NO_MEMORY is returned when attempting to initialize an rbtree
    to an empty descriptor

test_alloc_and_free_one:
directives:
  + rtems_rbheap_allocate
  + rtems_rbheap_free

concepts:
  + allocates and frees a red-black-tree

test_alloc_zero:
directives:
  + rtems_rbheap_allocate

concepts:
  + verifies that the allocating no memory for a red-black-tree returns a
    NULL pointer

test_alloc_huge_chunk:
directives:
  + rtems_rbheap_allocate

concepts:
  + verifies that the allocating more memory than is available for a
    red-black-tree returns a NULL pointer

test_alloc_one_chunk:
directives:
  + rtems_rbheap_allocate
  + rtems_rbheap_free

concepts:
  + verifies that allocating one chunk of memory from an rbheap returns memory
  + verifies that one chunk of memory can be freed

test_alloc_many_chunks:
directives:
  + rtems_rbheap_allocate
  + rtems_rbheap_free

concepts:
  + verifies that allocating eight (8) chunks of memory from an rbheap returns
    memory
  + verifies that one chunk of memory can be freed

test_alloc_misaligned:
directives:
  + rtems_rbheap_allocate

concepts:
  + verifies that rtems_rbheap_allocate returns NULL (does not allocate memory)
    if the size allocated is not aligned with the pagesize

test_alloc_with_malloc_extend:
directives:
  + rtems_rbheap_allocate
  + rtems_rbheap_initialize
  + rtems_heap_greedy_allocate
  + rtems_heap_greedy_free

concepts:
  + allocate as much memory as possible
  + verify no more can be allocated
  + free as much memory as possible
  + verify memory can be allocated again

test_free_null:
directives:
  + rtems_rbheap_free

concepts:
  + verify RTEMS_SUCCESSFUL is returned when freeing a NULL pointer

test_free_invalid:
directives:
  + rtems_rbheap_free

concepts:
  + verifies freeing a non-zero rbheap fails with RTEMS_INVALID_ID

test_free_double:
directives:
  + rtems_rbheap_allocate
  + rtems_rbheap_free

concepts:
  + verifies allocating an rbheap returns memory
  + verifies freeing a heap twice fails with RTEMS_INCORRECT_STATE

test_free_merge_left_or_right:

NOTE: test_free_merge_left_or_right should probably be broken into
test_free_merge_left and test_free_merge_right...

directives:
  + rtems_rbheap_allocate
  + rtems_rbheap_free

concepts:
  + allocates 5 rbheaps and frees memory in different ways

TODO: break into different tests