#include <boost/thread/thread.hpp>
#include <boost/chrono/chrono_io.hpp>
#include <boost/detail/lightweight_test.hpp>
+#include "../../../timming.hpp"
#if defined BOOST_THREAD_USES_CHRONO
#endif
typedef boost::chrono::milliseconds ms;
+typedef boost::chrono::nanoseconds ns;
namespace boost
{
p.set_value();
}
-#ifdef BOOST_THREAD_PLATFORM_WIN32
-const ms max_diff(250);
-#else
-const ms max_diff(75);
-#endif
+const ms max_diff(BOOST_THREAD_TEST_TIME_MS);
int main()
{
f.wait();
Clock::time_point t1 = Clock::now();
BOOST_TEST(f.valid());
- BOOST_TEST(t1 - t0 < max_diff);
+ ns d = t1 - t0;
+ BOOST_THREAD_TEST_IT(d, ns(max_diff));
}
{
typedef int& T;
f.wait();
Clock::time_point t1 = Clock::now();
BOOST_TEST(f.valid());
- BOOST_TEST(t1 - t0 < max_diff);
+ ns d = t1 - t0;
+ BOOST_THREAD_TEST_IT(d, ns(max_diff));
}
{
typedef void T;
f.wait();
Clock::time_point t1 = Clock::now();
BOOST_TEST(f.valid());
- BOOST_TEST(t1 - t0 < max_diff);
+ ns d = t1 - t0;
+ BOOST_THREAD_TEST_IT(d, ns(max_diff));
}
}
BOOST_THREAD_LOG << BOOST_THREAD_END_LOG;