rambrain
testManagedPtr.cpp File Reference

Go to the source code of this file.

Classes

class  destructorTracker
 Helper class to track construction and destruction. More...
 

Functions

 TEST (managedPtr, Unit_NoMemoryManager)
 
 TEST (managedPtr, Unit_ParentIDs)
 
 TEST (managedPtr, Unit_ChunkInUse)
 
 TEST (managedPtr, Unit_GetLocPointer)
 
 TEST (managedPtr, Unit_SmartPointery)
 
 TEST (managedPtr, Unit_DeleteWhileInUse)
 
 TEST (managedPtr, Unit_DirectAccess)
 
 TEST (managedPtr, Unit_DirectAccessSwapped)
 
 TEST (managedPtr, Unit_CreateAndInitialize)
 
 TEST (managedPtr, Unit_PointerAllocation)
 
 TEST (managedPtr, Unit_ZeroSizedObjects)
 
 TEST (managedPtr, Integration_DirectVsSmartAccess)
 
 TEST (managedPtr, Unit_MultithreadingConcurrentCreateDelete)
 
 TEST (managedPtr, Unit_ConcurrentUseAccess)
 
 TEST (managedPtr, Unit_ConcurrentUseAccessThree)
 
 TEST (managedPtr, Unit_CallDestructorIfSwapped)
 
 TEST (managedPtr, Unit_EmptySizeAllowed)
 
 TEST (managedPtr, Unit_GetSize)
 
 TEST (managedPtr, Unit_ZeroSizedObjectsCanBeOverwrittenSavely)
 
 TEST (managedPtr, Unit_OverwriteWhileUsing)
 
 TEST (managedPtr, Unit_ShallowCopy)
 
 TEST (managedPtr, Unit_TestReassignment)
 
 TEST (managedPtr, Unit_MultipleAdhereTo)
 
 TEST (managedPtr, Unit_TwoDimensionalPtr)
 
 TEST (managedPtr, Unit_ThreeDimensionalPtr)
 

Variables

 IGNORE_TEST_WARNINGS
 
 RESTORE_WARNINGS
 

Function Documentation

TEST ( managedPtr  ,
Unit_NoMemoryManager   
)
Test:
Tests the behaviour if no memory manager is explicitely installed, ergo testing the fallback default

Definition at line 39 of file testManagedPtr.cpp.

TEST ( managedPtr  ,
Unit_ParentIDs   
)
Test:
Tests if parent is correctly assigned for the first pointer

Definition at line 54 of file testManagedPtr.cpp.

TEST ( managedPtr  ,
Unit_ChunkInUse   
)
Test:
Test manual set and unsetUse on a pointer and checks if the chunks are updated appropriately

Definition at line 69 of file testManagedPtr.cpp.

TEST ( managedPtr  ,
Unit_GetLocPointer   
)
Test:
Tests if a local pointer can be retreived or not if setUse is or is not done beforehand

Definition at line 104 of file testManagedPtr.cpp.

TEST ( managedPtr  ,
Unit_SmartPointery   
)
Test:
Checks if chunk stati are appropriately set when handling different types of adhereto

Definition at line 128 of file testManagedPtr.cpp.

TEST ( managedPtr  ,
Unit_DeleteWhileInUse   
)
Test:
Demonstrates how the application dies when a pointer is deleted while still in use

Definition at line 215 of file testManagedPtr.cpp.

TEST ( managedPtr  ,
Unit_DirectAccess   
)
Test:
Tests direct access on a managedPtr (deprecated since not thread safe and slow!)

Definition at line 241 of file testManagedPtr.cpp.

TEST ( managedPtr  ,
Unit_DirectAccessSwapped   
)
Test:
Tests direct access in a more complex scenario (depcrecated since not thread safe and slow!)

Definition at line 260 of file testManagedPtr.cpp.

TEST ( managedPtr  ,
Unit_CreateAndInitialize   
)
Test:
Tests if classes can be managed properly

