Ocean
TestStackHeapVector.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_STACK_HEAP_VECTOR_H
9 #define META_OCEAN_TEST_TESTBASE_TEST_STACK_HEAP_VECTOR_H
10 
12 
13 namespace Ocean
14 {
15 
16 namespace Test
17 {
18 
19 namespace TestBase
20 {
21 
22 /**
23  * This class implements tests for StackHeapVector.
24  * @ingroup testbase
25  */
26 class OCEAN_TEST_BASE_EXPORT TestStackHeapVector
27 {
28  public:
29 
30  /**
31  * Invokes all tests.
32  * @param testDuration Number of seconds for each test, with range (0, infinity)
33  * @return True, if succeeded
34  */
35  static bool test(const double testDuration);
36 
37  /**
38  * Tests the constructor.
39  * @param testDuration Number of seconds for each test, with range (0, infinity)
40  * @return True, if succeeded
41  */
42  static bool testConstructor(const double testDuration);
43 
44  /**
45  * Tests the assign function.
46  * @param testDuration Number of seconds for each test, with range (0, infinity)
47  * @return True, if succeeded
48  */
49  static bool testAssign(const double testDuration);
50 
51  /**
52  * Tests push back function.
53  * @param testDuration Number of seconds for each test, with range (0, infinity)
54  * @return True, if succeeded
55  */
56  static bool testPushBack(const double testDuration);
57 
58  /**
59  * Tests resize function.
60  * @param testDuration Number of seconds for each test, with range (0, infinity)
61  * @return True, if succeeded
62  */
63  static bool testResize(const double testDuration);
64 
65  /**
66  * Tests the performance of the stack heap vector.
67  * @param testDuration Number of seconds for each test, with range (0, infinity)
68  * @return True, if succeeded
69  */
70  static bool testPerformance(const double testDuration);
71 
72  protected:
73 
74  /**
75  * Tests the constructor
76  * @param testDuration Number of seconds for each test, with range (0, infinity)
77  * @return True, if succeeded
78  * @tparam tStackSize Size of the vector's stack memory, with range [1, infinity)
79  */
80  template <size_t tStackSize>
81  static bool testConstructor(double testDuration);
82 
83  /**
84  * Tests the assign function.
85  * @param testDuration Number of seconds for each test, with range (0, infinity)
86  * @return True, if succeeded
87  * @tparam tStackSize Size of the vector's stack memory, with range [1, infinity)
88  */
89  template <size_t tStackSize>
90  static bool testAssign(const double testDuration);
91 
92  /**
93  * Tests push back function.
94  * @param testDuration Number of seconds for each test, with range (0, infinity)
95  * @return True, if succeeded
96  * @tparam tStackSize Size of the vector's stack memory, with range [1, infinity)
97  */
98  template <size_t tStackSize>
99  static bool testPushBack(const double testDuration);
100 
101  /**
102  * Tests resize function.
103  * @param testDuration Number of seconds for each test, with range (0, infinity)
104  * @return True, if succeeded
105  * @tparam tStackSize Size of the vector's stack memory, with range [1, infinity)
106  */
107  template <size_t tStackSize>
108  static bool testResize(const double testDuration);
109 
110  /**
111  * Tests the performance of the stack heap vector.
112  * @param testDuration Number of seconds for each test, with range (0, infinity)
113  * @return True, if succeeded
114  * @tparam tStackSize Size of the vector's stack memory, with range [1, infinity)
115  */
116  template <size_t tStackSize>
117  static bool testPerformance(const double testDuration);
118 };
119 
120 }
121 
122 }
123 
124 }
125 
126 #endif // META_OCEAN_TEST_TESTBASE_TEST_STACK_HEAP_VECTOR_H
This class implements tests for StackHeapVector.
Definition: TestStackHeapVector.h:27
static bool testPushBack(const double testDuration)
Tests push back function.
static bool testPerformance(const double testDuration)
Tests the performance of the stack heap vector.
static bool testResize(const double testDuration)
Tests resize function.
static bool testPerformance(const double testDuration)
Tests the performance of the stack heap vector.
static bool testConstructor(double testDuration)
Tests the constructor.
static bool testResize(const double testDuration)
Tests resize function.
static bool testAssign(const double testDuration)
Tests the assign function.
static bool testAssign(const double testDuration)
Tests the assign function.
static bool testConstructor(const double testDuration)
Tests the constructor.
static bool test(const double testDuration)
Invokes all tests.
static bool testPushBack(const double testDuration)
Tests push back function.
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15