Ocean
Loading...
Searching...
No Matches
TestMedian.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_MEDIAN_H
9#define META_OCEAN_TEST_TESTBASE_TEST_MEDIAN_H
10
13
16
17#include <vector>
18
19namespace Ocean
20{
21
22namespace Test
23{
24
25namespace TestBase
26{
27
28/**
29 * This class implements a median test.
30 * @ingroup testbase
31 */
32class OCEAN_TEST_BASE_EXPORT TestMedian
33{
34 public:
35
36 /**
37 * Tests the entire median functions.
38 * @param testDuration Number of seconds for each test, with range (0, infinity)
39 * @param selector The selector to filter individual test cases
40 * @return True, if succeeded
41 */
42 static bool test(const double testDuration, const TestSelector& selector = TestSelector());
43
44 /**
45 * Tests the median function for two parameters.
46 * @param testDuration Number of seconds for each test, with range (0, infinity)
47 * @return True, if succeeded
48 */
49 static bool testMedian2(const double testDuration);
50
51 /**
52 * Tests the median function for three parameters.
53 * @param testDuration Number of seconds for each test, with range (0, infinity)
54 * @return True, if succeeded
55 */
56 static bool testMedian3(const double testDuration);
57
58 /**
59 * Tests the median function for four parameters.
60 * @param testDuration Number of seconds for each test, with range (0, infinity)
61 * @return True, if succeeded
62 */
63 static bool testMedian4(const double testDuration);
64
65 /**
66 * Tests the median function for three parameters.
67 * @param testDuration Number of seconds for each test, with range (0, infinity)
68 * @return True, if succeeded
69 */
70 static bool testMedian5(const double testDuration);
71
72 /**
73 * Tests the median function with a given data type.
74 * @param testDuration Number of seconds for each test, with range (0, infinity)
75 * @return True, if succeeded
76 * @tparam T The data type to be used for testing
77 */
78 template <typename T>
79 static bool testMedian(const double testDuration);
80
81 /**
82 * Tests the percentile function with a given data type.
83 * @param testDuration Number of seconds for each test, with range (0, infinity)
84 * @return True, if succeeded
85 * @tparam T The data type to be used for testing
86 */
87 template <typename T>
88 static bool testPercentile(const double testDuration);
89
90 private:
91
92 /**
93 * Tests the median function with a given number of elements.
94 * @param number Number of elements, with range [1, infinity)
95 * @param testDuration Number of seconds for each test, with range (0, infinity)
96 * @return True, if succeeded
97 * @tparam T The data type to be used for testing
98 */
99 template <typename T>
100 static bool testMedian(const unsigned int number, const double testDuration);
101};
102
103}
104
105}
106
107}
108
109#endif // META_OCEAN_TEST_TESTBASE_TEST_MEDIAN_H
This class implements a median test.
Definition TestMedian.h:33
static bool testMedian2(const double testDuration)
Tests the median function for two parameters.
static bool testMedian4(const double testDuration)
Tests the median function for four parameters.
static bool testMedian5(const double testDuration)
Tests the median function for three parameters.
static bool testPercentile(const double testDuration)
Tests the percentile function with a given data type.
static bool test(const double testDuration, const TestSelector &selector=TestSelector())
Tests the entire median functions.
static bool testMedian(const double testDuration)
Tests the median function with a given data type.
static bool testMedian(const unsigned int number, const double testDuration)
Tests the median function with a given number of elements.
static bool testMedian3(const double testDuration)
Tests the median function for three parameters.
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