summaryrefslogtreecommitdiff
path: root/cpp/test/include/TestCommon.h
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/test/include/TestCommon.h')
-rw-r--r--cpp/test/include/TestCommon.h71
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;