Ocean
Loading...
Searching...
No Matches
TestStaticVector.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#ifndef META_OCEAN_TEST_TESTBASE_TEST_STATIC_VECTOR_H
9#define META_OCEAN_TEST_TESTBASE_TEST_STATIC_VECTOR_H
10
13
15
16namespace Ocean
17{
18
19namespace Test
20{
21
22namespace TestBase
23{
24
25/**
26 * This class implements tests for StaticVector.
27 * @ingroup testbase
28 */
29class OCEAN_TEST_BASE_EXPORT TestStaticVector
30{
31 public:
32
33 /**
34 * Invokes all tests.
35 * @param testDuration Number of seconds for each test, with range (0, infinity)
36 * @param selector The test selector to filter specific tests
37 * @return True, if succeeded
38 */
39 static bool test(const double testDuration, const TestSelector& selector = TestSelector());
40
41 /**
42 * Tests the constructor functions.
43 * @param testDuration Number of seconds for each test, with range (0, infinity)
44 * @return True, if succeeded
45 */
46 static bool testConstructor(const double testDuration);
47
48 /**
49 * Tests the access functions.
50 * @param testDuration Number of seconds for each test, with range (0, infinity)
51 * @return True, if succeeded
52 */
53 static bool testAccess(const double testDuration);
54
55 /**
56 * Tests the clear function.
57 * @param testDuration Number of seconds for each test, with range (0, infinity)
58 * @return True, if succeeded
59 */
60 static bool testClear(const double testDuration);
61
62 /**
63 * Tests the resize functions.
64 * @param testDuration Number of seconds for each test, with range (0, infinity)
65 * @return True, if succeeded
66 */
67 static bool testResize(const double testDuration);
68
69 /**
70 * Tests the comparison functions.
71 * @param testDuration Number of seconds for each test, with range (0, infinity)
72 * @return True, if succeeded
73 */
74 static bool testComparison(const double testDuration);
75
76 /**
77 * Tests the pushBack functions.
78 * @param testDuration Number of seconds for each test, with range (0, infinity)
79 * @return True, if succeeded
80 */
81 static bool testPushBack(const double testDuration);
82
83 /**
84 * Tests the emplaceBack functions.
85 * @param testDuration Number of seconds for each test, with range (0, infinity)
86 * @return True, if succeeded
87 */
88 static bool testEmplaceBack(const double testDuration);
89
90 /**
91 * Tests the popBack functions.
92 * @param testDuration Number of seconds for each test, with range (0, infinity)
93 * @return True, if succeeded
94 */
95 static bool testPopBack(const double testDuration);
96
97 /**
98 * Tests the erase functions.
99 * @param testDuration Number of seconds for each test, with range (0, infinity)
100 * @return True, if succeeded
101 */
102 static bool testErase(const double testDuration);
103
104 /**
105 * Tests the iterator functions (begin/end) and range-based for loops.
106 * @param testDuration Number of seconds for each test, with range (0, infinity)
107 * @return True, if succeeded
108 */
109 static bool testIterator(const double testDuration);
110
111 protected:
112
113 /**
114 * Tests the constructor functions.
115 * @param randomGenerator The random generator to be used
116 * @return True, if succeeded
117 * @tparam T The data type of the buffer
118 * @tparam tCapacity The capacity of the buffer, with range [1, infinity)
119 */
120 template <typename T, size_t tCapacity>
121 static bool testConstructor(RandomGenerator& randomGenerator);
122
123 /**
124 * Tests the access functions.
125 * @param randomGenerator The random generator to be used
126 * @return True, if succeeded
127 * @tparam T The data type of the buffer
128 * @tparam tCapacity The capacity of the buffer, with range [1, infinity)
129 */
130 template <typename T, size_t tCapacity>
131 static bool testAccess(RandomGenerator& randomGenerator);
132
133 /**
134 * Tests the clear function.
135 * @param randomGenerator The random generator to be used
136 * @return True, if succeeded
137 * @tparam T The data type of the buffer
138 * @tparam tCapacity The capacity of the buffer, with range [1, infinity)
139 */
140 template <typename T, size_t tCapacity>
141 static bool testClear(RandomGenerator& randomGenerator);
142
143 /**
144 * Tests the resize functions.
145 * @param randomGenerator The random generator to be used
146 * @return True, if succeeded
147 * @tparam T The data type of the buffer
148 * @tparam tCapacity The capacity of the buffer, with range [1, infinity)
149 */
150 template <typename T, size_t tCapacity>
151 static bool testResize(RandomGenerator& randomGenerator);
152
153 /**
154 * Tests the comparison functions.
155 * @param randomGenerator The random generator to be used
156 * @return True, if succeeded
157 * @tparam T The data type of the buffer
158 * @tparam tCapacity The capacity of the buffer, with range [1, infinity)
159 */
160 template <typename T, size_t tCapacity>
161 static bool testComparison(RandomGenerator& randomGenerator);
162
163 /**
164 * Tests the pushBack functions.
165 * @param randomGenerator The random generator to be used
166 * @return True, if succeeded
167 * @tparam T The data type of the buffer
168 * @tparam tCapacity The capacity of the buffer, with range [1, infinity)
169 */
170 template <typename T, size_t tCapacity>
171 static bool testPushBack(RandomGenerator& randomGenerator);
172
173 /**
174 * Tests the emplaceBack functions.
175 * @param randomGenerator The random generator to be used
176 * @return True, if succeeded
177 * @tparam T The data type of the buffer
178 * @tparam tCapacity The capacity of the buffer, with range [1, infinity)
179 */
180 template <typename T, size_t tCapacity>
181 static bool testEmplaceBack(RandomGenerator& randomGenerator);
182
183 /**
184 * Tests the popBack functions.
185 * @param randomGenerator The random generator to be used
186 * @return True, if succeeded
187 * @tparam T The data type of the buffer
188 * @tparam tCapacity The capacity of the buffer, with range [1, infinity)
189 */
190 template <typename T, size_t tCapacity>
191 static bool testPopBack(RandomGenerator& randomGenerator);
192
193 /**
194 * Tests the erase functions.
195 * @param randomGenerator The random generator to be used
196 * @return True, if succeeded
197 * @tparam T The data type of the buffer
198 * @tparam tCapacity The capacity of the buffer, with range [1, infinity)
199 */
200 template <typename T, size_t tCapacity>
201 static bool testErase(RandomGenerator& randomGenerator);
202
203 /**
204 * Tests the iterator functions (begin/end) and range-based for loops.
205 * @param randomGenerator The random generator to be used
206 * @return True, if succeeded
207 * @tparam T The data type of the buffer
208 * @tparam tCapacity The capacity of the buffer, with range [1, infinity)
209 */
210 template <typename T, size_t tCapacity>
211 static bool testIterator(RandomGenerator& randomGenerator);
212};
213
214}
215
216}
217
218}
219
220#endif // META_OCEAN_TEST_TESTBASE_TEST_STATIC_VECTOR_H
This class implements a generator for random numbers.
Definition RandomGenerator.h:42
This class implements tests for StaticVector.
Definition TestStaticVector.h:30
static bool testComparison(const double testDuration)
Tests the comparison functions.
static bool testAccess(RandomGenerator &randomGenerator)
Tests the access functions.
static bool testAccess(const double testDuration)
Tests the access functions.
static bool test(const double testDuration, const TestSelector &selector=TestSelector())
Invokes all tests.
static bool testConstructor(const double testDuration)
Tests the constructor functions.
static bool testPopBack(const double testDuration)
Tests the popBack functions.
static bool testComparison(RandomGenerator &randomGenerator)
Tests the comparison functions.
static bool testPushBack(const double testDuration)
Tests the pushBack functions.
static bool testErase(RandomGenerator &randomGenerator)
Tests the erase functions.
static bool testEmplaceBack(const double testDuration)
Tests the emplaceBack functions.
static bool testEmplaceBack(RandomGenerator &randomGenerator)
Tests the emplaceBack functions.
static bool testClear(RandomGenerator &randomGenerator)
Tests the clear function.
static bool testPopBack(RandomGenerator &randomGenerator)
Tests the popBack functions.
static bool testIterator(const double testDuration)
Tests the iterator functions (begin/end) and range-based for loops.
static bool testIterator(RandomGenerator &randomGenerator)
Tests the iterator functions (begin/end) and range-based for loops.
static bool testErase(const double testDuration)
Tests the erase functions.
static bool testClear(const double testDuration)
Tests the clear function.
static bool testResize(RandomGenerator &randomGenerator)
Tests the resize functions.
static bool testPushBack(RandomGenerator &randomGenerator)
Tests the pushBack functions.
static bool testResize(const double testDuration)
Tests the resize functions.
static bool testConstructor(RandomGenerator &randomGenerator)
Tests the constructor functions.
This class implements a test selector that parses test function strings and determines which tests sh...
Definition TestSelector.h:51
The namespace covering the entire Ocean framework.
Definition Accessor.h:15