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