X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/e9ae1f101b5418c0ba2e6c9d86b23c12f0140982..296c906e2689b9b5dc26d2f2d3e1e2d9e1662d3b:/tests/teststore.h?ds=inline diff --git a/tests/teststore.h b/tests/teststore.h index 59b6a47e..b7894c00 100644 --- a/tests/teststore.h +++ b/tests/teststore.h @@ -1,83 +1,81 @@ -#ifndef __TEST_STORE_H__ -#define __TEST_STORE_H__ +#pragma once #include "stg/store.h" -class TEST_STORE : public STG::Store { +class TestStore : public STG::Store +{ public: - TEST_STORE() {} - - int GetUsersList(std::vector * /*usersList*/) const override { return 0; } - int AddUser(const std::string & /*login*/) const override { return 0; } - int DelUser(const std::string & /*login*/) const override { return 0; } - int SaveUserStat(const STG::UserStat & /*stat*/, const std::string & /*login*/) const override { return 0; } - int SaveUserConf(const STG::UserConf & /*conf*/, const std::string & /*login*/) const override { return 0; } - int RestoreUserStat(STG::UserStat * /*stat*/, const std::string & /*login*/) const override { return 0; } - int RestoreUserConf(STG::UserConf * /*conf*/, const std::string & /*login*/) const override { return 0; } - - int WriteUserChgLog(const std::string & /*login*/, - const std::string & /*admLogin*/, + TestStore() {} + + int GetUsersList(std::vector* /*usersList*/) const override { return 0; } + int AddUser(const std::string& /*login*/) const override { return 0; } + int DelUser(const std::string& /*login*/) const override { return 0; } + int SaveUserStat(const STG::UserStat& /*stat*/, const std::string& /*login*/) const override { return 0; } + int SaveUserConf(const STG::UserConf& /*conf*/, const std::string& /*login*/) const override { return 0; } + int RestoreUserStat(STG::UserStat* /*stat*/, const std::string& /*login*/) const override { return 0; } + int RestoreUserConf(STG::UserConf* /*conf*/, const std::string& /*login*/) const override { return 0; } + + int WriteUserChgLog(const std::string& /*login*/, + const std::string& /*admLogin*/, uint32_t /*admIP*/, - const std::string & /*paramName*/, - const std::string & /*oldValue*/, - const std::string & /*newValue*/, - const std::string & /*message*/) const override { return 0; } - - int WriteUserConnect(const std::string & /*login*/, uint32_t /*ip*/) const override { return 0; } - - int WriteUserDisconnect(const std::string & /*login*/, - const STG::DirTraff & /*up*/, - const STG::DirTraff & /*down*/, - const STG::DirTraff & /*sessionUp*/, - const STG::DirTraff & /*sessionDown*/, + const std::string& /*paramName*/, + const std::string& /*oldValue*/, + const std::string& /*newValue*/, + const std::string& /*message*/) const override { return 0; } + + int WriteUserConnect(const std::string& /*login*/, uint32_t /*ip*/) const override { return 0; } + + int WriteUserDisconnect(const std::string& /*login*/, + const STG::DirTraff& /*up*/, + const STG::DirTraff& /*down*/, + const STG::DirTraff& /*sessionUp*/, + const STG::DirTraff& /*sessionDown*/, double /*cash*/, double /*freeMb*/, - const std::string & /*reason*/) const override { return 0; } + const std::string& /*reason*/) const override { return 0; } - int WriteDetailedStat(const STG::TraffStat & /*statTree*/, + int WriteDetailedStat(const STG::TraffStat& /*statTree*/, time_t /*lastStat*/, - const std::string & /*login*/) const override { return 0; } - - int AddMessage(STG::Message * /*msg*/, const std::string & /*login*/) const override { return 0; } - int EditMessage(const STG::Message & /*msg*/, const std::string & /*login*/) const override { return 0; } - int GetMessage(uint64_t /*id*/, STG::Message * /*msg*/, const std::string & /*login*/) const override { return 0; } - int DelMessage(uint64_t /*id*/, const std::string & /*login*/) const override { return 0; } - int GetMessageHdrs(std::vector * /*hdrsList*/, const std::string & /*login*/) const override { return 0; } - - int SaveMonthStat(const STG::UserStat & /*stat*/, int /*month*/, int /*year*/, const std::string & /*login*/) const override { return 0; } - - int GetAdminsList(std::vector * /*adminsList*/) const override { return 0; } - int SaveAdmin(const STG::AdminConf & /*ac*/) const override { return 0; } - int RestoreAdmin(STG::AdminConf * /*ac*/, const std::string & /*login*/) const override { return 0; } - int AddAdmin(const std::string & /*login*/) const override { return 0; } - int DelAdmin(const std::string & /*login*/) const override { return 0; } - - int GetTariffsList(std::vector * /*tariffsList*/) const override { return 0; } - int AddTariff(const std::string & /*name*/) const override { return 0; } - int DelTariff(const std::string & /*name*/) const override { return 0; } - int SaveTariff(const STG::TariffData & /*td*/, const std::string & /*tariffName*/) const override { return 0; } - int RestoreTariff(STG::TariffData * /*td*/, const std::string & /*tariffName*/) const override { return 0; } - - int GetCorpsList(std::vector * /*corpsList*/) const override { return 0; } - int SaveCorp(const STG::CorpConf & /*cc*/) const override { return 0; } - int RestoreCorp(STG::CorpConf * /*cc*/, const std::string & /*name*/) const override { return 0; } - int AddCorp(const std::string & /*name*/) const override { return 0; } - int DelCorp(const std::string & /*name*/) const override { return 0; } - - int GetServicesList(std::vector * /*corpsList*/) const override { return 0; } - int SaveService(const STG::ServiceConf & /*sc*/) const override { return 0; } - int RestoreService(STG::ServiceConf * /*sc*/, const std::string & /*name*/) const override { return 0; } - int AddService(const std::string & /*name*/) const override { return 0; } - int DelService(const std::string & /*name*/) const override { return 0; } - - void SetSettings(const STG::ModuleSettings & /*s*/) override {} + const std::string& /*login*/) const override { return 0; } + + int AddMessage(STG::Message* /*msg*/, const std::string& /*login*/) const override { return 0; } + int EditMessage(const STG::Message& /*msg*/, const std::string& /*login*/) const override { return 0; } + int GetMessage(uint64_t /*id*/, STG::Message* /*msg*/, const std::string& /*login*/) const override { return 0; } + int DelMessage(uint64_t /*id*/, const std::string& /*login*/) const override { return 0; } + int GetMessageHdrs(std::vector* /*hdrsList*/, const std::string& /*login*/) const override { return 0; } + + int SaveMonthStat(const STG::UserStat& /*stat*/, int /*month*/, int /*year*/, const std::string& /*login*/) const override { return 0; } + + int GetAdminsList(std::vector* /*adminsList*/) const override { return 0; } + int SaveAdmin(const STG::AdminConf& /*ac*/) const override { return 0; } + int RestoreAdmin(STG::AdminConf* /*ac*/, const std::string& /*login*/) const override { return 0; } + int AddAdmin(const std::string& /*login*/) const override { return 0; } + int DelAdmin(const std::string& /*login*/) const override { return 0; } + + int GetTariffsList(std::vector* /*tariffsList*/) const override { return 0; } + int AddTariff(const std::string& /*name*/) const override { return 0; } + int DelTariff(const std::string& /*name*/) const override { return 0; } + int SaveTariff(const STG::TariffData& /*td*/, const std::string& /*tariffName*/) const override { return 0; } + int RestoreTariff(STG::TariffData* /*td*/, const std::string& /*tariffName*/) const override { return 0; } + + int GetCorpsList(std::vector* /*corpsList*/) const override { return 0; } + int SaveCorp(const STG::CorpConf& /*cc*/) const override { return 0; } + int RestoreCorp(STG::CorpConf* /*cc*/, const std::string& /*name*/) const override { return 0; } + int AddCorp(const std::string& /*name*/) const override { return 0; } + int DelCorp(const std::string& /*name*/) const override { return 0; } + + int GetServicesList(std::vector* /*corpsList*/) const override { return 0; } + int SaveService(const STG::ServiceConf& /*sc*/) const override { return 0; } + int RestoreService(STG::ServiceConf* /*sc*/, const std::string& /*name*/) const override { return 0; } + int AddService(const std::string& /*name*/) const override { return 0; } + int DelService(const std::string& /*name*/) const override { return 0; } + + void SetSettings(const STG::ModuleSettings& /*s*/) override {} int ParseSettings() override { return 0; } - const std::string & GetStrError() const override { return strError; } - const std::string & GetVersion() const override { return version; } + const std::string& GetStrError() const override { return m_errorStr; } + const std::string& GetVersion() const override { return m_version; } private: - std::string strError; - std::string version; + std::string m_errorStr; + std::string m_version; }; - -#endif