From 38d5712aaad701075e0b244c5355145a95a6956f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 9 Mar 2019 16:50:50 +0100 Subject: [PATCH] Moved CheckAssert::assertWithSideEffects to normal checking --- lib/checkassert.h | 12 ++++++++++-- test/testassert.cpp | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/checkassert.h b/lib/checkassert.h index 8740b842e..e0e53358c 100644 --- a/lib/checkassert.h +++ b/lib/checkassert.h @@ -49,9 +49,17 @@ public: : Check(myName(), tokenizer, settings, errorLogger) { } + /** run checks, the token list is not simplified */ + virtual void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { + CheckAssert checkAssert(tokenizer, settings, errorLogger); + checkAssert.assertWithSideEffects(); + } + + virtual void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { - CheckAssert check(tokenizer, settings, errorLogger); - check.assertWithSideEffects(); + (void)tokenizer; + (void)settings; + (void)errorLogger; } void assertWithSideEffects(); diff --git a/test/testassert.cpp b/test/testassert.cpp index a9b350155..ef093c87c 100644 --- a/test/testassert.cpp +++ b/test/testassert.cpp @@ -40,8 +40,8 @@ private: tokenizer.tokenize(istr, filename); // Check.. - CheckAssert checkAssert(&tokenizer, &settings, this); - checkAssert.runSimplifiedChecks(&tokenizer, &settings, this); + CheckAssert checkAssert; + checkAssert.runChecks(&tokenizer, &settings, this); } void run() OVERRIDE {