diff --git a/Data/DataTest/CMakeLists.txt b/Data/DataTest/CMakeLists.txt index 10a44858d8..5801195ca2 100644 --- a/Data/DataTest/CMakeLists.txt +++ b/Data/DataTest/CMakeLists.txt @@ -3,7 +3,7 @@ file(GLOB SRCS_G ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp) POCO_SOURCES_AUTO(DATA_TEST_LIB_SRCS ${SRCS_G}) # Headers -file(GLOB HDRS_G ${CMAKE_CURRENT_SOURCE_DIR}/include/*.h) +file(GLOB HDRS_G ${CMAKE_CURRENT_SOURCE_DIR}/include/Poco/Data/Test/*.h) POCO_HEADERS_AUTO(DATA_TEST_LIB_SRCS ${HDRS_G}) # Version Resource diff --git a/Data/DataTest/include/Poco/Data/Test/SQLExecutor.h b/Data/DataTest/include/Poco/Data/Test/SQLExecutor.h index 8833fa2a97..e557b717df 100644 --- a/Data/DataTest/include/Poco/Data/Test/SQLExecutor.h +++ b/Data/DataTest/include/Poco/Data/Test/SQLExecutor.h @@ -14,15 +14,13 @@ #define DataTest_SQLExecutor_INCLUDED +#include "CppUnit/TestCase.h" #include "Poco/Data/Test/DataTest.h" #include "Poco/Data/Session.h" #include "Poco/Data/BulkExtraction.h" #include "Poco/Data/BulkBinding.h" -#include "Poco/NumberFormatter.h" -#include "Poco/String.h" #include "Poco/Exception.h" #include -#include namespace Poco { @@ -55,7 +53,7 @@ class DataTest_API SQLExecutor: public CppUnit::TestCase }; SQLExecutor(const std::string& name, Poco::Data::Session* pSession, Poco::Data::Session* pEncSession = nullptr, bool numberedPlaceHolders = false); - ~SQLExecutor(); + ~SQLExecutor() override; template void connection(C& c, const std::string& connectString) diff --git a/Data/ODBC/include/Poco/Data/ODBC/Diagnostics.h b/Data/ODBC/include/Poco/Data/ODBC/Diagnostics.h index 4e0ffbe64f..fa7585be4e 100644 --- a/Data/ODBC/include/Poco/Data/ODBC/Diagnostics.h +++ b/Data/ODBC/include/Poco/Data/ODBC/Diagnostics.h @@ -45,9 +45,9 @@ class Diagnostics { public: - inline static const unsigned int SQL_STATE_SIZE = SQL_SQLSTATE_SIZE + 1; - inline static const unsigned int SQL_MESSAGE_LENGTH = SQL_MAX_MESSAGE_LENGTH + 1; - inline static const unsigned int SQL_NAME_LENGTH = 128; + static constexpr unsigned int SQL_STATE_SIZE = SQL_SQLSTATE_SIZE + 1; + static constexpr unsigned int SQL_MESSAGE_LENGTH = SQL_MAX_MESSAGE_LENGTH + 1; + static constexpr unsigned int SQL_NAME_LENGTH = 128; inline static const std::string DATA_TRUNCATED; struct DiagnosticFields diff --git a/Data/ODBC/testsuite/src/ODBCAccessTest.h b/Data/ODBC/testsuite/src/ODBCAccessTest.h index 18bd6ce11a..7b48b2c76c 100644 --- a/Data/ODBC/testsuite/src/ODBCAccessTest.h +++ b/Data/ODBC/testsuite/src/ODBCAccessTest.h @@ -32,12 +32,12 @@ class ODBCAccessTest: public CppUnit::TestCase { public: ODBCAccessTest(const std::string& name); - ~ODBCAccessTest(); + ~ODBCAccessTest() override; void testSimpleAccess(); - void setUp(); - void tearDown(); + void setUp() override; + void tearDown() override; static CppUnit::Test* suite(); diff --git a/Data/ODBC/testsuite/src/ODBCDB2Test.h b/Data/ODBC/testsuite/src/ODBCDB2Test.h index 821eba601b..56808f2d90 100644 --- a/Data/ODBC/testsuite/src/ODBCDB2Test.h +++ b/Data/ODBC/testsuite/src/ODBCDB2Test.h @@ -28,37 +28,37 @@ class ODBCDB2Test: public ODBCTest { public: ODBCDB2Test(const std::string& name); - ~ODBCDB2Test(); + ~ODBCDB2Test() override; - void testBareboneODBC(); + void testBareboneODBC() override; - void testBLOB(); - void testFilter(); + void testBLOB() override; + void testFilter() override; - void testStoredProcedure(); - void testStoredProcedureAny(); - void testStoredProcedureDynamicVar(); - void testStoredFunction(); + void testStoredProcedure() override; + void testStoredProcedureAny() override; + void testStoredProcedureDynamicVar() override; + void testStoredFunction() override; static CppUnit::Test* suite(); private: - void dropObject(const std::string& type, const std::string& tableName); - void recreateNullableTable(); - void recreatePersonTable(); - void recreatePersonBLOBTable(); - void recreatePersonDateTable(); - void recreatePersonTimeTable(); - void recreatePersonDateTimeTable(); - void recreateStringsTable(); - void recreateIntsTable(); - void recreateFloatsTable(); - void recreateTuplesTable(); - void recreateVectorsTable(); - void recreateAnysTable(); - void recreateNullsTable(const std::string& notNull = ""); - void recreateMiscTable(); - void recreateLogTable(); + void dropObject(const std::string& type, const std::string& tableName) override; + void recreateNullableTable() override; + void recreatePersonTable() override; + void recreatePersonBLOBTable() override; + void recreatePersonDateTable() override; + void recreatePersonTimeTable() override; + void recreatePersonDateTimeTable() override; + void recreateStringsTable() override; + void recreateIntsTable() override; + void recreateFloatsTable() override; + void recreateTuplesTable() override; + void recreateVectorsTable() override; + void recreateAnysTable() override; + void recreateNullsTable(const std::string& notNull = "") override; + void recreateMiscTable() override; + void recreateLogTable() override; static ODBCTest::SessionPtr _pSession; static ODBCTest::ExecPtr _pExecutor; diff --git a/Data/ODBC/testsuite/src/ODBCMySQLTest.h b/Data/ODBC/testsuite/src/ODBCMySQLTest.h index ce11041090..577bf393ac 100644 --- a/Data/ODBC/testsuite/src/ODBCMySQLTest.h +++ b/Data/ODBC/testsuite/src/ODBCMySQLTest.h @@ -31,39 +31,39 @@ class ODBCMySQLTest: public ODBCTest { public: ODBCMySQLTest(const std::string& name); - ~ODBCMySQLTest(); + ~ODBCMySQLTest() override; - void testBareboneODBC(); + void testBareboneODBC() override; - void testBLOB(); + void testBLOB() override; - void testStoredProcedure(); - void testStoredFunction(); + void testStoredProcedure() override; + void testStoredFunction() override; - void testNull(); + void testNull() override; - void testMultipleResults(); - void testFilter(); + void testMultipleResults() override; + void testFilter() override; static CppUnit::Test* suite(); private: - void dropObject(const std::string& type, const std::string& name); - void recreateNullableTable(); - void recreatePersonTable(); - void recreatePersonBLOBTable(); - void recreatePersonDateTable(); - void recreatePersonTimeTable(); - void recreatePersonDateTimeTable(); - void recreateStringsTable(); - void recreateIntsTable(); - void recreateFloatsTable(); - void recreateTuplesTable(); - void recreateVectorsTable(); - void recreateAnysTable(); - void recreateNullsTable(const std::string& notNull = ""); - void recreateMiscTable(); - void recreateLogTable(); + void dropObject(const std::string& type, const std::string& name) override; + void recreateNullableTable() override; + void recreatePersonTable() override; + void recreatePersonBLOBTable() override; + void recreatePersonDateTable() override; + void recreatePersonTimeTable() override; + void recreatePersonDateTimeTable() override; + void recreateStringsTable() override; + void recreateIntsTable() override; + void recreateFloatsTable() override; + void recreateTuplesTable() override; + void recreateVectorsTable() override; + void recreateAnysTable() override; + void recreateNullsTable(const std::string& notNull = "") override; + void recreateMiscTable() override; + void recreateLogTable() override; static ODBCTest::SessionPtr _pSession; static ODBCTest::ExecPtr _pExecutor; diff --git a/Data/ODBC/testsuite/src/ODBCOracleTest.h b/Data/ODBC/testsuite/src/ODBCOracleTest.h index b8d76163a8..a4df4a21bd 100644 --- a/Data/ODBC/testsuite/src/ODBCOracleTest.h +++ b/Data/ODBC/testsuite/src/ODBCOracleTest.h @@ -30,47 +30,47 @@ class ODBCOracleTest: public ODBCTest { public: ODBCOracleTest(const std::string& name); - ~ODBCOracleTest(); + ~ODBCOracleTest() override; - void testBareboneODBC(); + void testBareboneODBC() override; - void testBLOB(); + void testBLOB() override; - void testMultipleResults(); + void testMultipleResults() override; - virtual void testTransaction(); + void testTransaction() override; - void testStoredProcedure(); + void testStoredProcedure() override; void testCursorStoredProcedure(); - void testStoredFunction(); + void testStoredFunction() override; void testCursorStoredFunction(); - void testStoredProcedureAny(); - void testStoredProcedureDynamicVar(); + void testStoredProcedureAny() override; + void testStoredProcedureDynamicVar() override; void testAutoTransaction(); - void testNull(); + void testNull() override; static CppUnit::Test* suite(); private: static void testBarebone(); - void dropObject(const std::string& type, const std::string& name); - void recreateNullableTable(); - void recreatePersonTable(); - void recreatePersonTupleTable(); - void recreatePersonBLOBTable(); - void recreatePersonDateTable(); - void recreatePersonDateTimeTable(); - void recreateStringsTable(); - void recreateIntsTable(); - void recreateFloatsTable(); - void recreateTuplesTable(); - void recreateVectorsTable(); - void recreateAnysTable(); - void recreateNullsTable(const std::string& notNull = ""); - void recreateMiscTable(); - void recreateLogTable(); - void recreateUnicodeTable(); + void dropObject(const std::string& type, const std::string& name) override; + void recreateNullableTable() override; + void recreatePersonTable() override; + void recreatePersonTupleTable() override; + void recreatePersonBLOBTable() override; + void recreatePersonDateTable() override; + void recreatePersonDateTimeTable() override; + void recreateStringsTable() override; + void recreateIntsTable() override; + void recreateFloatsTable() override; + void recreateTuplesTable() override; + void recreateVectorsTable() override; + void recreateAnysTable() override; + void recreateNullsTable(const std::string& notNull = "") override; + void recreateMiscTable() override; + void recreateLogTable() override; + void recreateUnicodeTable() override; static ODBCTest::SessionPtr _pSession; static ODBCTest::ExecPtr _pExecutor; diff --git a/Data/ODBC/testsuite/src/ODBCPostgreSQLTest.h b/Data/ODBC/testsuite/src/ODBCPostgreSQLTest.h index 37b47a7b9e..694289f4e8 100644 --- a/Data/ODBC/testsuite/src/ODBCPostgreSQLTest.h +++ b/Data/ODBC/testsuite/src/ODBCPostgreSQLTest.h @@ -37,37 +37,37 @@ class ODBCPostgreSQLTest: public ODBCTest { public: ODBCPostgreSQLTest(const std::string& name); - ~ODBCPostgreSQLTest(); + ~ODBCPostgreSQLTest() override; - void testBareboneODBC(); + void testBareboneODBC() override; - void testBLOB(); + void testBLOB() override; - void testStoredFunction(); - void testStoredFunctionAny(); - void testStoredFunctionDynamicAny(); + void testStoredFunction() override; + void testStoredFunctionAny() override; + void testStoredFunctionDynamicAny() override; static CppUnit::Test* suite(); private: - void dropObject(const std::string& type, const std::string& name); - void recreateNullableTable(); - void recreatePersonTable(); - void recreatePersonBLOBTable(); - void recreatePersonDateTimeTable(); - void recreatePersonDateTable(); - void recreatePersonTimeTable(); - void recreateStringsTable(); - void recreateIntsTable(); - void recreateFloatsTable(); - void recreateTuplesTable(); - void recreateVectorsTable(); - void recreateAnysTable(); - void recreateNullsTable(const std::string& notNull=""); - void recreateBoolTable(); - void recreateMiscTable(); - void recreateLogTable(); - void recreateUnicodeTable(); + void dropObject(const std::string& type, const std::string& name) override; + void recreateNullableTable() override; + void recreatePersonTable() override; + void recreatePersonBLOBTable() override; + void recreatePersonDateTimeTable() override; + void recreatePersonDateTable() override; + void recreatePersonTimeTable() override; + void recreateStringsTable() override; + void recreateIntsTable() override; + void recreateFloatsTable() override; + void recreateTuplesTable() override; + void recreateVectorsTable() override; + void recreateAnysTable() override; + void recreateNullsTable(const std::string& notNull = "") override; + void recreateBoolTable() override; + void recreateMiscTable() override; + void recreateLogTable() override; + void recreateUnicodeTable() override; void configurePLPgSQL(); /// Configures PL/pgSQL in the database. A reasonable defaults diff --git a/Data/ODBC/testsuite/src/ODBCSQLServerTest.h b/Data/ODBC/testsuite/src/ODBCSQLServerTest.h index ba05b2edb5..61f95be9b1 100644 --- a/Data/ODBC/testsuite/src/ODBCSQLServerTest.h +++ b/Data/ODBC/testsuite/src/ODBCSQLServerTest.h @@ -40,51 +40,51 @@ class ODBCSQLServerTest: public ODBCTest { public: ODBCSQLServerTest(const std::string& name); - ~ODBCSQLServerTest(); + ~ODBCSQLServerTest() override; - void testBareboneODBC(); + void testBareboneODBC() override; - void testTempTable(); + void testTempTable() override; - void testBLOB(); + void testBLOB() override; void testBigString(); void testBigBatch(); - void testNull(); - void testBulk(); + void testNull() override; + void testBulk() override; - void testStoredProcedure(); + void testStoredProcedure() override; void testCursorStoredProcedure(); - void testStoredProcedureAny(); - void testStoredProcedureDynamicVar(); + void testStoredProcedureAny() override; + void testStoredProcedureDynamicVar() override; void testStoredProcedureReturn(); - void testStoredFunction(); + void testStoredFunction() override; static CppUnit::Test* suite(); private: - void dropObject(const std::string& type, const std::string& name); - void recreateNullableTable(); - void recreatePersonTable(); - void recreatePersonBLOBTable(); + void dropObject(const std::string& type, const std::string& name) override; + void recreateNullableTable() override; + void recreatePersonTable() override; + void recreatePersonBLOBTable() override; void recreatePersonBigStringTable(); - void recreatePersonDateTimeTable(); - void recreatePersonDateTable() { /* no-op */ }; - void recreatePersonTimeTable() { /* no-op */ }; - void recreateStringsTable(); - void recreateIntsTable(); - void recreateFloatsTable(); - void recreateUUIDsTable(); - void recreateTuplesTable(); + void recreatePersonDateTimeTable() override; + void recreatePersonDateTable() override { /* no-op */ }; + void recreatePersonTimeTable() override { /* no-op */ }; + void recreateStringsTable() override; + void recreateIntsTable() override; + void recreateFloatsTable() override; + void recreateUUIDsTable() override; + void recreateTuplesTable() override; void recreateVectorTable(); - void recreateVectorsTable(); - void recreateAnysTable(); - void recreateNullsTable(const std::string& notNull = ""); - void recreateBoolTable(); - void recreateMiscTable(); - void recreateLogTable(); - void recreateUnicodeTable(); - void recreateEncodingTables(); + void recreateVectorsTable() override; + void recreateAnysTable() override; + void recreateNullsTable(const std::string& notNull = "") override; + void recreateBoolTable() override; + void recreateMiscTable() override; + void recreateLogTable() override; + void recreateUnicodeTable() override; + void recreateEncodingTables() override; static SessionPtr _pSession; static SessionPtr _pEncSession; diff --git a/Data/ODBC/testsuite/src/ODBCSQLiteTest.h b/Data/ODBC/testsuite/src/ODBCSQLiteTest.h index b878c15747..4789ad6057 100644 --- a/Data/ODBC/testsuite/src/ODBCSQLiteTest.h +++ b/Data/ODBC/testsuite/src/ODBCSQLiteTest.h @@ -28,29 +28,29 @@ class ODBCSQLiteTest: public ODBCTest { public: ODBCSQLiteTest(const std::string& name); - ~ODBCSQLiteTest(); + ~ODBCSQLiteTest() override; - void testBareboneODBC(); - void testAffectedRows(); - void testNull(); + void testBareboneODBC() override; + void testAffectedRows() override; + void testNull() override; static CppUnit::Test* suite(); private: - void dropObject(const std::string& type, const std::string& name); - void recreateNullableTable(); - void recreatePersonTable(); - void recreatePersonBLOBTable(); - void recreatePersonDateTimeTable(); - void recreateStringsTable(); - void recreateIntsTable(); - void recreateFloatsTable(); - void recreateTuplesTable(); - void recreateVectorsTable(); - void recreateAnysTable(); - void recreateNullsTable(const std::string& notNull = ""); - void recreateMiscTable(); - void recreateLogTable(); + void dropObject(const std::string& type, const std::string& name) override; + void recreateNullableTable() override; + void recreatePersonTable() override; + void recreatePersonBLOBTable() override; + void recreatePersonDateTimeTable() override; + void recreateStringsTable() override; + void recreateIntsTable() override; + void recreateFloatsTable() override; + void recreateTuplesTable() override; + void recreateVectorsTable() override; + void recreateAnysTable() override; + void recreateNullsTable(const std::string& notNull = "") override; + void recreateMiscTable() override; + void recreateLogTable() override; static ODBCTest::SessionPtr _pSession; static ODBCTest::ExecPtr _pExecutor; diff --git a/Data/ODBC/testsuite/src/ODBCTest.h b/Data/ODBC/testsuite/src/ODBCTest.h index 16b733e553..931fa6e7a4 100644 --- a/Data/ODBC/testsuite/src/ODBCTest.h +++ b/Data/ODBC/testsuite/src/ODBCTest.h @@ -40,10 +40,10 @@ class ODBCTest: public CppUnit::TestCase std::string& rPwd, std::string& rConnectString); - ~ODBCTest(); + ~ODBCTest() override; - virtual void setUp(); - virtual void tearDown(); + void setUp() override; + void tearDown() override; virtual void testBareboneODBC() = 0; @@ -166,7 +166,7 @@ class ODBCTest: public CppUnit::TestCase virtual void testReconnect(); protected: - typedef Poco::Data::ODBC::Utility::DriverMap Drivers; + using Drivers = Poco::Data::ODBC::Utility::DriverMap; virtual void dropObject(const std::string& type, const std::string& name); virtual void recreateNullableTable(); diff --git a/Data/ODBC/testsuite/src/SQLExecutor.h b/Data/ODBC/testsuite/src/SQLExecutor.h index 1289267176..6448fb8d51 100644 --- a/Data/ODBC/testsuite/src/SQLExecutor.h +++ b/Data/ODBC/testsuite/src/SQLExecutor.h @@ -13,16 +13,13 @@ #ifndef SQLExecutor_INCLUDED #define SQLExecutor_INCLUDED - -#include "Poco/Data/ODBC/ODBC.h" -#include "Poco/Data/ODBC/Utility.h" +#include "CppUnit/TestCase.h" #include "Poco/Data/ODBC/ODBCException.h" #include "Poco/Data/Session.h" #include "Poco/Data/BulkExtraction.h" #include "Poco/Data/BulkBinding.h" #include "Poco/Data/Test/SQLExecutor.h" #include "Poco/NumberFormatter.h" -#include "Poco/String.h" #include "Poco/Exception.h" #include @@ -88,8 +85,10 @@ class SQLExecutor: public CppUnit::TestCase DE_BOUND }; - SQLExecutor(const std::string& name, Poco::Data::Session* pSession, Poco::Data::Session* pEncSession = 0); - ~SQLExecutor(); + SQLExecutor(const std::string& name, + Poco::Data::Session* pSession, + Poco::Data::Session* pEncSession = nullptr); + ~SQLExecutor() override; void execute(const std::string& sql); /// Execute a query.