diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-09-21 17:59:58 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-09-21 17:59:58 +0100 |
commit | 2128f927d13312e77f4639b08fa9753ed560064f (patch) | |
tree | e445e1ed682eb53ca06de7ffea3e303fc54d7168 | |
parent | Pass cppcheck and clang-tidy (diff) | |
download | libdbpp-2128f927d13312e77f4639b08fa9753ed560064f.tar.bz2 libdbpp-2128f927d13312e77f4639b08fa9753ed560064f.tar.xz libdbpp-2128f927d13312e77f4639b08fa9753ed560064f.zip |
First commit passing IWYU
37 files changed, 381 insertions, 51 deletions
diff --git a/Jamroot.jam b/Jamroot.jam index ed164f9..2add787 100644 --- a/Jamroot.jam +++ b/Jamroot.jam @@ -42,6 +42,7 @@ project <toolset>tidy:<checkxx>hicpp-* <toolset>tidy:<xcheckxx>hicpp-named-parameter <toolset>tidy:<checkxx>performance-* + <toolset>tidy:<mapping>iwyu.json <toolset>tidy:<librarydef>boost <toolset>tidy:<librarydef>std ; diff --git a/iwyu.json b/iwyu.json new file mode 100644 index 0000000..321a158 --- /dev/null +++ b/iwyu.json @@ -0,0 +1,181 @@ +[ + { + "symbol": [ + "Glib::ustring", + "private", + "<glibmm/ustring.h>", + "public" + ] + }, + { + "symbol": [ + "@u?int\\d\\+_t", + "private", + "<cstdint>", + "public" + ] + }, + { + "symbol": [ + "boost::posix_time::time_duration", + "private", + "<boost/date_time/posix_time/posix_time_types.hpp>", + "public" + ] + }, + { + "include": [ + "<bits/types/stack_t.h>", + "private", + "<ucontext.h>", + "public" + ] + }, + { + "symbol": [ + "free", + "private", + "<cstdlib>", + "public" + ] + }, + { + "include": [ + "<boost/cstdint.hpp>", + "private", + "<cstdint>", + "public" + ] + }, + { + "include": [ + "<ext/alloc_traits.h>", + "private", + "<memory>", + "public" + ] + }, + { + "include": [ + "<bits/struct_stat.h>", + "private", + "<sys/stat.h>", + "public" + ] + }, + { + "include": [ + "<bits/exception.h>", + "private", + "<stdexcept>", + "public" + ] + }, + { + "include": [ + "@<boost/test/(unit_test_suite|framework).hpp>", + "private", + "<boost/test/unit_test.hpp>", + "public" + ] + }, + { + "include": [ + "@<boost/test/(utils|tools|tree)/.*>", + "private", + "<boost/test/unit_test.hpp>", + "public" + ] + }, + { + "include": [ + "@<boost/format/(format_(class|implementation)|alt_sstream).hpp>", + "private", + "<boost/format.hpp>", + "public" + ] + }, + { + "include": [ + "@<boost/test/data/.*>", + "private", + "<boost/test/data/test_case.hpp>", + "public" + ] + }, + { + "include": [ + "@<boost/mpl/.*>", + "private", + "<boost/mpl/list.hpp>", + "public" + ] + }, + { + "include": [ + "@<boost/iostreams/detail/.*>", + "private", + "<boost/iostreams/stream.hpp>", + "public" + ] + }, + { + "include": [ + "@<boost/preprocessor/.*>", + "private", + "<boost/test/unit_test.hpp>", + "public" + ] + }, + { + "include": [ + "@<boost/lexical_cast/.*>", + "private", + "<boost/lexical_cast.hpp>", + "public" + ] + }, + { + "include": [ + "@<boost/program_options/.*>", + "private", + "<boost/program_options.hpp>", + "public" + ] + }, + { + "include": [ + "@<boost/multi_index/detail/index.*>", + "private", + "<boost/multi_index/ordered_index.hpp>", + "public" + ] + }, + { + "include": [ + "@<boost/multi_index/detail/ord.*>", + "private", + "<boost/multi_index/ordered_index.hpp>", + "public" + ] + }, + { + "symbol": [ + "Oid", + "private", + "<libpq-fe.h>", + "public" + ] + }, + { + "include": [ + "@<boost/multi_index/detail/bidir.*>", + "private", + "<boost/multi_index_container.hpp>", + "public" + ] + }, + { + "ref": "/usr/lib/llvm/12/share/include-what-you-use/boost-all-private.imp" + } +] diff --git a/libdbpp/Jamfile.jam b/libdbpp/Jamfile.jam index a5b9a88..06e5f5a 100644 --- a/libdbpp/Jamfile.jam +++ b/libdbpp/Jamfile.jam @@ -39,6 +39,7 @@ exe createmockdb : createMockDb.cpp : : <library>dbppcore + <library>adhocutil <library>stdc++fs <library>boost_program_options ; diff --git a/libdbpp/column.cpp b/libdbpp/column.cpp index 8b13462..7190d36 100644 --- a/libdbpp/column.cpp +++ b/libdbpp/column.cpp @@ -1,9 +1,13 @@ #include "column.h" #include <compileTimeFormatter.h> +#include <cstdlib> #include <cxxabi.h> -#include <exception> #include <memory> +namespace Glib { + class ustring; +} + namespace DB { Column::Column(const Glib::ustring & n, unsigned int i) : colNo(i), name(n.collate_key()) { } diff --git a/libdbpp/column.h b/libdbpp/column.h index f3c97be..11a4658 100644 --- a/libdbpp/column.h +++ b/libdbpp/column.h @@ -1,11 +1,8 @@ #ifndef DB_COLUMN_H #define DB_COLUMN_H -#include "dbTypes.h" #include "error.h" -#include <boost/date_time/posix_time/posix_time_types.hpp> #include <c++11Helpers.h> -#include <exception.h> #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wold-style-cast" #pragma GCC diagnostic ignored "-Wsign-conversion" @@ -14,11 +11,21 @@ #endif #include <glibmm/ustring.h> #pragma GCC diagnostic pop +#include <boost/date_time/posix_time/ptime.hpp> +#include <cstdint> #include <memory> #include <optional> +#include <string> +#include <string_view> +#include <type_traits> +#include <typeinfo> #include <visibility.h> +namespace boost::posix_time { + class time_duration; +} namespace DB { + class Blob; /// Abstract class for something that can handle field data. See Column::apply. class DLL_PUBLIC HandleField { public: @@ -44,7 +51,6 @@ namespace DB { virtual void blob(const Blob &); }; - class Command; /// Represents a column in a result set and provides access to the current rows data. class DLL_PUBLIC Column { public: diff --git a/libdbpp/command.cpp b/libdbpp/command.cpp index f2c6934..dc7922a 100644 --- a/libdbpp/command.cpp +++ b/libdbpp/command.cpp @@ -1,6 +1,8 @@ #include "command.h" #include "connection.h" #include <factory.impl.h> +#include <map> +#include <utility> INSTANTIATEFACTORY(DB::CommandOptions, std::size_t, const DB::CommandOptionsMap &) NAMEDFACTORY("", DB::CommandOptions, DB::CommandOptionsFactory) @@ -8,8 +10,6 @@ PLUGINRESOLVER(DB::CommandOptionsFactory, DB::Connection::resolvePlugin) DB::Command::Command(std::string s) : sql(std::move(s)) { } -DB::Command::~Command() = default; - DB::CommandOptions::CommandOptions(std::size_t h, const CommandOptionsMap &) : hash(h) { } bool diff --git a/libdbpp/command.h b/libdbpp/command.h index e368b5c..8c3262b 100644 --- a/libdbpp/command.h +++ b/libdbpp/command.h @@ -2,12 +2,15 @@ #define DB_COMMAND_H #include "command_fwd.h" -#include "dbTypes.h" #include "error.h" -#include <boost/date_time/posix_time/posix_time_types.hpp> +#include <boost/date_time/posix_time/ptime.hpp> #include <boost/lexical_cast.hpp> #include <c++11Helpers.h> +#include <cstddef> #include <factory.h> +#include <optional> +#include <string> +#include <string_view> #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wold-style-cast" #pragma GCC diagnostic ignored "-Wsign-conversion" @@ -16,11 +19,14 @@ #endif #include <glibmm/ustring.h> #pragma GCC diagnostic pop -#include <memory> #include <type_traits> #include <visibility.h> +namespace boost::posix_time { + class time_duration; +} namespace DB { + class Blob; /// Exception thrown when binding a parameter of type the connector doesn't support. class DLL_PUBLIC ParameterTypeNotSupported : public Error { }; @@ -67,7 +73,7 @@ namespace DB { public: /// Creates a new command from the given SQL. explicit Command(std::string sql); - virtual ~Command() = 0; + virtual ~Command() = default; /// Standard special members SPECIAL_MEMBERS_COPY_RO(Command); diff --git a/libdbpp/connection.cpp b/libdbpp/connection.cpp index 4ba779d..531b5bb 100644 --- a/libdbpp/connection.cpp +++ b/libdbpp/connection.cpp @@ -1,10 +1,13 @@ #include "connection.h" #include "error.h" #include "modifycommand.h" -#include "selectcommand.h" +#include <array> #include <compileTimeFormatter.h> +#include <ctime> +#include <exception> #include <factory.impl.h> #include <sqlParse.h> +#include <stdexcept> #include <system_error> DB::ConnectionError::ConnectionError() : FailureTime(time(nullptr)) { } diff --git a/libdbpp/connection.h b/libdbpp/connection.h index 9cd96e0..495c1c2 100644 --- a/libdbpp/connection.h +++ b/libdbpp/connection.h @@ -2,22 +2,23 @@ #define DB_CONNECTION_H #include "command_fwd.h" -#include "connection_fwd.h" #include "error.h" #include <c++11Helpers.h> +#include <cstdint> +#include <cstdio> #include <exception.h> #include <factory.h> #include <filesystem> +#include <iosfwd> #include <memory> #include <optional> #include <set> #include <string> +#include <string_view> +#include <sys/types.h> +#include <typeinfo> #include <visibility.h> -namespace AdHoc { - class Buffer; -} - namespace DB { class TablePatch; diff --git a/libdbpp/connectionPool.cpp b/libdbpp/connectionPool.cpp index 5ee4f32..69eb732 100644 --- a/libdbpp/connectionPool.cpp +++ b/libdbpp/connectionPool.cpp @@ -1,5 +1,7 @@ #include "connectionPool.h" +#include <factory.h> #include <resourcePool.impl.h> +#include <utility> template class AdHoc::ResourcePool<DB::Connection>; template class AdHoc::ResourceHandle<DB::Connection>; diff --git a/libdbpp/connectionPool.h b/libdbpp/connectionPool.h index 877781e..8ee6ecd 100644 --- a/libdbpp/connectionPool.h +++ b/libdbpp/connectionPool.h @@ -2,8 +2,13 @@ #define DB_CONNECTIONPOOL_H #include "connection.h" +#include "connection_fwd.h" // for ConnectionPtr +#include "resourcePool.impl.h" // for ResourcePool<>::InUse, ResourcePool +#include <map> // for operator!= #include <memory> -#include <resourcePool.h> +//#include <resourcePool.h> +#include <string> +#include <tuple> // for get #include <visibility.h> namespace DB { diff --git a/libdbpp/createMockDb.cpp b/libdbpp/createMockDb.cpp index d917b95..aa47fba 100644 --- a/libdbpp/createMockDb.cpp +++ b/libdbpp/createMockDb.cpp @@ -1,8 +1,18 @@ #include "mockDatabase.h" +#include <boost/lexical_cast.hpp> #include <boost/program_options.hpp> +#include <chrono> #include <csignal> +#include <cstdlib> +#include <exception> +#include <factory.impl.h> #include <filesystem> #include <iostream> +#include <memory> +#include <string> +#include <unistd.h> +#include <vector> +// IWYU pragma: no_include <boost/detail/basic_pointerbuf.hpp> namespace po = boost::program_options; namespace fs = std::filesystem; diff --git a/libdbpp/dbTypes.cpp b/libdbpp/dbTypes.cpp index 7c4a87a..70fd25f 100644 --- a/libdbpp/dbTypes.cpp +++ b/libdbpp/dbTypes.cpp @@ -1,5 +1,5 @@ #include "dbTypes.h" -#include <memory.h> +#include <cstring> DB::Blob::Blob(const void * d, size_t l) : data(d), len(l) { } diff --git a/libdbpp/mockDatabase.cpp b/libdbpp/mockDatabase.cpp index 8c168cf..797a6af 100644 --- a/libdbpp/mockDatabase.cpp +++ b/libdbpp/mockDatabase.cpp @@ -1,11 +1,11 @@ #define BOOST_FILESYSTEM_DYN_LINK #define BOOST_FILESYSTEM_SOURCE #include "mockDatabase.h" +#include "connection.h" #include <compileTimeFormatter.h> #include <factory.impl.h> -#include <fstream> -#include <modifycommand.h> -#include <plugins.impl.h> +#include <fstream> // IWYU pragma: keep +#include <unistd.h> INSTANTIATEPLUGINOF(DB::MockDatabase) INSTANTIATEFACTORY( diff --git a/libdbpp/mockDatabase.h b/libdbpp/mockDatabase.h index ed38ef8..82de5e0 100644 --- a/libdbpp/mockDatabase.h +++ b/libdbpp/mockDatabase.h @@ -1,14 +1,18 @@ #ifndef DB_MOCKDATABASE_H #define DB_MOCKDATABASE_H -#include "connection.h" +#include "connection_fwd.h" +#include <c++11Helpers.h> +#include <factory.impl.h> #include <filesystem> +#include <initializer_list> +#include <memory> #include <string> #include <vector> #include <visibility.h> namespace DB { - + class Connection; /// MockDatabase creates, registers and destroys a database suitable for unit testing. class DLL_PUBLIC MockDatabase : public AdHoc::AbstractPluginImplementation { public: diff --git a/libdbpp/modifycommand.h b/libdbpp/modifycommand.h index 00d729f..7b6011e 100644 --- a/libdbpp/modifycommand.h +++ b/libdbpp/modifycommand.h @@ -3,6 +3,7 @@ #include "command.h" #include "error.h" +#include <string> #include <visibility.h> namespace DB { diff --git a/libdbpp/selectcommand.cpp b/libdbpp/selectcommand.cpp index 171c1b7..f67fca0 100644 --- a/libdbpp/selectcommand.cpp +++ b/libdbpp/selectcommand.cpp @@ -1,11 +1,14 @@ #include "selectcommand.h" #include "error.h" #include <boost/multi_index/indexed_by.hpp> -#include <boost/multi_index/mem_fun.hpp> -#include <boost/multi_index/member.hpp> +#include <boost/multi_index/mem_fun.hpp> // IWYU pragma: keep +#include <boost/multi_index/member.hpp> // IWYU pragma: keep #include <boost/multi_index/ordered_index.hpp> #include <boost/multi_index_container.hpp> +#include <boost/operators.hpp> #include <compileTimeFormatter.h> +#include <glibmm/ustring.h> +#include <utility> namespace DB { ColumnIndexOutOfRange::ColumnIndexOutOfRange(unsigned int n) : colNo(n) { } diff --git a/libdbpp/selectcommand.h b/libdbpp/selectcommand.h index ee85c5c..de931a5 100644 --- a/libdbpp/selectcommand.h +++ b/libdbpp/selectcommand.h @@ -3,9 +3,23 @@ #include "column.h" #include "command.h" -#include "error.h" +#include "dbTypes.h" // IWYU pragma: keep +#include <array> +#include <c++11Helpers.h> +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wold-style-cast" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#ifndef __clang__ +# pragma GCC diagnostic ignored "-Wuseless-cast" +#endif +#include <glibmm/ustring.h> +#pragma GCC diagnostic pop +#include <cstddef> #include <exception.h> #include <functional> +#include <memory> +#include <string> +#include <tuple> #include <visibility.h> #ifndef BOOST_TEST_MODULE @@ -15,7 +29,7 @@ #endif namespace DB { - class Column; + class Error; class SelectCommand; /// @cond diff --git a/libdbpp/sqlParseImpl.cpp b/libdbpp/sqlParseImpl.cpp index bb27c6e..7d00895 100644 --- a/libdbpp/sqlParseImpl.cpp +++ b/libdbpp/sqlParseImpl.cpp @@ -1,6 +1,10 @@ +#include "connection.h" #include "sqlParse.h" #include <compileTimeFormatter.h> +#include <filesystem> #include <stdexcept> +#include <string> +#include <utility> namespace DB { SqlParseException::SqlParseException(const char * r, unsigned int l) : reason(r), line(l) { } diff --git a/libdbpp/sqlWriter.cpp b/libdbpp/sqlWriter.cpp index f0afe3d..84ae55b 100644 --- a/libdbpp/sqlWriter.cpp +++ b/libdbpp/sqlWriter.cpp @@ -1,4 +1,6 @@ #include "sqlWriter.h" +#include "buffer.h" +#include <utility> void DB::SqlWriter::bindParams(DB::Command *, unsigned int &) diff --git a/libdbpp/sqlWriter.h b/libdbpp/sqlWriter.h index 43aef2e..e2cfe2b 100644 --- a/libdbpp/sqlWriter.h +++ b/libdbpp/sqlWriter.h @@ -1,10 +1,13 @@ #ifndef DB_SQLWRITER_H #define DB_SQLWRITER_H -#include <buffer.h> #include <c++11Helpers.h> +#include <string> #include <visibility.h> +namespace AdHoc { + class Buffer; +} namespace DB { class Command; diff --git a/libdbpp/tablepatch.cpp b/libdbpp/tablepatch.cpp index bbad348..9484a74 100644 --- a/libdbpp/tablepatch.cpp +++ b/libdbpp/tablepatch.cpp @@ -1,10 +1,12 @@ #include "tablepatch.h" #include "connection.h" #include "modifycommand.h" -#include "selectcommand.h" +#include "selectcommand.h" // IWYU pragma: keep #include "sqlWriter.h" -#include <boost/algorithm/string/join.hpp> +#include <boost/format.hpp> +#include <boost/format/format_fwd.hpp> #include <buffer.h> +#include <memory> #include <safeMapFind.h> DB::PatchResult diff --git a/libdbpp/tablepatch.h b/libdbpp/tablepatch.h index be8aec0..d3265a6 100644 --- a/libdbpp/tablepatch.h +++ b/libdbpp/tablepatch.h @@ -1,13 +1,11 @@ #ifndef TABLEPATCH_H #define TABLEPATCH_H -#include <connection.h> +#include "command_fwd.h" #include <functional> -#include <map> -#include <modifycommand.h> -#include <selectcommand.h> #include <set> #include <string> +#include <visibility.h> namespace DB { class SqlWriter; diff --git a/libdbpp/testCore.cpp b/libdbpp/testCore.cpp index 4887a79..bb92cf4 100644 --- a/libdbpp/testCore.cpp +++ b/libdbpp/testCore.cpp @@ -1,12 +1,18 @@ #include "testCore.h" -#include <boost/date_time/posix_time/posix_time.hpp> -#include <boost/test/test_tools.hpp> +#include "column.h" +#include <boost/date_time/posix_time/conversion.hpp> +#include <boost/date_time/posix_time/posix_time.hpp> // IWYU pragma: keep +#include <boost/test/unit_test.hpp> #include <compileTimeFormatter.h> #include <fileUtils.h> #include <selectcommand.h> +#include <type_traits> +#include <typeinfo> +namespace boost::posix_time { + class time_duration; +} namespace DB { - TestCore::TestCore() : testString("Some C String"), testDateTime(boost::posix_time::from_time_t(1430530593)), testInterval(boost::posix_time::time_duration(1, 2, 3)), testBlobData([]() { diff --git a/libdbpp/testCore.h b/libdbpp/testCore.h index ea1f01b..a7a261a 100644 --- a/libdbpp/testCore.h +++ b/libdbpp/testCore.h @@ -1,7 +1,13 @@ #ifndef DB_TESTCORE_H #define DB_TESTCORE_H -#include <command.h> +#include "dbTypes.h" +#include <boost/date_time/posix_time/posix_time_types.hpp> +#include <boost/date_time/posix_time/ptime.hpp> +#include <cstdint> +#include <iosfwd> +#include <string_view> +#include <vector> #include <visibility.h> namespace DB { diff --git a/libdbpp/unittests/libdbpp-mysql b/libdbpp/unittests/libdbpp-mysql -Subproject 7b56849be41fdd342c8d92c243df6370a53c830 +Subproject a8630518c10667ff88f0e0846de98337743a580 diff --git a/libdbpp/unittests/libdbpp-odbc b/libdbpp/unittests/libdbpp-odbc -Subproject 3eb8f4b130eb815aa3ff7cfbb89d05ebce21635 +Subproject b7f71b71224238a8b7bdb76b6feb98db9bac7aa diff --git a/libdbpp/unittests/libdbpp-postgresql b/libdbpp/unittests/libdbpp-postgresql -Subproject 3e305e46d818a28a9c1cbb814bdc3dd72605d80 +Subproject 465ea24362ee267cf83909efa0b5cdee689ff1f diff --git a/libdbpp/unittests/libdbpp-sqlite b/libdbpp/unittests/libdbpp-sqlite -Subproject 5c72a2b6a0076d85ce12884bca3b1de89df4db1 +Subproject f036fb38fb75c1298f6729ffc2f7d411b547885 diff --git a/libdbpp/unittests/mockdb.cpp b/libdbpp/unittests/mockdb.cpp index 30180b9..15e07fb 100644 --- a/libdbpp/unittests/mockdb.cpp +++ b/libdbpp/unittests/mockdb.cpp @@ -1,4 +1,11 @@ #include "mockdb.h" +#include "command_fwd.h" +#include "connection.h" +#include "connection_fwd.h" +#include "error.h" +#include "factory.h" +#include "mockDatabase.h" +#include <memory> // LCOV_EXCL_START diff --git a/libdbpp/unittests/mockdb.h b/libdbpp/unittests/mockdb.h index e9775c6..a511c70 100644 --- a/libdbpp/unittests/mockdb.h +++ b/libdbpp/unittests/mockdb.h @@ -1,8 +1,13 @@ #ifndef DB_MOCKDB_H #define DB_MOCKDB_H +#include "../command_fwd.h" #include "../connection.h" +#include "../connection_fwd.h" #include "../mockDatabase.h" +#include <filesystem> +#include <string> +#include <vector> class MockDb : public DB::Connection { public: diff --git a/libdbpp/unittests/testConnection.cpp b/libdbpp/unittests/testConnection.cpp index 46a8e6a..66975e1 100644 --- a/libdbpp/unittests/testConnection.cpp +++ b/libdbpp/unittests/testConnection.cpp @@ -1,14 +1,15 @@ #define BOOST_TEST_MODULE DbConnection #include <boost/test/unit_test.hpp> +#include "command.h" +#include "command_fwd.h" #include "mockdb.h" #include <connection.h> -#include <definedDirs.h> -#include <error.h> -#include <factory.h> -#include <fstream> +#include <exception> +#include <factory.impl.h> +#include <memory> +#include <optional> #include <pq-command.h> -#include <sqlParse.h> #include <vector> BOOST_AUTO_TEST_CASE(create) diff --git a/libdbpp/unittests/testConnectionPool.cpp b/libdbpp/unittests/testConnectionPool.cpp index 5ad0121..630cb0a 100644 --- a/libdbpp/unittests/testConnectionPool.cpp +++ b/libdbpp/unittests/testConnectionPool.cpp @@ -1,9 +1,13 @@ #define BOOST_TEST_MODULE DbConnectionPool #include <boost/test/unit_test.hpp> +#include "connection.h" +#include "mockDatabase.h" #include <buffer.h> #include <connectionPool.h> +#include <memory> #include <pq-mock.h> +#include <resourcePool.impl.h> class MockPool : public DB::PluginMock<PQ::Mock>, public DB::ConnectionPool { public: diff --git a/libdbpp/unittests/testMock.cpp b/libdbpp/unittests/testMock.cpp index 362b984..b2eede4 100644 --- a/libdbpp/unittests/testMock.cpp +++ b/libdbpp/unittests/testMock.cpp @@ -1,11 +1,18 @@ #define BOOST_TEST_MODULE DbMock #include <boost/test/unit_test.hpp> -#include "../error.h" -#include "../mockDatabase.h" +#include "mockDatabase.h" #include "mockdb.h" #include <definedDirs.h> +#include <factory.impl.h> // for Factory::createNew, Factory::get +#include <filesystem> // for operator/, path #include <fstream> +#include <memory> // for allocator, __shared_ptr_access +#include <typeinfo> // for type_info + +namespace DB { + class Error; +} BOOST_AUTO_TEST_CASE(noFactory) { diff --git a/libdbpp/unittests/testParse.cpp b/libdbpp/unittests/testParse.cpp index 29ffc38..38b877d 100644 --- a/libdbpp/unittests/testParse.cpp +++ b/libdbpp/unittests/testParse.cpp @@ -1,12 +1,12 @@ #define BOOST_TEST_MODULE DbConnection #include <boost/test/unit_test.hpp> -#include <connection.h> #include <definedDirs.h> -#include <error.h> -#include <factory.h> +#include <filesystem> #include <fstream> +#include <initializer_list> #include <sqlParse.h> +#include <string> #include <vector> using SQLs = std::vector<std::string>; diff --git a/libdbpp/unittests/testPatch.cpp b/libdbpp/unittests/testPatch.cpp index cc9fd24..5febea1 100644 --- a/libdbpp/unittests/testPatch.cpp +++ b/libdbpp/unittests/testPatch.cpp @@ -1,13 +1,21 @@ #define BOOST_TEST_MODULE DbTablePatch #include <boost/test/unit_test.hpp> +#include "command_fwd.h" +#include "mockDatabase.h" +#include "selectcommand.h" #include <buffer.h> #include <command.h> #include <connection.h> +#include <cstdint> +#include <cstdio> #include <definedDirs.h> +#include <filesystem> +#include <memory> #include <pq-mock.h> #include <selectcommandUtil.impl.h> #include <sqlWriter.h> +#include <string> #include <tablepatch.h> class Mock : public DB::PluginMock<PQ::Mock> { diff --git a/libdbpp/unittests/testUtils.cpp b/libdbpp/unittests/testUtils.cpp index 054ffb6..043fc30 100644 --- a/libdbpp/unittests/testUtils.cpp +++ b/libdbpp/unittests/testUtils.cpp @@ -1,17 +1,52 @@ #define BOOST_TEST_MODULE DbUtil #include <boost/test/unit_test.hpp> -#include <IceUtil/Exception.h> +#include "column.h" +#include "command_fwd.h" +#include "dbTypes.h" +#include "mockDatabase.h" +#include <IceUtil/Exception.h> // IWYU pragma: keep #include <IceUtil/Optional.h> +#include <boost/date_time/posix_time/conversion.hpp> #include <boost/date_time/posix_time/posix_time_io.hpp> +#include <boost/date_time/posix_time/posix_time_types.hpp> +#include <boost/date_time/posix_time/ptime.hpp> +#include <boost/static_assert.hpp> #include <connection.h> +#include <cstdint> +#include <cstdio> #include <definedDirs.h> -#include <fstream> +#include <deque> +#include <filesystem> +#include <fstream> // IWYU pragma: keep +#include <glibmm/ustring.h> +#include <iterator> +#include <memory> #include <modifycommand.h> +#include <optional> #include <pq-mock.h> #include <selectcommand.h> #include <selectcommandUtil.impl.h> +#include <sstream> +#include <string> +#include <string_view> +#include <sys/types.h> #include <testCore.h> +#include <tuple> +#include <type_traits> +#include <utility> +#include <vector> +// IWYU pragma: no_include <boost/date_time/gregorian_calendar.ipp> + +namespace DB { + class InvalidConversion; +} +namespace DB { + class UnexpectedNullValue; +} +namespace boost::posix_time { + class time_duration; +} class StandardMockDatabase : public DB::PluginMock<PQ::Mock> { public: |