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