Added void lines to remove compiler warnings. Commented out inappropriate tests. Added call to single-owner test for StrongPtr.

git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@1131 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
rich_sposato 2011-10-03 04:56:54 +00:00
parent d66de77411
commit 965a15a5f0

View file

@ -36,6 +36,7 @@ extern void DoStrongConstTests( void );
extern void DoStrongForwardReferenceTest( void ); extern void DoStrongForwardReferenceTest( void );
extern void DoStrongCompareTests( void ); extern void DoStrongCompareTests( void );
extern void DoStrongPtrDynamicCastTests( void ); extern void DoStrongPtrDynamicCastTests( void );
extern void DoSingleOwnerTests( void );
extern void DoStrongArrayTests( void ); extern void DoStrongArrayTests( void );
extern void DoLockedPtrTest( void ); extern void DoLockedPtrTest( void );
@ -60,6 +61,10 @@ typedef Loki::SmartPtr< Thingy, RefCounted, DisallowConversion,
NoCheck, DefaultSPStorage, PropagateConst > NoCheck, DefaultSPStorage, PropagateConst >
Thingy_DefaultStorage_ptr; Thingy_DefaultStorage_ptr;
//typedef Loki::SmartPtr< Thingy, RefCountedMTAdj< >, DisallowConversion,
// AssertCheck, DefaultSPStorage, PropagateConst >
// Thingy_Locked_ptr;
typedef Loki::SmartPtr< Thingy, RefCounted, DisallowConversion, typedef Loki::SmartPtr< Thingy, RefCounted, DisallowConversion,
AssertCheck, HeapStorage, PropagateConst > AssertCheck, HeapStorage, PropagateConst >
Thingy_HeapStorage_ptr; Thingy_HeapStorage_ptr;
@ -1425,20 +1430,23 @@ void DoDestructiveCopyTest( void )
from const to non-const, or about assigning a read-only reference, then DestructiveCopy from const to non-const, or about assigning a read-only reference, then DestructiveCopy
was designed correctly. was designed correctly.
*/ */
DestructiveCopyPtr p2; //DestructiveCopyPtr p2;
assert( !p2 ); //assert( !p2 );
p2 = p1; //p2 = p1;
assert( !p1 ); //assert( !p1 );
assert( p2 ); //assert( p2 );
DestructiveCopyPtr p3( p2 ); //DestructiveCopyPtr p3( p2 );
assert( p3 ); //assert( p3 );
assert( !p2 ); //assert( !p2 );
} }
{ {
/// @todo The following lines need to be uncommented when bug 3224572 gets fixed. /// @todo The following lines need to be uncommented when bug 3224572 gets fixed.
DestructiveCopyPtr p1( MakePointer() ); DestructiveCopyPtr p1( MakePointer() );
assert( p1 ); assert( p1 );
DestructiveCopyPtr p2;
p2 = MakePointer();
assert( p2 );
} }
assert( BaseClass::AllDestroyed() ); assert( BaseClass::AllDestroyed() );
@ -1497,10 +1505,12 @@ void DoSmartArrayTests( void )
try try
{ {
Tiger & p4 = sp2[ 4 ]; Tiger & p4 = sp2[ 4 ];
(void)p4;
assert( false ); assert( false );
} }
catch ( const ::std::out_of_range & ex ) catch ( const ::std::out_of_range & ex )
{ {
(void)ex;
assert( true ); assert( true );
} }
@ -1508,10 +1518,12 @@ void DoSmartArrayTests( void )
try try
{ {
Tiger & p8 = sp1[ 8 ]; Tiger & p8 = sp1[ 8 ];
(void)p8;
assert( false ); assert( false );
} }
catch ( const ::std::out_of_range & ex ) catch ( const ::std::out_of_range & ex )
{ {
(void)ex;
assert( true ); assert( true );
} }
@ -1540,20 +1552,24 @@ void DoSmartArrayTests( void )
try try
{ {
Tiger & p4 = sp1[ 4 ]; Tiger & p4 = sp1[ 4 ];
(void)p4;
assert( false ); assert( false );
} }
catch ( const ::std::out_of_range & ex ) catch ( const ::std::out_of_range & ex )
{ {
(void)ex;
assert( true ); assert( true );
} }
try try
{ {
Tiger & p8 = sp2[ 8 ]; Tiger & p8 = sp2[ 8 ];
(void)p8;
assert( false ); assert( false );
} }
catch ( const ::std::out_of_range & ex ) catch ( const ::std::out_of_range & ex )
{ {
(void)ex;
assert( true ); assert( true );
} }
@ -1563,10 +1579,12 @@ void DoSmartArrayTests( void )
try try
{ {
const Tiger & p4 = sp3[ 4 ]; const Tiger & p4 = sp3[ 4 ];
(void)p4;
assert( false ); assert( false );
} }
catch ( const ::std::out_of_range & ex ) catch ( const ::std::out_of_range & ex )
{ {
(void)ex;
assert( true ); assert( true );
} }
@ -1576,10 +1594,12 @@ void DoSmartArrayTests( void )
try try
{ {
const Tiger & p8 = sp5[ 8 ]; const Tiger & p8 = sp5[ 8 ];
(void)p8;
assert( false ); assert( false );
} }
catch ( const ::std::out_of_range & ex ) catch ( const ::std::out_of_range & ex )
{ {
(void)ex;
assert( true ); assert( true );
} }
@ -1622,6 +1642,7 @@ int main( int argc, const char * argv[] )
DoStrongReleaseTests(); DoStrongReleaseTests();
DoWeakCycleTests(); DoWeakCycleTests();
DoStrongCompareTests(); DoStrongCompareTests();
DoSingleOwnerTests();
DoForwardReferenceTest(); DoForwardReferenceTest();
DoStrongForwardReferenceTest(); DoStrongForwardReferenceTest();
@ -1633,7 +1654,7 @@ int main( int argc, const char * argv[] )
DoRefLinkSwapTests(); DoRefLinkSwapTests();
DoComRefTest(); DoComRefTest();
TryColvinGibbonsTrick(); // TryColvinGibbonsTrick();
DoStrongConstTests(); DoStrongConstTests();
DoConstConversionTests(); DoConstConversionTests();