Ocean
Loading...
Searching...
No Matches
TestMemory.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_MEMORY_H
9#define META_OCEAN_TEST_TESTBASE_TEST_MEMORY_H
10
13
14#include "ocean/base/Worker.h"
15
17
18namespace Ocean
19{
20
21namespace Test
22{
23
24namespace TestBase
25{
26
27/**
28 * This class implements a memory test.
29 * @ingroup testbase
30 */
31class OCEAN_TEST_BASE_EXPORT TestMemory
32{
33 public:
34
35 /**
36 * Tests some memory functions.
37 * @param testDuration Number of seconds for each test, with range (0, infinity)
38 * @param worker The worker object to distribute the computation
39 * @param selector The selector to filter individual test cases
40 * @return True, if succeeded
41 */
42 static bool test(const double testDuration, Worker& worker, const TestSelector& selector = TestSelector());
43
44 /**
45 * Tests the memory object.
46 * @param testDuration Number of seconds for each test, with range (0, infinity)
47 * @return True, if succeeded
48 */
49 static bool testObject(const double testDuration);
50
51 /**
52 * Tests the memory allocation performance.
53 * @param testDuration Number of seconds for each test, with range (0, infinity)
54 * @param worker The worker object to distribute the computation
55 * @return True, if succeeded
56 */
57 static bool testAllocation(const double testDuration, Worker& worker);
58
59 /**
60 * Tests the isInside functions.
61 * @param testDuration Number of seconds for each test, with range (0, infinity)
62 * @return True, if succeeded
63 */
64 static bool testIsInside(const double testDuration);
65};
66
67}
68
69}
70
71}
72
73#endif // META_OCEAN_TEST_TESTBASE_TEST_MEMORY_H
This class implements a memory test.
Definition TestMemory.h:32
static bool testObject(const double testDuration)
Tests the memory object.
static bool testIsInside(const double testDuration)
Tests the isInside functions.
static bool test(const double testDuration, Worker &worker, const TestSelector &selector=TestSelector())
Tests some memory functions.
static bool testAllocation(const double testDuration, Worker &worker)
Tests the memory allocation performance.
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