From: Maxim Mamontov Date: Sat, 21 Jun 2014 20:36:56 +0000 (+0300) Subject: Fixed tests. X-Git-Tag: 2.409~296 X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/bd345ea112678f4ed9cfa5132b6ded87ff3c4207?hp=4662fe21cd850eb2fecff20c9d93888b50f40245 Fixed tests. --- diff --git a/tests/test_conffiles.cpp b/tests/test_conffiles.cpp index ee2eeea7..ef63a7a1 100644 --- a/tests/test_conffiles.cpp +++ b/tests/test_conffiles.cpp @@ -62,7 +62,7 @@ namespace tut set_test_name("Check empty lines and comments"); { - ofstream f("/tmp/test.cf"); + std::ofstream f("/tmp/test.cf"); ensure("Correct construction (part 3)", f); diff --git a/tests/testadmin.h b/tests/testadmin.h index bc11daa9..f10df54e 100644 --- a/tests/testadmin.h +++ b/tests/testadmin.h @@ -10,7 +10,7 @@ class TEST_ADMIN : public ADMIN { 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(); } + uint32_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); } diff --git a/tests/testauth.h b/tests/testauth.h index f899e800..93ef5c26 100644 --- a/tests/testauth.h +++ b/tests/testauth.h @@ -21,7 +21,7 @@ class TEST_AUTH : public AUTH { int Reload() { return 0; } bool IsRunning() { return true; } const std::string & GetStrError() const { return strError; } - const std::string GetVersion() const { return ""; } + std::string GetVersion() const { return ""; } uint16_t GetStartPosition() const { return 0; } uint16_t GetStopPosition() const { return 0; } diff --git a/tests/testsettings.h b/tests/testsettings.h index dd30f3fa..51c83359 100644 --- a/tests/testsettings.h +++ b/tests/testsettings.h @@ -24,11 +24,13 @@ class TEST_SETTINGS : public SETTINGS { bool GetReconnectOnTariffChange() const { return false; } const std::string & GetMonitorDir() const { return monitorDir; } bool GetMonitoring() const { return false; } + const std::vector & GetScriptParams() const { return scriptParams; } private: std::string dirName; std::string scriptsDir; std::string monitorDir; + std::vector scriptParams; }; #endif diff --git a/tests/teststore.h b/tests/teststore.h index 1ebc671f..cb9a333c 100644 --- a/tests/teststore.h +++ b/tests/teststore.h @@ -42,7 +42,7 @@ class TEST_STORE : public STORE { int EditMessage(const STG_MSG & /*msg*/, const std::string & /*login*/) const { return 0; } int GetMessage(uint64_t /*id*/, STG_MSG * /*msg*/, const std::string & /*login*/) const { return 0; } int DelMessage(uint64_t /*id*/, const std::string & /*login*/) const { return 0; } - int GetMessageHdrs(vector * /*hdrsList*/, const std::string & /*login*/) const { return 0; } + int GetMessageHdrs(std::vector * /*hdrsList*/, const std::string & /*login*/) const { return 0; } int SaveMonthStat(const USER_STAT & /*stat*/, int /*month*/, int /*year*/, const std::string & /*login*/) const { return 0; } diff --git a/tests/testusers.h b/tests/testusers.h index b207ccb6..d73c8a79 100644 --- a/tests/testusers.h +++ b/tests/testusers.h @@ -7,6 +7,8 @@ class TEST_USERS : public USERS { int FindByName(const std::string & /*login*/, USER_PTR * /*user*/) { return -1; } + int FindByName(const std::string & /*login*/, CONST_USER_PTR * /*user*/) const + { return -1; } bool TariffInUse(const std::string & /*tariffName*/) const { return -1; } @@ -23,7 +25,7 @@ class TEST_USERS : public USERS { bool Authorize(const std::string &, uint32_t, uint32_t, const AUTH *) { return false; } - bool Unauthorize(const std::string &, const AUTH *) + bool Unauthorize(const std::string &, const AUTH *, const std::string &) { return false; } int ReadUsers() { return 0; } @@ -32,6 +34,7 @@ class TEST_USERS : public USERS { int FindByIPIdx(uint32_t /*ip*/, USER_PTR * /*user*/) const { return -1; } bool IsIPInIndex(uint32_t /*ip*/) const { return false; } + bool IsIPInUse(uint32_t, const std::string &, CONST_USER_PTR *) const { return false; } int OpenSearch() { return 0; } int SearchNext(int /*handle*/, USER_PTR * /*u*/) { return -1; }