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