Fix unit tests for android build

This commit is contained in:
Jörg-Christian Böhme 2018-03-04 21:26:08 +01:00
parent 73897b4357
commit 181fc0eea3
10 changed files with 29 additions and 29 deletions

View File

@ -71,12 +71,12 @@ void NamedEventTest::testNamedEvent()
}
catch(Poco::NotImplementedException e)
{
#ifndef POCO_ANDROID
#if POCO_OS != POCO_OS_ANDROID
throw e;
#endif
}
thr1.join();
#ifndef POCO_ANDROID
#if POCO_OS != POCO_OS_ANDROID
assert (te.timestamp() > now);
#endif
Thread thr2;
@ -88,12 +88,12 @@ void NamedEventTest::testNamedEvent()
}
catch(Poco::NotImplementedException e)
{
#ifndef POCO_ANDROID
#if POCO_OS != POCO_OS_ANDROID
throw e;
#endif
}
thr2.join();
#ifndef POCO_ANDROID
#if POCO_OS != POCO_OS_ANDROID
assert (te.timestamp() > now);
#endif
}

View File

@ -100,7 +100,7 @@ void NamedMutexTest::testLock()
}
catch(Poco::NotImplementedException e)
{
#ifndef POCO_ANDROID
#if POCO_OS != POCO_OS_ANDROID
throw e;
#endif
}
@ -113,7 +113,7 @@ void NamedMutexTest::testTryLock()
TestTryLock ttl1;
thr1.start(ttl1);
thr1.join();
#ifndef POCO_ANDROID
#if POCO_OS != POCO_OS_ANDROID
assert (ttl1.locked());
#endif
try {
@ -127,7 +127,7 @@ void NamedMutexTest::testTryLock()
}
catch(Poco::NotImplementedException e)
{
#ifndef POCO_ANDROID
#if POCO_OS != POCO_OS_ANDROID
throw e;
#endif
}

View File

