Ocean
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 
12 
14 
15 namespace Ocean
16 {
17 
18 namespace Test
19 {
20 
21 namespace TestBase
22 {
23 
24 /**
25  * This class implements tests for StaticVector.
26  * @ingroup testbase
27  */
28 class OCEAN_TEST_BASE_EXPORT TestStaticVector
29 {
30  public:
31 
32  /**
33  * Invokes all tests.
34  * @param testDuration Number of seconds for each test, with range (0, infinity)
35  * @return True, if succeeded
36  */
37  static bool test(const double testDuration);
38 
39  /**
40  * Tests the constructor functions.
41  * @param testDuration Number of seconds for each test, with range (0, infinity)
42  * @return True, if succeeded
43  */
44  static bool testConstructor(const double testDuration);
45 
46  /**
47  * Tests the access functions.
48  * @param testDuration Number of seconds for each test, with range (0, infinity)
49  * @return True, if succeeded
50  */
51  static bool testAccess(const double testDuration);
52 
53  /**
54  * Tests the clear function.
55  v
56  * @return True, if succeeded
57  */
58  static bool testClear(const double testDuration);
59 
60  /**
61  * Tests the resize functions.
62  * @param testDuration Number of seconds for each test, with range (0, infinity)
63  * @return True, if succeeded
64  */
65  static bool testResize(const double testDuration);
66 
67  /**
68  * Tests the comparison functions.
69  * @param testDuration Number of seconds for each test, with range (0, infinity)
70  * @return True, if succeeded
71  */
72  static bool testComparison(const double testDuration);
73 
74  protected:
75 
76  /**
77  * Tests the constructor functions.
78  * @param randomGenerator The random generator to be used
79  * @return True, if succeeded
80  * @tparam T The data type of the buffer
81  * @tparam tCapacity The capacity of the buffer, with range [1, infinity)
82  */
83  template <typename T, size_t tCapacity>
84  static bool testConstructor(RandomGenerator& randomGenerator);
85 
86  /**
87  * Tests the access functions.
88  * @param randomGenerator The random generator to be used
89  * @return True, if succeeded
90  * @tparam T The data type of the buffer
91  * @tparam tCapacity The capacity of the buffer, with range [1, infinity)
92  */
93  template <typename T, size_t tCapacity>
94  static bool testAccess(RandomGenerator& randomGenerator);
95 
96  /**
97  * Tests the clear function.
98  * @param randomGenerator The random generator to be used
99  * @return True, if succeeded
100  * @tparam T The data type of the buffer
101  * @tparam tCapacity The capacity of the buffer, with range [1, infinity)
102  */
103  template <typename T, size_t tCapacity>
104  static bool testClear(RandomGenerator& randomGenerator);
105 
106  /**
107  * Tests the resize functions.
108  * @param randomGenerator The random generator to be used
109  * @return True, if succeeded
110  * @tparam T The data type of the buffer
111  * @tparam tCapacity The capacity of the buffer, with range [1, infinity)
112  */
113  template <typename T, size_t tCapacity>
114  static bool testResize(RandomGenerator& randomGenerator);
115 
116  /**
117  * Tests the comparison functions.
118  * @param randomGenerator The random generator to be used
119  * @return True, if succeeded
120  * @tparam T The data type of the buffer
121  * @tparam tCapacity The capacity of the buffer, with range [1, infinity)
122  */
123  template <typename T, size_t tCapacity>
124  static bool testComparison(RandomGenerator& randomGenerator);
125 };
126 
127 }
128 
129 }
130 
131 }
132 
133 #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:29
static bool testComparison(const double testDuration)
Tests the comparison functions.
static bool test(const double testDuration)
Invokes all tests.
static bool testAccess(RandomGenerator &randomGenerator)
Tests the access functions.
static bool testAccess(const double testDuration)
Tests the access functions.
static bool testConstructor(const double testDuration)
Tests the constructor functions.
static bool testComparison(RandomGenerator &randomGenerator)
Tests the comparison functions.
static bool testClear(RandomGenerator &randomGenerator)
Tests the clear function.
static bool testClear(const double testDuration)
Tests the clear function.
static bool testResize(RandomGenerator &randomGenerator)
Tests the resize functions.
static bool testResize(const double testDuration)
Tests the resize functions.
static bool testConstructor(RandomGenerator &randomGenerator)
Tests the constructor functions.
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15