[Mobies-commit] [commit] r3753 - in UDM/trunk/tests: test_staticleaks test_staticleaksdll

ksmyth at redhat1.isis.vanderbilt.edu ksmyth at redhat1.isis.vanderbilt.edu
Wed May 18 10:00:49 CDT 2011


Author: ksmyth
Date: Wed May 18 10:00:48 2011
New Revision: 3753

Log:
Fix leak test: dont test for _CRT_BLOCKs

Modified:
   UDM/trunk/tests/test_staticleaks/test_staticleaks.cpp
   UDM/trunk/tests/test_staticleaksdll/DllMain.cpp

Modified: UDM/trunk/tests/test_staticleaks/test_staticleaks.cpp
==============================================================================
--- UDM/trunk/tests/test_staticleaks/test_staticleaks.cpp	Tue May 17 13:06:15 2011	(r3752)
+++ UDM/trunk/tests/test_staticleaks/test_staticleaks.cpp	Wed May 18 10:00:48 2011	(r3753)
@@ -46,13 +46,17 @@
 
 	// To test leak detection:
 	// new int;
+	//_malloc_dbg(13, _CLIENT_BLOCK, __FILE__, __LINE__);
+	//_malloc_dbg(14, _NORMAL_BLOCK, __FILE__, __LINE__);
 	_CrtMemState finalState;
 	_CrtMemCheckpoint(&finalState);
-	_CrtMemBlockHeader * pHead;
 
+	_CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_FILE);
+	_CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR);
 	_CrtMemDumpAllObjectsSince(&initState);
-	if (finalState.pBlockHeader != initState.pBlockHeader) {
-		// DebugBreak();
+
+	_CrtMemState diff;
+	if (_CrtMemDifference(&diff, &initState, &finalState)) {
 		CPPUNIT_ASSERT_MESSAGE("Memory leak detected", 0);
 	}
 	int flag = _CrtSetDbgFlag(0x21);

Modified: UDM/trunk/tests/test_staticleaksdll/DllMain.cpp
==============================================================================
--- UDM/trunk/tests/test_staticleaksdll/DllMain.cpp	Tue May 17 13:06:15 2011	(r3752)
+++ UDM/trunk/tests/test_staticleaksdll/DllMain.cpp	Wed May 18 10:00:48 2011	(r3753)
@@ -13,4 +13,5 @@
 
 	Uml::Initialize();
 	RefPort::Initialize();
+	UdmUtil::stacktrace();
 }
\ No newline at end of file


More information about the Mobies-commit mailing list