@ -37,7 +37,7 @@ void ProcessTest::testLaunch()
{
std::string name("TestApp");
std::string cmd;
#if defined(_DEBUG) && !(defined(POCO_ANDROID))
#if defined(_DEBUG) && (POCO_OS != POCO_OS_ANDROID)
name += "d";
#endif
@ -67,7 +67,7 @@ void ProcessTest::testLaunchRedirectIn()
#if !defined(_WIN32_WCE)
std::string name("TestApp");
std::string cmd;
#if defined(_DEBUG) && !(defined(POCO_ANDROID))
#if defined(_DEBUG) && (POCO_OS != POCO_OS_ANDROID)
name += "d";
#endif
@ -96,7 +96,7 @@ void ProcessTest::testLaunchRedirectOut()
#if !defined(_WIN32_WCE)
std::string name("TestApp");
std::string cmd;
#if defined(_DEBUG) && !(defined(POCO_ANDROID))
#if defined(_DEBUG) && (POCO_OS != POCO_OS_ANDROID)
name += "d";
#endif
@ -127,7 +127,7 @@ void ProcessTest::testLaunchEnv()
#if !defined(_WIN32_WCE)
std::string name("TestApp");
std::string cmd;
#if defined(_DEBUG) && !(defined(POCO_ANDROID))
#if defined(_DEBUG) && (POCO_OS != POCO_OS_ANDROID)
name += "d";
#endif
@ -213,7 +213,7 @@ void ProcessTest::testIsRunning()
#if !defined(_WIN32_WCE)
std::string name("TestApp");
std::string cmd;
#if defined(_DEBUG) && !(defined(POCO_ANDROID))
#if defined(_DEBUG) && (POCO_OS != POCO_OS_ANDROID)
name += "d";
#endif

View File

@ -291,7 +291,7 @@ void MongoDBTest::testBuildInfo()
void MongoDBTest::testConnectionPool()
{
#ifdef POCO_ANDROID
#if POCO_OS == POCO_OS_ANDROID
std::string host = "10.0.2.2";
#else
std::string host = "127.0.0.1";
@ -406,7 +406,7 @@ void MongoDBTest::testConnectURI()
Poco::MongoDB::Connection conn;
Poco::MongoDB::Connection::SocketFactory sf;
#ifdef POCO_ANDROID
#if POCO_OS == POCO_OS_ANDROID
std::string host = "10.0.2.2";
#else
std::string host = "127.0.0.1";
@ -454,7 +454,7 @@ void MongoDBTest::testConnectURI()
CppUnit::Test* MongoDBTest::suite()
{
#ifdef POCO_ANDROID
#if POCO_OS == POCO_OS_ANDROID
std::string host = "10.0.2.2";
#else
std::string host = "127.0.0.1";

View File

@ -52,7 +52,7 @@ void ICMPClientTest::testPing()
registerDelegates(icmpClient);
assert(icmpClient.ping("127.0.0.1") > 0);
#ifdef POCO_ANDROID
#if POCO_OS == POCO_OS_ANDROID
assert(icmpClient.ping("10.0.2.15", 4) > 0);
assert(icmpClient.ping("10.0.2.2", 4) > 0);
#else
@ -77,7 +77,7 @@ void ICMPClientTest::testBigPing()
registerDelegates(icmpClient);
assert(icmpClient.ping("127.0.0.1", 1) > 0);
#ifdef POCO_ANDROID
#if POCO_OS == POCO_OS_ANDROID
assert(icmpClient.ping("10.0.2.15", 4) > 0);
assert(icmpClient.ping("10.0.2.2", 4) > 0);
#else

View File

@ -60,7 +60,7 @@ void MulticastSocketTest::testMulticast()
}
catch(Poco::NotImplementedException e)
{
#ifndef POCO_ANDROID
#if POCO_OS != POCO_OS_ANDROID
throw e;
#endif
}

View File

@ -48,7 +48,7 @@ NTPClientTest::~NTPClientTest()
void NTPClientTest::testTimeSync()
{
#ifndef POCO_ANDROID
#if POCO_OS != POCO_OS_ANDROID
if (ICMPClient::pingIPv4("pool.ntp.org") <= 0)
{
std::cerr << "pool.ntp.org not accessibe, test skipped" << std::endl;

View File

@ -77,7 +77,7 @@ void NetworkInterfaceTest::testMap()
}
catch(Poco::NotImplementedException e)
{
#ifndef POCO_ANDROID
#if POCO_OS != POCO_OS_ANDROID
throw e;
#endif
}
@ -121,7 +121,7 @@ void NetworkInterfaceTest::testList()
}
catch(Poco::NotImplementedException e)
{
#ifndef POCO_ANDROID
#if POCO_OS != POCO_OS_ANDROID
throw e;
#endif
}
@ -141,7 +141,7 @@ void NetworkInterfaceTest::testForName()
}
catch(Poco::NotImplementedException e)
{
#ifndef POCO_ANDROID
#if POCO_OS != POCO_OS_ANDROID
throw e;
#endif
}
@ -186,7 +186,7 @@ void NetworkInterfaceTest::testForAddress()
}
catch(Poco::NotImplementedException e)
{
#ifndef POCO_ANDROID
#if POCO_OS != POCO_OS_ANDROID
throw e;
#endif
}
@ -206,7 +206,7 @@ void NetworkInterfaceTest::testForIndex()
}
catch(Poco::NotImplementedException e)
{
#ifndef POCO_ANDROID
#if POCO_OS != POCO_OS_ANDROID
throw e;
#endif
}
@ -233,7 +233,7 @@ void NetworkInterfaceTest::testMapIpOnly()
}
catch(Poco::NotImplementedException e)
{
#ifndef POCO_ANDROID
#if POCO_OS != POCO_OS_ANDROID
throw e;
#endif
}
@ -253,7 +253,7 @@ void NetworkInterfaceTest::testMapUpOnly()
}
catch(Poco::NotImplementedException e)
{
#ifndef POCO_ANDROID
#if POCO_OS != POCO_OS_ANDROID
throw e;
#endif
}
@ -300,7 +300,7 @@ void NetworkInterfaceTest::testListMapConformance()
}
catch(Poco::NotImplementedException e)
{
#ifndef POCO_ANDROID
#if POCO_OS != POCO_OS_ANDROID
throw e;
#endif
}

View File

@ -503,7 +503,7 @@ void SocketTest::testSelect3()
void SocketTest::testEchoUnixLocal()
{
#if defined(POCO_OS_FAMILY_UNIX)
#if defined(POCO_ANDROID)
#if POCO_OS == POCO_OS_ANDROID
Poco::File socketFile("/data/local/tmp/SocketTest.sock");
#else
Poco::File socketFile("/tmp/SocketTest.sock");

View File

@ -32,7 +32,7 @@ RedisTest::RedisTest(const std::string& name):
_host("localhost"),
_port(6379)
{
#ifdef POCO_ANDROID
#if POCO_OS == POCO_OS_ANDROID
_host = "10.0.2.2";
#endif
if (!_connected)