Back to home page

LXR

 
 

    


Warning, /testsuites/libtests/rbheap01/rbheap.doc is written in an unsupported language. File is not indexed.

0001 # SPDX-License-Identifier: BSD-2-Clause
0002 
0003 #  COPYRIGHT (c) 2014.
0004 #  On-Line Applications Research Corporation (OAR).
0005 #  Cynthia Rempel <cynthia@rtems.org>
0006 # Redistribution and use in source and binary forms, with or without
0007 # modification, are permitted provided that the following conditions
0008 # are met:
0009 # 1. Redistributions of source code must retain the above copyright
0010 #    notice, this list of conditions and the following disclaimer.
0011 # 2. Redistributions in binary form must reproduce the above copyright
0012 #    notice, this list of conditions and the following disclaimer in the
0013 #    documentation and/or other materials provided with the distribution.
0014 #
0015 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0016 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0017 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0018 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
0019 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0020 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0021 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0022 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
0023 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0024 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
0025 # POSSIBILITY OF SUCH DAMAGE.
0026 #
0027 This file describes the directives and concepts tested by this test set.
0028 
0029 test set name: rbheap01
0030 
0031 test_init_chunk_alignment:
0032 
0033 test_init_begin_greater_than_end:
0034 directives:
0035   + rtems_rbheap_initialize
0036 
0037 concepts:
0038   + verifies RTEMS_INVALID_ADDRESS is returned when the beginning address is
0039     larger than the ending address.
0040 
0041 test_init_begin_greater_than_aligned_begin:
0042 directives:
0043   + rtems_rbheap_initialize
0044 
0045 concepts:
0046   + verifies RTEMS_INVALID_ADDRESS is returned when the beginning address has a
0047     negative offset from an address aligned with the pagesize.
0048 
0049 test_init_aligned_begin_greater_than_aligned_end:
0050 directives:
0051   + rtems_rbheap_initialize
0052 
0053 concepts:
0054   + verifies RTEMS_INVALID_ADDRESS is returned when the beginning address has a
0055     positive offset from the ending address.
0056 
0057 test_init_empty_descriptors:
0058 directives:
0059   + rtems_rbheap_initialize
0060 
0061 concepts:
0062   + verifies RTEMS_NO_MEMORY is returned when attempting to initialize an rbtree
0063     to an empty descriptor
0064 
0065 test_alloc_and_free_one:
0066 directives:
0067   + rtems_rbheap_allocate
0068   + rtems_rbheap_free
0069 
0070 concepts:
0071   + allocates and frees a red-black-tree
0072 
0073 test_alloc_zero:
0074 directives:
0075   + rtems_rbheap_allocate
0076 
0077 concepts:
0078   + verifies that the allocating no memory for a red-black-tree returns a
0079     NULL pointer
0080 
0081 test_alloc_huge_chunk:
0082 directives:
0083   + rtems_rbheap_allocate
0084 
0085 concepts:
0086   + verifies that the allocating more memory than is available for a
0087     red-black-tree returns a NULL pointer
0088 
0089 test_alloc_one_chunk:
0090 directives:
0091   + rtems_rbheap_allocate
0092   + rtems_rbheap_free
0093 
0094 concepts:
0095   + verifies that allocating one chunk of memory from an rbheap returns memory
0096   + verifies that one chunk of memory can be freed
0097 
0098 test_alloc_many_chunks:
0099 directives:
0100   + rtems_rbheap_allocate
0101   + rtems_rbheap_free
0102 
0103 concepts:
0104   + verifies that allocating eight (8) chunks of memory from an rbheap returns
0105     memory
0106   + verifies that one chunk of memory can be freed
0107 
0108 test_alloc_misaligned:
0109 directives:
0110   + rtems_rbheap_allocate
0111 
0112 concepts:
0113   + verifies that rtems_rbheap_allocate returns NULL (does not allocate memory)
0114     if the size allocated is not aligned with the pagesize
0115 
0116 test_alloc_with_malloc_extend:
0117 directives:
0118   + rtems_rbheap_allocate
0119   + rtems_rbheap_initialize
0120   + rtems_heap_greedy_allocate
0121   + rtems_heap_greedy_free
0122 
0123 concepts:
0124   + allocate as much memory as possible
0125   + verify no more can be allocated
0126   + free as much memory as possible
0127   + verify memory can be allocated again
0128 
0129 test_free_null:
0130 directives:
0131   + rtems_rbheap_free
0132 
0133 concepts:
0134   + verify RTEMS_SUCCESSFUL is returned when freeing a NULL pointer
0135 
0136 test_free_invalid:
0137 directives:
0138   + rtems_rbheap_free
0139 
0140 concepts:
0141   + verifies freeing a non-zero rbheap fails with RTEMS_INVALID_ID
0142 
0143 test_free_double:
0144 directives:
0145   + rtems_rbheap_allocate
0146   + rtems_rbheap_free
0147 
0148 concepts:
0149   + verifies allocating an rbheap returns memory
0150   + verifies freeing a heap twice fails with RTEMS_INCORRECT_STATE
0151 
0152 test_free_merge_left_or_right:
0153 
0154 NOTE: test_free_merge_left_or_right should probably be broken into
0155 test_free_merge_left and test_free_merge_right...
0156 
0157 directives:
0158   + rtems_rbheap_allocate
0159   + rtems_rbheap_free
0160 
0161 concepts:
0162   + allocates 5 rbheaps and frees memory in different ways
0163 
0164 TODO: break into different tests