]> git.stg.codes - stg.git/commitdiff
Fixed tests.
authorMaxim Mamontov <faust.madf@gmail.com>
Sat, 21 Jun 2014 20:36:56 +0000 (23:36 +0300)
committerMaxim Mamontov <faust.madf@gmail.com>
Sat, 21 Jun 2014 20:36:56 +0000 (23:36 +0300)
tests/test_conffiles.cpp
tests/testadmin.h
tests/testauth.h
tests/testsettings.h
tests/teststore.h
tests/testusers.h

index ee2eeea72aa5e39f8af4eaa8d561d8695ce2d98d..ef63a7a1f947e6dac1226945a79c6129740f0466 100644 (file)
@@ -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);
 
index bc11daa914612c13d5e257f7ec6ef3ad78c8c30b..f10df54e3ab067596fb96ae38d6f5be9b3f4436a 100644 (file)
@@ -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); }
index f899e800bea865de0cd2086a16cd728e6174bf6a..93ef5c268c78c8e1169f1a5f74fda5a6197b4667 100644 (file)
@@ -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; }
 
index dd30f3fac7f76911645719369c707f95004d6d58..51c833599282f3f67a172d80b3d002d904dac1a9 100644 (file)
@@ -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<std::string> & GetScriptParams() const { return scriptParams; }
 
     private:
         std::string dirName;
         std::string scriptsDir;
         std::string monitorDir;
+        std::vector<std::string> scriptParams;
 };
 
 #endif
index 1ebc671fd4d84e82fff47c3287b79e166ce647e7..cb9a333c5d469dde111f56be1dbe26d310d821b0 100644 (file)
@@ -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<STG_MSG_HDR> * /*hdrsList*/, const std::string & /*login*/) const { return 0; }
+        int GetMessageHdrs(std::vector<STG_MSG_HDR> * /*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; }
 
index b207ccb6cea2e13578d4f85e2221965238c18287..d73c8a7901037b66a99d55c76d1c25c684720788 100644 (file)
@@ -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; }