2
0
mirror of https://github.com/boostorg/thread.git synced 2026-01-29 20:12:10 +00:00

Thread: increase the number of cycles of the failing tests.

[SVN r86732]
This commit is contained in:
Vicente J. Botet Escriba
2013-11-17 00:32:28 +00:00
parent 44f9a2f4ad
commit 5753026ceb
5 changed files with 43 additions and 4 deletions

View File

@@ -4,13 +4,15 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#define BOOST_THREAD_VERSION 4
#define BOOST_THREAD_USES_LOG
//#define BOOST_THREAD_USES_LOG
#define BOOST_THREAD_USES_LOG_THREAD_ID
#include <boost/thread/detail/log.hpp>
#include <boost/thread/future.hpp>
#include <boost/assert.hpp>
#include <string>
#include <iostream>
#if defined BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION
int p1()
@@ -28,6 +30,7 @@ int p2(boost::future<int> f)
}
catch (std::exception& ex)
{
std::cout << "ERRORRRRR "<<ex.what() << "" << std::endl;
BOOST_THREAD_LOG << "ERRORRRRR "<<ex.what() << "" << BOOST_THREAD_END_LOG;
BOOST_ASSERT(false);
}
@@ -47,6 +50,7 @@ int p2s(boost::shared_future<int> f)
}
catch (std::exception& ex)
{
std::cout << "ERRORRRRR "<<ex.what() << "" << std::endl;
BOOST_THREAD_LOG << "ERRORRRRR "<<ex.what() << "" << BOOST_THREAD_END_LOG;
BOOST_ASSERT(false);
}
@@ -60,7 +64,9 @@ int p2s(boost::shared_future<int> f)
int main()
{
const int number_of_tests = 100;
BOOST_THREAD_LOG << "<MAIN" << BOOST_THREAD_END_LOG;
for (int i=0; i< number_of_tests; i++)
{
try
{
@@ -70,6 +76,7 @@ int main()
}
catch (std::exception& ex)
{
std::cout << "ERRORRRRR "<<ex.what() << "" << std::endl;
BOOST_THREAD_LOG << "ERRORRRRR "<<ex.what() << "" << BOOST_THREAD_END_LOG;
return 1;
}
@@ -80,6 +87,7 @@ int main()
}
}
{
for (int i=0; i< number_of_tests; i++)
try
{
boost::shared_future<int> f1 = boost::async(boost::launch::async, &p1).share();
@@ -88,6 +96,7 @@ int main()
}
catch (std::exception& ex)
{
std::cout << "ERRORRRRR "<<ex.what() << "" << std::endl;
BOOST_THREAD_LOG << "ERRORRRRR "<<ex.what() << "" << BOOST_THREAD_END_LOG;
return 1;
}