Clamp exit code internally, so it doesn’t have to be done in every main() implies

This commit is contained in:
Phil Nash
2017-06-27 11:37:42 +01:00
parent fae0fa4ec1
commit 4c1880b35f
3 changed files with 15 additions and 15 deletions

View File

@@ -23,7 +23,7 @@ int main( int argc, char* argv[] ) {
// global clean-up...
return ( result < 0xff ? result : 0xff );
return result;
}
```
@@ -66,10 +66,10 @@ int main( int argc, char* argv[] )
// only do this if you know you need to
int numFailed = session.run();
// Note that on unices only the lower 8 bits are usually used, clamping
// the return value to 255 prevents false negative when some multiple
// of 256 tests has failed
return ( numFailed < 0xff ? numFailed : 0xff );
// numFailed is clamped to 255 as some unices only use the lower 8 bits.
// This clamping has already been applied, so just return it here
// You can also do any post run clean-up here
return numFailed;
}
```