diff options
author | Benoit Foucher <benoit@zeroc.com> | 2015-03-23 17:13:06 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2015-03-23 17:13:06 +0100 |
commit | 69f068b112747fd080cfe70ef6ff15a0ff25db4e (patch) | |
tree | 53c04b9b4d7e7e3bab215975befc60b8bac3a7c0 /cpp/test/include | |
parent | Fixed csharp unix build (diff) | |
download | ice-69f068b112747fd080cfe70ef6ff15a0ff25db4e.tar.bz2 ice-69f068b112747fd080cfe70ef6ff15a0ff25db4e.tar.xz ice-69f068b112747fd080cfe70ef6ff15a0ff25db4e.zip |
Fix for running IceTouch tests
Diffstat (limited to 'cpp/test/include')
-rw-r--r-- | cpp/test/include/TestCommon.h | 71 |
1 files changed, 2 insertions, 69 deletions
diff --git a/cpp/test/include/TestCommon.h b/cpp/test/include/TestCommon.h index 2c2cf185673..37642613bc2 100644 --- a/cpp/test/include/TestCommon.h +++ b/cpp/test/include/TestCommon.h @@ -18,8 +18,6 @@ # include <Ice/LocalException.h> #endif -#include <cstdlib> - void inline print(const std::string& msg) { @@ -47,75 +45,10 @@ inline testFailed(const char* expr, const char* file, unsigned int line) #else -namespace Test -{ +#include <TestHelper.h> -class MainHelper : public std::streambuf +namespace Test { -public: - - MainHelper() - { - setp(&data[0], &data[sizeof(data) - 1]); - } - - virtual void serverReady() = 0; - - virtual void shutdown() = 0; - - virtual void waitForCompleted() = 0; - - virtual bool redirect() = 0; - - virtual void print(const std::string& msg) = 0; - - virtual void - flush() - { - } - - virtual void - newLine() - { - print("\n"); - } - -private: - - // - // streambuf redirection implementation - // - - int sync() - { - std::streamsize n = pptr() - pbase(); - print(std::string(pbase(), static_cast<int>(n))); - pbump(-static_cast<int>(pptr() - pbase())); - return 0; - } - - int overflow(int ch) - { - sync(); - if(ch != EOF) - { - assert(pptr() != epptr()); - sputc(ch); - } - return 0; - } - - int sputc(char c) - { - if(c == '\n') - { - pubsync(); - } - return std::streambuf::sputc(c); - } - - char data[1024]; -}; extern MainHelper* helper; |