From: <ric...@us...> - 2011-10-17 20:05:00
|
Revision: 1154 http://loki-lib.svn.sourceforge.net/loki-lib/?rev=1154&view=rev Author: rich_sposato Date: 2011-10-17 20:04:54 +0000 (Mon, 17 Oct 2011) Log Message: ----------- Added explanatory comments. Replaced tabs with spaces. Modified Paths: -------------- trunk/test/CheckReturn/main.cpp Modified: trunk/test/CheckReturn/main.cpp =================================================================== --- trunk/test/CheckReturn/main.cpp 2011-10-17 20:00:02 UTC (rev 1153) +++ trunk/test/CheckReturn/main.cpp 2011-10-17 20:04:54 UTC (rev 1154) @@ -135,6 +135,7 @@ // 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 @@ { // 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; } // ---------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |