diff options
| author | Baptiste Lepilleur <gaiacrtn@free.fr> | 2004-06-18 06:39:45 +0000 |
|---|---|---|
| committer | Baptiste Lepilleur <gaiacrtn@free.fr> | 2004-06-18 06:39:45 +0000 |
| commit | 3bbf1aebb2c0d461b03f6cd8e3b2f964f3d00aeb (patch) | |
| tree | cb1479c5e34a0505570019957e6f25f56805572a /src/cppunit/TestSuiteBuilderContext.cpp | |
| parent | e6ec20ed260093756f7c53007982b98db3a92438 (diff) | |
| download | cppunit-3bbf1aebb2c0d461b03f6cd8e3b2f964f3d00aeb.tar.gz | |
Include/cppunit/extension/TestSuiteBuilderContext.
include/cppunit/extension/TestSuiteBuilderContext.h:
* src/cppunit/TestSuiteBuilderContext.cpp: fixed bug #921843. This bug
was caused by a known STL bug in VC++ 6.
See http://www.dinkumware.com/vc_fixes.html <xtree> issue with shared
std::map in dll. As a work-around the map has been replaced by a vector.
Diffstat (limited to 'src/cppunit/TestSuiteBuilderContext.cpp')
| -rw-r--r-- | src/cppunit/TestSuiteBuilderContext.cpp | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/src/cppunit/TestSuiteBuilderContext.cpp b/src/cppunit/TestSuiteBuilderContext.cpp index 06aa12e..ff71b52 100644 --- a/src/cppunit/TestSuiteBuilderContext.cpp +++ b/src/cppunit/TestSuiteBuilderContext.cpp @@ -17,6 +17,11 @@ TestSuiteBuilderContextBase::TestSuiteBuilderContextBase( } +TestSuiteBuilderContextBase::~TestSuiteBuilderContextBase() +{ +} + + void TestSuiteBuilderContextBase::addTest( Test *test ) { @@ -50,17 +55,30 @@ void TestSuiteBuilderContextBase::addProperty( const std::string &key, const std::string &value ) { - m_properties[ key ] = value; + Properties::iterator it = m_properties.begin(); + for ( ; it != m_properties.end(); ++it ) + { + if ( (*it).first == key ) + { + (*it).second = value; + return; + } + } + + Property property( key, value ); + m_properties.push_back( property ); } const std::string TestSuiteBuilderContextBase::getStringProperty( const std::string &key ) const { - Properties::const_iterator itFound = m_properties.find( key ); - if ( itFound == m_properties.end() ) - return ""; - - return (*itFound).second; + Properties::const_iterator it = m_properties.begin(); + for ( ; it != m_properties.end(); ++it ) + { + if ( (*it).first == key ) + return (*it).second; + } + return ""; } |
