1 | /*
|
---|
2 | * memoryusageobserverunittest.hpp
|
---|
3 | */
|
---|
4 |
|
---|
5 | #ifndef MEMORYUSAGEOBSERVERTEST_HPP_
|
---|
6 | #define MEMORYUSAGEOBSERVERTEST_HPP_
|
---|
7 |
|
---|
8 | #include "memoryusageobserver.hpp"
|
---|
9 | #include <cppunit/extensions/HelperMacros.h>
|
---|
10 |
|
---|
11 |
|
---|
12 | /********************************************** Test classes **************************************/
|
---|
13 |
|
---|
14 | class MemoryUsageObserverTest : public CppUnit::TestFixture
|
---|
15 | {
|
---|
16 | CPPUNIT_TEST_SUITE( MemoryUsageObserverTest) ;
|
---|
17 | CPPUNIT_TEST ( getInstanceReturnsMemoryUsageObserverTest );
|
---|
18 | CPPUNIT_TEST ( getInstanceTwiceReturnsSameInstanceTest );
|
---|
19 | CPPUNIT_TEST ( getInstanceAfterPurgeInstanceReturnsNewInstanceTest );
|
---|
20 | CPPUNIT_TEST ( addAndRemoveMemoryTest );
|
---|
21 | CPPUNIT_TEST ( removeNonTrackedMemoryDoesNotCauseACrashTest );
|
---|
22 | CPPUNIT_TEST ( addMemoryTwiceTest );
|
---|
23 | CPPUNIT_TEST ( addMemoryAndChangeSizeOfAddedMemoryTest );
|
---|
24 | CPPUNIT_TEST ( addMemoryChangeSizeOfAddedMemoryAndGetMaximumSizeTest );
|
---|
25 | CPPUNIT_TEST ( addMemoryRemoveMemoryAndGetMaximumSizeTest );
|
---|
26 | CPPUNIT_TEST ( getPointersToAllocatedMemoryTest );
|
---|
27 | CPPUNIT_TEST_SUITE_END();
|
---|
28 |
|
---|
29 | public:
|
---|
30 | void setUp();
|
---|
31 | void tearDown();
|
---|
32 |
|
---|
33 | void getInstanceReturnsMemoryUsageObserverTest();
|
---|
34 | void getInstanceTwiceReturnsSameInstanceTest();
|
---|
35 | void getInstanceAfterPurgeInstanceReturnsNewInstanceTest();
|
---|
36 | void addAndRemoveMemoryTest();
|
---|
37 | void removeNonTrackedMemoryDoesNotCauseACrashTest();
|
---|
38 | void addMemoryTwiceTest();
|
---|
39 | void addMemoryAndChangeSizeOfAddedMemoryTest();
|
---|
40 | void addMemoryChangeSizeOfAddedMemoryAndGetMaximumSizeTest();
|
---|
41 | void addMemoryRemoveMemoryAndGetMaximumSizeTest();
|
---|
42 | void getPointersToAllocatedMemoryTest();
|
---|
43 | };
|
---|
44 |
|
---|
45 | #endif /* MEMORYUSAGEOBSERVERTEST_HPP_ */
|
---|
46 |
|
---|