X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/d0adbf3d56cb2e95fae085700c3e305b134cbaf0..83ce40b2a471b560ec7516efebcb5ddcf7519071:/tests/testadmin.h?ds=inline diff --git a/tests/testadmin.h b/tests/testadmin.h index 37d20b4a..15b47742 100644 --- a/tests/testadmin.h +++ b/tests/testadmin.h @@ -3,32 +3,25 @@ #include "stg/admin.h" -class TEST_ADMIN : public ADMIN { +class TEST_ADMIN : public STG::Admin { public: - TEST_ADMIN() : priv(0xffFFffFF) {} + TEST_ADMIN() : priv(0xffFF), ip(0) {} - ADMIN & operator=(const ADMIN &) { return *this; } - ADMIN & operator=(const ADMIN_CONF &) { return *this; } - bool operator==(const ADMIN & rhs) const { return true; } - bool operator!=(const ADMIN & rhs) const { return false; } - bool operator<(const ADMIN & rhs) const { return true; } - bool operator<=(const ADMIN & rhs) const { return true; } + const std::string & GetPassword() const override { return password; } + const std::string & GetLogin() const override { return login; } + STG::Priv const * GetPriv() const override { return &priv; } + uint32_t GetPrivAsInt() const override { return priv.toInt(); } + const STG::AdminConf & GetConf() const override { return conf; } + uint32_t GetIP() const override { return ip; } + std::string GetIPStr() const override { return inet_ntostring(ip); } + void SetIP(uint32_t ip) override { TEST_ADMIN::ip = ip; } + const std::string GetLogStr() const override { return ""; } - const std::string & GetPassword() const { return password; } - const std::string & GetLogin() const { return login; } - PRIV const * GetPriv() const { return &priv; } - uint16_t GetPrivAsInt() const { return priv.ToInt(); } - const ADMIN_CONF & GetConf() const { return conf; } - uint32_t GetIP() const { return ip; } - std::string GetIPStr() const { return inet_ntostring(ip); } - void SetIP(uint32_t ip) { TEST_ADMIN::ip = ip; } - const std::string GetLogStr() const { return ""; } - private: std::string password; std::string login; - PRIV priv; - ADMIN_CONF conf; + STG::Priv priv; + STG::AdminConf conf; uint32_t ip; };