Fix floating point comparison warnings. Thanks to Alex Neundorf for the patch.

This commit is contained in:
David Cole 2009-10-13 16:39:48 -04:00
parent 4dc224e99a
commit 85feea2d0d
3 changed files with 7 additions and 7 deletions

View File

@ -251,7 +251,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
tarIt != this->BuildTargets.end(); ++ tarIt )
{
double remainingTime = 0;
if (this->Timeout)
if (this->Timeout > 0)
{
remainingTime = this->Timeout - cmSystemTools::GetTime() + clock_start;
if (remainingTime <= 0)
@ -376,7 +376,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
// how much time is remaining
double remainingTime = 0;
if (this->Timeout)
if (this->Timeout > 0)
{
remainingTime = this->Timeout - cmSystemTools::GetTime() + clock_start;
if (remainingTime <= 0)

View File

@ -419,11 +419,11 @@ bool cmCTestRunTest::CreateProcess(double testTimeOut,
// determine how much time we have
double timeout = this->CTest->GetRemainingTimeAllowed() - 120;
if (this->CTest->GetTimeOut() && this->CTest->GetTimeOut() < timeout)
if (this->CTest->GetTimeOut() > 0 && this->CTest->GetTimeOut() < timeout)
{
timeout = this->CTest->GetTimeOut();
}
if (testTimeOut
if (testTimeOut > 0
&& testTimeOut < this->CTest->GetRemainingTimeAllowed())
{
timeout = testTimeOut;

View File

@ -1082,11 +1082,11 @@ int cmCTest::RunTest(std::vector<const char*> argv,
// determine how much time we have
double timeout = this->GetRemainingTimeAllowed() - 120;
if (this->TimeOut && this->TimeOut < timeout)
if (this->TimeOut > 0 && this->TimeOut < timeout)
{
timeout = this->TimeOut;
}
if (testTimeOut
if (testTimeOut > 0
&& testTimeOut < this->GetRemainingTimeAllowed())
{
timeout = testTimeOut;
@ -1118,7 +1118,7 @@ int cmCTest::RunTest(std::vector<const char*> argv,
// make sure we pass the timeout in for any build and test
// invocations. Since --build-generator is required this is a
// good place to check for it, and to add the arguments in
if (strcmp(argv[i],"--build-generator") == 0 && timeout)
if (strcmp(argv[i],"--build-generator") == 0 && timeout > 0)
{
args.push_back("--test-timeout");
cmOStringStream msg;