diff options
| author | Baptiste Lepilleur <gaiacrtn@free.fr> | 2001-05-19 06:57:17 +0000 |
|---|---|---|
| committer | Baptiste Lepilleur <gaiacrtn@free.fr> | 2001-05-19 06:57:17 +0000 |
| commit | 5d704cbbd7928e8a3baec2e18c8d7e0e6089dc6e (patch) | |
| tree | b8317140771c37b9d23f719aa9db5153f58c3485 /src | |
| parent | d868836719b2efe76504cea66b7db7255337c8b1 (diff) | |
| download | cppunit-5d704cbbd7928e8a3baec2e18c8d7e0e6089dc6e.tar.gz | |
* Added some items to the TODO list for VC++ TestRunner.
* "Debug" configuration is now the default configuration in VC++ project.
* Modified sort order in the test browser of VC++ TestRunner so that test are in the same order as in the suite. Suite
are still sorted.
Diffstat (limited to 'src')
| -rw-r--r-- | src/msvc6/testrunner/TreeHierarchyDlg.cpp | 17 | ||||
| -rw-r--r-- | src/msvc6/testrunner/TreeHierarchyDlg.h | 5 |
2 files changed, 13 insertions, 9 deletions
diff --git a/src/msvc6/testrunner/TreeHierarchyDlg.cpp b/src/msvc6/testrunner/TreeHierarchyDlg.cpp index 2b9348f..8d1405c 100644 --- a/src/msvc6/testrunner/TreeHierarchyDlg.cpp +++ b/src/msvc6/testrunner/TreeHierarchyDlg.cpp @@ -98,12 +98,9 @@ void TreeHierarchyDlg::addTestSuiteChildrenTo( CppUnit::TestSuite *suite, HTREEITEM hItemSuite ) { - Tests tests; - - tests.insert(tests.end(), suite->getTests().begin(), - suite->getTests().end()); - + Tests tests( suite->getTests() ); sortByName( tests ); + for ( Tests::const_iterator it = tests.begin(); it != tests.end(); ++it ) { addTest( *it, hItemSuite ); @@ -123,14 +120,20 @@ struct PredSortTest { bool operator()( CppUnit::Test *test1, CppUnit::Test *test2 ) const { - return test1->getName() < test2->getName(); + bool isTest1Suite = TreeHierarchyDlg::isTestSuite( test1 ); + bool isTest2Suite = TreeHierarchyDlg::isTestSuite( test2 ); + if ( isTest1Suite && !isTest2Suite ) + return true; + if ( isTest1Suite && isTest2Suite ) + return test1->getName() < test2->getName(); + return false; } }; void TreeHierarchyDlg::sortByName( Tests &tests ) const { - std::sort( tests.begin(), tests.end(), PredSortTest() ); + std::stable_sort( tests.begin(), tests.end(), PredSortTest() ); } diff --git a/src/msvc6/testrunner/TreeHierarchyDlg.h b/src/msvc6/testrunner/TreeHierarchyDlg.h index 0b495c3..f3ae5d5 100644 --- a/src/msvc6/testrunner/TreeHierarchyDlg.h +++ b/src/msvc6/testrunner/TreeHierarchyDlg.h @@ -23,7 +23,9 @@ public: void setRootTest( CppUnit::Test *test ); CppUnit::Test *getSelectedTest() const; -// Dialog Data + static bool isTestSuite( CppUnit::Test *test ); + + // Dialog Data //{{AFX_DATA(TreeHierarchyDlg) enum { IDD = IDD_DIALOG_TEST_HIERARCHY }; CTreeCtrl m_treeTests; @@ -55,7 +57,6 @@ private: HTREEITEM hParent ); void addTestSuiteChildrenTo( CppUnit::TestSuite *suite, HTREEITEM hItemSuite ); - static bool isTestSuite( CppUnit::Test *test ); void sortByName( Tests &tests ) const; CppUnit::Test *findSelectedTest(); |
