fix CppUnit includes

This commit is contained in:
Günter Obiltschnig
2020-01-11 22:51:54 +01:00
parent 165f5cfd20
commit fce1f89aff
16 changed files with 164 additions and 164 deletions

View File

@@ -10,7 +10,7 @@
//
#include "Poco/CppUnit/TestRunner.h"
#include "CppUnit/TestRunner.h"
#include "PostgreSQLTestSuite.h"

View File

@@ -9,8 +9,8 @@
#include "PostgreSQLTest.h"
#include "Poco/CppUnit/TestCaller.h"
#include "Poco/CppUnit/TestSuite.h"
#include "CppUnit/TestCaller.h"
#include "CppUnit/TestSuite.h"
#include "Poco/Environment.h"
#include "Poco/String.h"
#include "Poco/Format.h"
@@ -107,7 +107,7 @@ void PostgreSQLTest::testConnectNoDB()
dbConnString += " user=" + getUser();
dbConnString += " password=" + getPass();
dbConnString += " port=" + getPort();
try
{
std::cout << "Attempting to Connect to [" << dbConnString << "] without database: " << std::endl;
@@ -127,7 +127,7 @@ void PostgreSQLTest::testConnectNoDB()
std::cout << ex.displayText() << std::endl;
}
}
void PostgreSQLTest::testPostgreSQLOIDs()
{
if (!_pSession) fail ("Test not available.");
@@ -203,7 +203,7 @@ void PostgreSQLTest::testPostgreSQLOIDs()
"uuidcol uuid,"
"xmlcol xml"
")";
Oid OIDArray[] = {
1042,
20,
@@ -275,7 +275,7 @@ void PostgreSQLTest::testPostgreSQLOIDs()
2950,
142
};
_pExecutor->oidPostgreSQLTest(getHost(), getUser(), getPass(), getBase(), getPort(), tableCreateString.c_str(), OIDArray);
}
@@ -393,7 +393,7 @@ void PostgreSQLTest::testLimitOnce()
recreateIntsTable();
_pExecutor->limitOnce();
}
@@ -604,7 +604,7 @@ void PostgreSQLTest::testDateTime()
void PostgreSQLTest::testBLOB()
{
if (!_pSession) fail ("Test not available.");
recreatePersonBLOBTable();
_pExecutor->blob();
@@ -830,7 +830,7 @@ void PostgreSQLTest::testTupleWithNullable()
Info info(0, std::string("Address"), 10);
*_pSession << "INSERT INTO NullableStringTest VALUES($1, $2, $3)", use(info), now;
info.set<0>(info.get<0>()++);
info.set<1>(null);
*_pSession << "INSERT INTO NullableStringTest VALUES($1, $2, $3)", use(info), now;

View File

@@ -17,7 +17,7 @@
#include "Poco/Data/PostgreSQL/PostgreSQL.h"
#include "Poco/Data/Session.h"
#include "Poco/SharedPtr.h"
#include "Poco/CppUnit/TestCase.h"
#include "CppUnit/TestCase.h"
#include "SQLExecutor.h"
@@ -94,7 +94,7 @@ public:
void testNullableInt();
void testNullableString();
void testTupleWithNullable();
void testSessionTransaction();
void testTransaction();

View File

@@ -12,7 +12,7 @@
#define PostgreSQLTestSuite_INCLUDED
#include "Poco/CppUnit/TestSuite.h"
#include "CppUnit/TestSuite.h"
class PostgreSQLTestSuite
{

View File

@@ -8,7 +8,7 @@
//
#include "Poco/CppUnit/TestCase.h"
#include "CppUnit/TestCase.h"
#include "SQLExecutor.h"
#include "Poco/String.h"
#include "Poco/ByteOrder.h"
@@ -229,7 +229,7 @@ void SQLExecutor::oidPostgreSQLTest(std::string host, std::string user, std::str
wasErrorEncountered = true;
break;
}
}
PQclear(pResult);
@@ -277,7 +277,7 @@ void SQLExecutor::barebonePostgreSQLTest(std::string host, std::string user, std
pConnection = PQconnectdb(connectionString.c_str());
assertTrue (PQstatus(pConnection) == CONNECTION_OK);
PGresult * pResult = 0;
std::string sql = "DROP TABLE IF EXISTS Test";
@@ -477,7 +477,7 @@ void SQLExecutor::simpleAccess()
}
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
try { *_pSession << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
@@ -739,7 +739,7 @@ void SQLExecutor::insertSingleBulkVec()
{
std::string funct = "insertSingleBulkVec()";
std::vector<int> data;
for (int x = 0; x < 100; ++x)
data.push_back(x);
@@ -1128,7 +1128,7 @@ void SQLExecutor::multiMapComplex()
people.insert(std::make_pair("LN1", p1));
people.insert(std::make_pair("LN1", p1));
people.insert(std::make_pair("LN2", p2));
try { *_pSession << "INSERT INTO Person VALUES ($1,$2,$3,$4)", use(people), now; }
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
@@ -1454,7 +1454,7 @@ void SQLExecutor::dateTime()
std::string firstName("Simpson");
std::string address("Springfield");
DateTime birthday(1980, 4, 1, 5, 45, 12);
int count = 0;
try { *_pSession << "INSERT INTO Person VALUES ($1,$2,$3,$4)", use(lastName), use(firstName), use(address), use(birthday), now; }
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
@@ -1463,14 +1463,14 @@ void SQLExecutor::dateTime()
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
assertTrue (count == 1);
DateTime bd;
assertTrue (bd != birthday);
try { *_pSession << "SELECT Birthday FROM Person", into(bd), now; }
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
assertTrue (bd == birthday);
std::cout << std::endl << RecordSet(*_pSession, "SELECT * FROM Person");
}
@@ -1482,7 +1482,7 @@ void SQLExecutor::date()
std::string firstName("Simpson");
std::string address("Springfield");
Date birthday(1980, 4, 1);
int count = 0;
try { *_pSession << "INSERT INTO Person VALUES ($1,$2,$3,$4)", use(lastName), use(firstName), use(address), use(birthday), now; }
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
@@ -1491,14 +1491,14 @@ void SQLExecutor::date()
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
assertTrue (count == 1);
Date bd;
assertTrue (bd != birthday);
try { *_pSession << "SELECT Birthday FROM Person", into(bd), now; }
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
assertTrue (bd == birthday);
std::cout << std::endl << RecordSet(*_pSession, "SELECT * FROM Person");
}
@@ -1510,7 +1510,7 @@ void SQLExecutor::time()
std::string firstName("Simpson");
std::string address("Springfield");
Time birthday(1, 2, 3);
int count = 0;
try { *_pSession << "INSERT INTO Person VALUES ($1,$2,$3,$4)", use(lastName), use(firstName), use(address), use(birthday), now; }
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
@@ -1519,14 +1519,14 @@ void SQLExecutor::time()
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
assertTrue (count == 1);
Time bd;
assertTrue (bd != birthday);
try { *_pSession << "SELECT Birthday FROM Person", into(bd), now; }
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
assertTrue (bd == birthday);
std::cout << std::endl << RecordSet(*_pSession, "SELECT * FROM Person");
}
@@ -1769,7 +1769,7 @@ void SQLExecutor::internalExtraction()
void SQLExecutor::doNull()
{
std::string funct = "null()";
*_pSession << "INSERT INTO Vectors VALUES ($1, $2, $3)",
use(Poco::Data::Keywords::null),
use(Poco::Data::Keywords::null),
@@ -1814,10 +1814,10 @@ void SQLExecutor::setTransactionIsolation(Session& session, Poco::UInt32 ti)
{
Transaction t(session, false);
t.setIsolation(ti);
assertTrue (ti == t.getIsolation());
assertTrue (t.isIsolation(ti));
assertTrue (ti == session.getTransactionIsolation());
assertTrue (session.isTransactionIsolation(ti));
}
@@ -1983,11 +1983,11 @@ void SQLExecutor::transaction(const std::string& connect)
Transaction trans((*_pSession));
assertTrue (trans.isActive());
assertTrue (_pSession->isTransaction());
try { (*_pSession) << "INSERT INTO Person VALUES ($1,$2,$3,$4)", use(lastNames), use(firstNames), use(addresses), use(ages), now; }
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
assertTrue (_pSession->isTransaction());
assertTrue (trans.isActive());
@@ -2079,7 +2079,7 @@ void SQLExecutor::transaction(const std::string& connect)
assertTrue (0 == count);
trans.execute(sql);
local << "SELECT COUNT(*) FROM Person", into(locCount), now;
assertTrue (2 == locCount);