Changeset - ee2e261f6b2b
[Not reviewed]
0 1 0
Vitaly Takmazov - 8 years ago 2017-11-07 13:15:21
vitalyster@gmail.com
using boost::thread::sleep, fixes tests under MSVC
1 file changed with 4 insertions and 5 deletions:
0 comments (0 inline, 0 general)
tests/libtransport/HTTPRequest.cpp
Show inline comments
 
#include <boost/thread/thread.hpp>
 
#include <cppunit/TestFixture.h>
 
#include <cppunit/extensions/HelperMacros.h>
 
#include <Swiften/Swiften.h>
 
@@ -20,10 +21,6 @@ using namespace Transport;
 
#define get_value_or(X) substr()
 
#endif
 

	
 
#ifdef _MSC_VER
 
#define sleep Sleep
 
#endif
 

	
 
class HTTPRequestTest : public CPPUNIT_NS :: TestFixture, public BasicTest {
 
	CPPUNIT_TEST_SUITE(HTTPRequestTest);
 
	CPPUNIT_TEST(GETThreadPool);
 
@@ -61,7 +58,9 @@ class HTTPRequestTest : public CPPUNIT_NS :: TestFixture, public BasicTest {
 

	
 
		int i = 0;
 
		while (result == false && i < 5) {
 
			sleep(1);
 
			boost::system_time time = boost::get_system_time();
 
			time += boost::posix_time::seconds(1);
 
			boost::thread::sleep(time);
 
			loop->processEvents();
 
			i++;
 
		}
0 comments (0 inline, 0 general)