Subversion Repositories tpanel

Rev

Rev 326 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 326 Rev 327
Line 35... Line 35...
35
    public:
35
    public:
36
        _TestMode(const std::string& path);
36
        _TestMode(const std::string& path);
37
        ~_TestMode();
37
        ~_TestMode();
38
 
38
 
39
        void run();
39
        void run();
-
 
40
        void setResult(const std::string& res) { verify = res; }
40
 
41
 
41
    private:
42
    private:
-
 
43
        typedef struct _TESTCMD
-
 
44
        {
-
 
45
            std::string command;    // The command to execute
-
 
46
            std::string result;     // The expected result
-
 
47
            bool compare{false};    // TRUE: Compare expected result with real result
-
 
48
        }_TESTCMD;
-
 
49
 
42
        void inject(int port, const std::string& c);
50
        void inject(int port, const std::string& c);
43
        void testSuccess();
51
        void testSuccess(_TESTCMD& tc);
44
        void start();
52
        void start();
45
        void inform(const std::string& msg);
53
        void inform(const std::string& msg);
46
 
54
 
47
        std::thread mThread;
55
        std::thread mThread;
48
        bool isRunning{false};
56
        bool isRunning{false};
49
        std::string mPath;
57
        std::string mPath;
50
        std::vector<std::string> mCmdFiles;
58
        std::vector<std::string> mCmdFiles;
-
 
59
        std::string verify;         // The real result
51
};
60
};
52
 
61
 
53
extern _TestMode *_gTestMode;
62
extern _TestMode *_gTestMode;
54
 
63
 
55
#endif
64
#endif