Ocean
TestHashMap.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_HASH_MAP_H
9 #define META_OCEAN_TEST_TESTBASE_TEST_HASH_MAP_H
10 
12 
13 namespace Ocean
14 {
15 
16 namespace Test
17 {
18 
19 namespace TestBase
20 {
21 
22 /**
23  * This class implements a hash map test.
24  * @ingroup testbase
25  */
26 class OCEAN_TEST_BASE_EXPORT TestHashMap
27 {
28  public:
29 
30  /**
31  * Tests the hash map functions.
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 hash map for single values.
39  * @param testDuration Number of seconds for each test, with range (0, infinity)
40  * @return True, if succeeded
41  */
42  static bool testSingleIntegers(const double testDuration);
43 
44  /**
45  * Tests the hash map for multiple values.
46  * @param testDuration Number of seconds for each test, with range (0, infinity)
47  * @return True, if succeeded
48  */
49  static bool testMultipleIntegers(const double testDuration);
50 
51  protected:
52 
53  /**
54  * Tests the hash map for a given number of elements with a given ratio of occupancy.
55  * @param number Number of elements to be tested
56  * @param occupancy Ratio of occupancy in percent
57  * @param testDuration Number of seconds for each test, with range (0, infinity)
58  * @return True, if succeeded
59  */
60  static bool testPerformanceSingleIntegers(const unsigned int number, const unsigned int occupancy, const double testDuration);
61 
62  /**
63  * Validates the hash map with static capacity for a given number of elements with a given ratio of occupancy.
64  * @param number Number of elements to be tested
65  * @param occupancy Ratio of occupancy in percent
66  * @param testDuration Number of seconds for each test, with range (0, infinity)
67  * @return True, if succeeded
68  */
69  static bool validationStaticCapacitySingleIntegers(const unsigned int number, const unsigned int occupancy, const double testDuration);
70 
71  /**
72  * Validates the hash map with dynamic capacity for a given number of elements with a given initial capacity.
73  * @param number Number of elements to be tested
74  * @param capacity The initial capacity
75  * @param testDuration Number of seconds for each test, with range (0, infinity)
76  * @return True, if succeeded
77  */
78  static bool validationDynamicCapacitySingleIntegers(const unsigned int number, const unsigned int capacity, const double testDuration);
79 
80  /**
81  * Tests the hash map for a given number of elements with a given ratio of occupancy.
82  * @param number Number of elements to be tested
83  * @param occupancy Ratio of occupancy in percent
84  * @param testDuration Number of seconds for each test, with range (0, infinity)
85  * @return True, if succeeded
86  */
87  static bool testPerformanceMultipleIntegers(const unsigned int number, const unsigned int occupancy, const double testDuration);
88 
89  /**
90  * Validates the hash map for a given number of elements with a given ratio of occupancy.
91  * @param number Number of elements to be tested
92  * @param occupancy Ratio of occupancy in percent
93  * @param testDuration Number of seconds for each test, with range (0, infinity)
94  * @return True, if succeeded
95  */
96  static bool validationMultipleIntegers(const unsigned int number, const unsigned int occupancy, const double testDuration);
97 };
98 
99 }
100 
101 }
102 
103 }
104 
105 #endif // META_OCEAN_TEST_TESTBASE_TEST_HASH_MAP_H
This class implements a hash map test.
Definition: TestHashMap.h:27
static bool validationMultipleIntegers(const unsigned int number, const unsigned int occupancy, const double testDuration)
Validates the hash map for a given number of elements with a given ratio of occupancy.
static bool testPerformanceSingleIntegers(const unsigned int number, const unsigned int occupancy, const double testDuration)
Tests the hash map for a given number of elements with a given ratio of occupancy.
static bool testMultipleIntegers(const double testDuration)
Tests the hash map for multiple values.
static bool test(const double testDuration)
Tests the hash map functions.
static bool testSingleIntegers(const double testDuration)
Tests the hash map for single values.
static bool testPerformanceMultipleIntegers(const unsigned int number, const unsigned int occupancy, const double testDuration)
Tests the hash map for a given number of elements with a given ratio of occupancy.
static bool validationStaticCapacitySingleIntegers(const unsigned int number, const unsigned int occupancy, const double testDuration)
Validates the hash map with static capacity for a given number of elements with a given ratio of occu...
static bool validationDynamicCapacitySingleIntegers(const unsigned int number, const unsigned int capacity, const double testDuration)
Validates the hash map with dynamic capacity for a given number of elements with a given initial capa...
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15