Definition at line 286 of file testManagedPtr.cpp.

TEST ( managedPtr  ,
Unit_PointerAllocation   
)
Test:
Tests the different constructors of managedPtr

Definition at line 316 of file testManagedPtr.cpp.

TEST ( managedPtr  ,
Unit_ZeroSizedObjects   
)
Test:
Tests if zero sized objects (while not usefull) can be handled

Definition at line 351 of file testManagedPtr.cpp.

TEST ( managedPtr  ,
Integration_DirectVsSmartAccess   
)
Test:
Demonstrates why direct access if awfully slow in comparison to smart access via adhereto

Definition at line 370 of file testManagedPtr.cpp.

TEST ( managedPtr  ,
Unit_MultithreadingConcurrentCreateDelete   
)
Test:
Tests if parallel deleting of pointers work
Note
would like to assert no throw, but pragma omp is not allowd

Definition at line 439 of file testManagedPtr.cpp.

TEST ( managedPtr  ,
Unit_ConcurrentUseAccess   
)
Test:
Tests if concurrent access works properly while loading and unloading objects
Note
would like to assert no throw, but pragma omp is not allowd

Definition at line 467 of file testManagedPtr.cpp.

TEST ( managedPtr  ,
Unit_ConcurrentUseAccessThree   
)
Test:
More complex scenario for concurrent access
Note
would like to assert no throw, but pragma omp is not allowd

Definition at line 506 of file testManagedPtr.cpp.

TEST ( managedPtr  ,
Unit_CallDestructorIfSwapped   
)
Test:
Tests if class constructors and destructors are called appropriately as the hierarchy dictates

Definition at line 555 of file testManagedPtr.cpp.

TEST ( managedPtr  ,
Unit_EmptySizeAllowed   
)
Test:
Tests if a pointer of size 0 can be used, e.g. for default ctors of wrapper classes

Definition at line 578 of file testManagedPtr.cpp.

TEST ( managedPtr  ,
Unit_GetSize   
)
Test:
Tests if the size of a data array can be properly retrieved from the managedPtr

Definition at line 596 of file testManagedPtr.cpp.

TEST ( managedPtr  ,
Unit_ZeroSizedObjectsCanBeOverwrittenSavely   
)
Test:
Checks whether we may savely overwrite zero-sized managedPtrs
Note
run this test using valgrind to see difference

Definition at line 612 of file testManagedPtr.cpp.

TEST ( managedPtr  ,
Unit_OverwriteWhileUsing   
)
Test:
Tests if a pointer can be adhereto-ed and overwritten in between

Definition at line 635 of file testManagedPtr.cpp.

TEST ( managedPtr  ,
Unit_ShallowCopy   
)
Test:
Tests, that copying a managed pointer is done in a shallow way

Definition at line 667 of file testManagedPtr.cpp.

TEST ( managedPtr  ,
Unit_TestReassignment   
)
Test:
Tests, if pointers can be copied and copied back without problems

Definition at line 716 of file testManagedPtr.cpp.

TEST ( managedPtr  ,
Unit_MultipleAdhereTo   
)
Test:
Tests, that pointers of multiple adhereTo-s glued to the same managedPtr actually are the same

Definition at line 765 of file testManagedPtr.cpp.

TEST ( managedPtr  ,
Unit_TwoDimensionalPtr   
)
Test:
Tests if two dimensional managed pointers work properly

Definition at line 793 of file testManagedPtr.cpp.

TEST ( managedPtr  ,
Unit_ThreeDimensionalPtr   
)
Test:
Tests if three dimensional managed pointers work properly

Definition at line 915 of file testManagedPtr.cpp.

Variable Documentation

IGNORE_TEST_WARNINGS

Definition at line 21 of file testManagedPtr.cpp.

RESTORE_WARNINGS

Definition at line 952 of file testManagedPtr.cpp.