#ifndef MOCKDEFS_H #define MOCKDEFS_H #include #include #include #include #include #include #include #include #include #include class DLL_PUBLIC Service : public IceTray::DryIce, DB::PluginMock { public: Service(); }; class DLL_PUBLIC Maintenance : public IceTray::DryIce, DB::PluginMock { public: Maintenance(); }; class DLL_PUBLIC Mail : public IceTray::DryIce { public: Mail(); }; class DLL_PUBLIC TestClient : public IceTray::DryIceClient { public: TestClient(); Gentoo::MaintenancePrxPtr m; Gentoo::PortagePrxPtr p; Gentoo::NotificationsPtr n; IceTray::Mail::MailServerPtr ms; Gentoo::UsersPrxPtr u; void lintable_test_files(std::string_view name, IceTray::Mail::EmailPtr e); std::pair humanReadableParts(IceTray::Mail::EmailPtr e); }; #define SQL_REQUIRE_EQUAL(sql, type, expected) \ BOOST_TEST_CONTEXT(sql) { \ sqlRequireEqual(db, sql, expected); \ } template void sqlRequireEqual(DB::ConnectionPtr db, const char * const sql, const T & expected) { int assertedRows = 0; db->select(sql)->forEachRow([expected, &assertedRows](const auto & n) { BOOST_REQUIRE_EQUAL(expected, n); assertedRows += 1; }); BOOST_REQUIRE_EQUAL(assertedRows, 1); } #endif