Ocean
Loading...
Searching...
No Matches
TestRateCalculator.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_TESTMATH_TEST_RATE_CALCULATOR_H
9#define META_OCEAN_TEST_TESTMATH_TEST_RATE_CALCULATOR_H
10
12
14
16
17namespace Ocean
18{
19
20namespace Test
21{
22
23namespace TestMath
24{
25
26/**
27 * This class implements tests for the RateCalculator class.
28 * @ingroup testmath
29 */
30class OCEAN_TEST_MATH_EXPORT TestRateCalculator
31{
32 protected:
33
34 /**
35 * Definition of a pair combining a timestamp with a quantity.
36 */
37 using TimestampPair = std::pair<Timestamp, double>;
38
39 /**
40 * Definition of a vector holding timestamp pair objects.
41 */
42 using TimestampPairs = std::vector<TimestampPair>;
43
44 public:
45
46 /**
47 * Starts all tests for the class.
48 * @param testDuration Number of seconds for each test, with range (0, infinity)
49 * @param worker The worker object
50 * @param selector The test selector
51 * @return True, if succeeded
52 */
53 static bool test(const double testDuration, Worker& worker, const TestSelector& selector);
54
55 /**
56 * Tests the rate functionality.
57 * @param testDuration Number of seconds for each test, with range (0, infinity)
58 * @return True, if succeeded
59 */
60 static bool testRate(const double testDuration);
61};
62
63}
64
65}
66
67}
68
69#endif // META_OCEAN_TEST_TESTMATH_TEST_RATE_CALCULATOR_H
This class implements tests for the RateCalculator class.
Definition TestRateCalculator.h:31
static bool testRate(const double testDuration)
Tests the rate functionality.
std::pair< Timestamp, double > TimestampPair
Definition of a pair combining a timestamp with a quantity.
Definition TestRateCalculator.h:37
static bool test(const double testDuration, Worker &worker, const TestSelector &selector)
Starts all tests for the class.
std::vector< TimestampPair > TimestampPairs
Definition of a vector holding timestamp pair objects.
Definition TestRateCalculator.h:42
This class implements a test selector that parses test function strings and determines which tests sh...
Definition TestSelector.h:51
This class implements a worker able to distribute function calls over different threads.
Definition Worker.h:33
The namespace covering the entire Ocean framework.
Definition Accessor.h:15