From c3ad3f78e90e24674137cfe685b21e0a920321f6 Mon Sep 17 00:00:00 2001 From: Greg Hewgill Date: Wed, 2 Feb 2011 21:57:08 +1300 Subject: [PATCH] test case to check whether instances are sorted --- test/testcppcheck.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/testcppcheck.cpp b/test/testcppcheck.cpp index af6e33883..3aaff3c35 100644 --- a/test/testcppcheck.cpp +++ b/test/testcppcheck.cpp @@ -66,9 +66,21 @@ private: void run() { + TEST_CASE(instancesSorted); TEST_CASE(getErrorMessages); } + void instancesSorted() + { + for (std::list::iterator i = Check::instances().begin(); i != Check::instances().end(); ++i) { + std::list::iterator j = i; + ++j; + if (j != Check::instances().end()) { + ASSERT_EQUALS(true, (*i)->name() < (*j)->name()); + } + } + } + void getErrorMessages() { ErrorLogger2 errorLogger;