From efe104663e1e0d29a9f6558aacc00638392294ea Mon Sep 17 00:00:00 2001 From: rich_sposato Date: Mon, 17 Oct 2011 20:04:54 +0000 Subject: [PATCH] Added explanatory comments. Replaced tabs with spaces. git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@1154 7ec92016-0320-0410-acc4-a06ded1c099a --- test/CheckReturn/main.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/test/CheckReturn/main.cpp b/test/CheckReturn/main.cpp index dc486ed..5d19cfa 100755 --- a/test/CheckReturn/main.cpp +++ b/test/CheckReturn/main.cpp @@ -135,6 +135,7 @@ int main( int argc, const char * argv[] ) // Should not assert since caller stores return value ... BoolReturn checkBool = CheckRequired(); // and then deliberately ignores it before destructor runs. + // Ignore any compiler warnings that says code does not check return value. (bool)checkBool; cout << "Called CheckRequired, stored return value, and ignored it." << endl; @@ -143,26 +144,28 @@ int main( int argc, const char * argv[] ) { // This should not assert since caller deliberately chooses to not // check return value by casting to return value to correct type. + // Ignore any compiler warnings that says code does not check return value. (bool)CheckRequired(); } { // This should not assert since caller deliberately chooses to not // check return value by casting to return value to correct type. + // Ignore any compiler warnings that says code does not check return value. (bool)CheckRequired( false ); cout << "Made a nested call to CheckRequired." << endl; } - { - BoolReturnStderr check = CheckRequiredStderr(); - } - cout << "There should be a error message: \nCheckReturn: return value was not checked" << endl; + { + BoolReturnStderr check = CheckRequiredStderr(); + } + cout << "There should be a error message: \nCheckReturn: return value was not checked" << endl; // This should assert since caller does not check return value. CheckRequired(); cout << "Should assert before this line! How did we get here?" << endl; - return 0; + return 0; } // ----------------------------------------------------------------------------