From 60979bfc4903e27e0d90b60db0a2d95bfabb7aea Mon Sep 17 00:00:00 2001 From: Baptiste Lepilleur Date: Tue, 7 May 2002 20:57:25 +0000 Subject: Src/DllPlugInTester/CommandLineParser. src/DllPlugInTester/CommandLineParser.cpp: fixed compilation issue. * src/msvc6/TestRunner/ActiveTest.h: * src/msvc6/TestRunner/ActiveTest.cpp: reindented. bugfix: thread handle resource leak (bug #553424). --- src/msvc6/testrunner/ActiveTest.cpp | 2 +- src/msvc6/testrunner/ActiveTest.h | 54 ++++++++++++++++++++++--------------- 2 files changed, 33 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/msvc6/testrunner/ActiveTest.cpp b/src/msvc6/testrunner/ActiveTest.cpp index 91eab6d..c919b8c 100644 --- a/src/msvc6/testrunner/ActiveTest.cpp +++ b/src/msvc6/testrunner/ActiveTest.cpp @@ -39,7 +39,7 @@ ActiveTest::threadFunction( LPVOID thisInstance ) test->run (); ::CloseHandle( test->m_threadHandle ); - test->m_threadHandle = INVALID_HANDLE_VALUE + test->m_threadHandle = INVALID_HANDLE_VALUE; test->m_runCompleted.SetEvent(); diff --git a/src/msvc6/testrunner/ActiveTest.h b/src/msvc6/testrunner/ActiveTest.h index 8b9abc9..926be1f 100644 --- a/src/msvc6/testrunner/ActiveTest.h +++ b/src/msvc6/testrunner/ActiveTest.h @@ -1,5 +1,3 @@ - - #ifndef CPPUNIT_ACTIVETEST_H #define CPPUNIT_ACTIVETEST_H @@ -29,42 +27,54 @@ class ActiveTest : public CppUnit::TestDecorator { public: - ActiveTest (CppUnit::Test *test); - ~ActiveTest (); + ActiveTest( CppUnit::Test *test ); + ~ActiveTest(); - void run (CppUnit::TestResult *result); + void run( CppUnit::TestResult *result ); protected: - HANDLE m_threadHandle; - CEvent m_runCompleted; - CppUnit::TestResult *m_currentTestResult; - - void run (); - void setTestResult (CppUnit::TestResult *result); - static UINT threadFunction (LPVOID thisInstance); - + HANDLE m_threadHandle; + CEvent m_runCompleted; + CppUnit::TestResult *m_currentTestResult; + void run(); + void setTestResult( CppUnit::TestResult *result ); + static UINT threadFunction( LPVOID thisInstance ); }; // Construct the active test -inline ActiveTest::ActiveTest (CppUnit::Test *test) -: TestDecorator (test), m_runCompleted () -{ m_currentTestResult = NULL; m_threadHandle = INVALID_HANDLE_VALUE; } +inline +ActiveTest::ActiveTest( CppUnit::Test *test ) + : TestDecorator( test ) + , m_runCompleted() +{ + m_currentTestResult = NULL; + m_threadHandle = INVALID_HANDLE_VALUE; +} // Pend until the test has completed -inline ActiveTest::~ActiveTest () -{ CSingleLock (&m_runCompleted, TRUE); } +inline +ActiveTest::~ActiveTest() +{ + CSingleLock( &m_runCompleted, TRUE ); +} // Set the test result that we are to run -inline void ActiveTest::setTestResult (CppUnit::TestResult *result) -{ m_currentTestResult = result; } +inline void +ActiveTest::setTestResult( CppUnit::TestResult *result ) +{ + m_currentTestResult = result; +} // Run our test result -inline void ActiveTest::run () -{ TestDecorator::run (m_currentTestResult); } +inline void +ActiveTest::run() +{ + TestDecorator::run( m_currentTestResult ); +} #endif -- cgit v1.2.1