From 085a3e7b6045c435bc21442c867c9d3ed8d3bb60 Mon Sep 17 00:00:00 2001 From: Roger Meier Date: Fri, 8 Oct 2010 21:23:35 +0000 Subject: [PATCH] THRIFT-926 Miscellaneous C++ improvements changing single destructor call time limit from 500us to 1000us build does not fail on busy machines git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1006030 13f79535-47bb-0310-9956-ffa450edef68 --- lib/cpp/test/TFileTransportTest.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/cpp/test/TFileTransportTest.cpp b/lib/cpp/test/TFileTransportTest.cpp index d402d5d1..fade0959 100644 --- a/lib/cpp/test/TFileTransportTest.cpp +++ b/lib/cpp/test/TFileTransportTest.cpp @@ -169,7 +169,7 @@ BOOST_AUTO_TEST_CASE(test_destructor) { unsigned int const NUM_ITERATIONS = 1000; - unsigned int num_over_500us = 0; + unsigned int num_over = 0; for (unsigned int n = 0; n < NUM_ITERATIONS; ++n) { ftruncate(f.getFD(), 0); @@ -201,16 +201,16 @@ BOOST_AUTO_TEST_CASE(test_destructor) { // looping over a very slow operation. BOOST_REQUIRE_LT(delta, 100000); - // Normally, it takes less than 500us on my dev box. + // Normally, it takes less than 1000us on my dev box. // However, if the box is heavily loaded, some of the test runs // take longer, since we're just waiting for our turn on the CPU. - if (delta > 500) { - ++num_over_500us; + if (delta > 1000) { + ++num_over; } } - // Make sure fewer than 10% of the runs took longer than 500us - BOOST_CHECK(num_over_500us < (NUM_ITERATIONS / 10)); + // Make sure fewer than 10% of the runs took longer than 1000us + BOOST_CHECK(num_over < (NUM_ITERATIONS / 10)); } /** -- 2.17.1