X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/a9d1b61cf101fd2f05dea3cf699639a7aada92bb..479b8853c2ab18c98926a9369a03888021e9b986:/tests/testusers.h?ds=inline diff --git a/tests/testusers.h b/tests/testusers.h index 131fb9b6..492568df 100644 --- a/tests/testusers.h +++ b/tests/testusers.h @@ -3,48 +3,51 @@ #include "stg/users.h" -class TEST_USERS : public USERS { +class TEST_USERS : public STG::Users { public: TEST_USERS() {} - int FindByName(const std::string & /*login*/, USER_PTR * /*user*/) + using UserPtr = STG::User*; + using ConstUserPtr = const STG::User*; + + int FindByName(const std::string & /*login*/, UserPtr * /*user*/) override { return -1; } - int FindByName(const std::string & /*login*/, CONST_USER_PTR * /*user*/) const + int FindByName(const std::string & /*login*/, ConstUserPtr * /*user*/) const override { return -1; } - bool TariffInUse(const std::string & /*tariffName*/) const + bool TariffInUse(const std::string & /*tariffName*/) const override { return -1; } - void AddNotifierUserAdd(NOTIFIER_BASE * /*notifier*/) {} - void DelNotifierUserAdd(NOTIFIER_BASE * /*notifier*/) {} + void AddNotifierUserAdd(STG::NotifierBase * /*notifier*/) override {} + void DelNotifierUserAdd(STG::NotifierBase * /*notifier*/) override {} - void AddNotifierUserDel(NOTIFIER_BASE * /*notifier*/) {} - void DelNotifierUserDel(NOTIFIER_BASE * /*notifier*/) {} + void AddNotifierUserDel(STG::NotifierBase * /*notifier*/) override {} + void DelNotifierUserDel(STG::NotifierBase * /*notifier*/) override {} - int Add(const std::string & /*login*/, const ADMIN * /*admin*/) + int Add(const std::string & /*login*/, const STG::Admin * /*admin*/) override { return 0; } - void Del(const std::string & /*login*/, const ADMIN * /*admin*/) {} + void Del(const std::string & /*login*/, const STG::Admin * /*admin*/) override {} - bool Authorize(const std::string &, uint32_t, uint32_t, const AUTH *) + bool Authorize(const std::string &, uint32_t, uint32_t, const STG::Auth *) override { return false; } - bool Unauthorize(const std::string &, const AUTH *, const std::string &) + bool Unauthorize(const std::string &, const STG::Auth *, const std::string &) override { return false; } - int ReadUsers() { return 0; } - virtual size_t Count() const { return 0; }; + int ReadUsers() override { return 0; } + virtual size_t Count() const override { return 0; }; - int FindByIPIdx(uint32_t /*ip*/, USER_PTR * /*user*/) const + int FindByIPIdx(uint32_t /*ip*/, UserPtr * /*user*/) const override { return -1; } - bool IsIPInIndex(uint32_t /*ip*/) const { return false; } - bool IsIPInUse(uint32_t, const std::string &, CONST_USER_PTR *) const { return false; } - bool Exists(const std::string &) const { return false; } + bool IsIPInIndex(uint32_t /*ip*/) const override { return false; } + bool IsIPInUse(uint32_t, const std::string &, ConstUserPtr *) const override { return false; } + bool Exists(const std::string &) const override { return false; } - int OpenSearch() { return 0; } - int SearchNext(int /*handle*/, USER_PTR * /*u*/) { return -1; } - int CloseSearch(int /*handle*/) { return 0; } + int OpenSearch() override { return 0; } + int SearchNext(int /*handle*/, UserPtr * /*u*/) override { return -1; } + int CloseSearch(int /*handle*/) override { return 0; } - int Start() { return 0; } - int Stop() { return 0; } + int Start() override { return 0; } + int Stop() override { return 0; } private: };