diff options
Diffstat (limited to 'Source/CTest/cmCTestRunTest.cxx')
-rw-r--r-- | Source/CTest/cmCTestRunTest.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 3719d45..ce44097 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -83,7 +83,8 @@ void cmCTestRunTest::CompressOutput() reinterpret_cast<unsigned char*>( const_cast<char*>(this->ProcessOutput.c_str())); //zlib makes the guarantee that this is the maximum output size - int outSize = static_cast<int>(this->ProcessOutput.size() * 1.001 + 13); + int outSize = static_cast<int>( + static_cast<double>(this->ProcessOutput.size()) * 1.001 + 13.0); unsigned char* out = new unsigned char[outSize]; strm.zalloc = Z_NULL; @@ -342,13 +343,14 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started) //---------------------------------------------------------------------- void cmCTestRunTest::ComputeWeightedCost() { - int prev = this->TestProperties->PreviousRuns; - float avgcost = this->TestProperties->Cost; + double prev = static_cast<double>(this->TestProperties->PreviousRuns); + double avgcost = static_cast<double>(this->TestProperties->Cost); double current = this->TestResult.ExecutionTime; if(this->TestResult.Status == cmCTestTestHandler::COMPLETED) { - this->TestProperties->Cost = ((prev * avgcost) + current) / (prev + 1); + this->TestProperties->Cost = + static_cast<float>(((prev * avgcost) + current) / (prev + 1.0)); this->TestProperties->PreviousRuns++; } } @@ -569,7 +571,7 @@ double cmCTestRunTest::ResolveTimeout() { stop_time += 24*60*60; } - int stop_timeout = (stop_time - current_time) % (24*60*60); + int stop_timeout = static_cast<int>(stop_time - current_time) % (24*60*60); this->CTest->LastStopTimeout = stop_timeout; if(stop_timeout <= 0 || stop_timeout > this->CTest->LastStopTimeout) |