summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBaptiste Lepilleur <gaiacrtn@free.fr>2002-05-07 20:57:25 +0000
committerBaptiste Lepilleur <gaiacrtn@free.fr>2002-05-07 20:57:25 +0000
commit60979bfc4903e27e0d90b60db0a2d95bfabb7aea (patch)
tree30a0b7a5aa4b9bb55f091cb0e5e3ca8b7030fa3f /src
parent2159f78d59e9cedede0ef5b51d4f37dd1b3489b9 (diff)
downloadcppunit-60979bfc4903e27e0d90b60db0a2d95bfabb7aea.tar.gz
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).
Diffstat (limited to 'src')
-rw-r--r--src/msvc6/testrunner/ActiveTest.cpp2
-rw-r--r--src/msvc6/testrunner/ActiveTest.h54
2 files changed, 33 insertions, 23 deletions
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