Ocean
Loading...
Searching...
No Matches
TestTimestamp.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_TIMESTAMP_H
9#define META_OCEAN_TEST_TESTBASE_TEST_TIMESTAMP_H
10
13
14namespace Ocean
15{
16
17namespace Test
18{
19
20namespace TestBase
21{
22
23/**
24 * This class implements a timestamp test.
25 * @ingroup testbase
26 */
27class OCEAN_TEST_BASE_EXPORT TestTimestamp
28{
29 public:
30
31 /**
32 * Tests the accuracy of timestamp.
33 * @param testDuration Number of seconds for each test, with range (0, infinity)
34 * @param selector The test selector to filter tests
35 * @return True, if succeeded
36 */
37 static bool test(const double testDuration, const TestSelector& selector = TestSelector());
38
39 /**
40 * Tests the precision/resolution of the timestamp implementation.
41 * @param testDuration Number of seconds for each test, with range (0, infinity)
42 * @return True, if succeeded
43 */
44 static bool testResolution(const double testDuration);
45
46 /**
47 * Tests the conversion to milliseconds.
48 * @param testDuration Number of seconds for each test, with range (0, infinity)
49 * @return True, if succeeded
50 */
51 static bool testMilliseconds(const double testDuration);
52
53 /**
54 * Tests the conversion to microseconds.
55 * @param testDuration Number of seconds for each test, with range (0, infinity)
56 * @return True, if succeeded
57 */
58 static bool testMicroseconds(const double testDuration);
59
60 /**
61 * Tests the conversion to nanoseconds.
62 * @param testDuration Number of seconds for each test, with range (0, infinity)
63 * @return True, if succeeded
64 */
65 static bool testNanoseconds(const double testDuration);
66
67 /**
68 * Tests the hasTimePassed() function.
69 * @param testDuration Number of seconds for each test, with range (0, infinity)
70 * @return True, if succeeded
71 */
72 static bool testHasTimePassed(const double testDuration);
73};
74
75}
76
77}
78
79}
80
81#endif // META_OCEAN_TEST_TESTBASE_TEST_TIMESTAMP_H
This class implements a timestamp test.
Definition TestTimestamp.h:28
static bool test(const double testDuration, const TestSelector &selector=TestSelector())
Tests the accuracy of timestamp.
static bool testHasTimePassed(const double testDuration)
Tests the hasTimePassed() function.
static bool testMicroseconds(const double testDuration)
Tests the conversion to microseconds.
static bool testNanoseconds(const double testDuration)
Tests the conversion to nanoseconds.
static bool testMilliseconds(const double testDuration)
Tests the conversion to milliseconds.
static bool testResolution(const double testDuration)
Tests the precision/resolution of the timestamp implementation.
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