From 4b9289cfb260f4bcecaf23a810584ef6ef8e8501 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 30 Mar 2011 22:33:41 +0000 Subject: Ok, string stuff is working much, much better, a load of new unit tests have been added, and I deleted a whole slew of stupid old tests that I don't need. --- src/tests/conduit.cpp | 56 --------------------------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 src/tests/conduit.cpp (limited to 'src/tests/conduit.cpp') diff --git a/src/tests/conduit.cpp b/src/tests/conduit.cpp deleted file mode 100644 index d8d9e03..0000000 --- a/src/tests/conduit.cpp +++ /dev/null @@ -1,56 +0,0 @@ -#include "bu/conduit.h" -#include "bu/sio.h" -#include "bu/ito.h" - -using namespace Bu; - -class Reader : public Bu::Ito -{ -public: - Reader( Bu::Conduit &rCond ) : - rCond( rCond ) - { - } - - virtual ~Reader() - { - } - -protected: - virtual void run() - { - while( rCond.isOpen() ) - { - char buf[1025]; - - sio << "Reading..." << sio.flush; - Bu::size iRead = rCond.read( buf, 1024 ); - buf[iRead] = '\0'; - sio << "got " << iRead << " >" << buf << "<" << sio.nl; - } - - sio << "Conduit closed, exting thread." << sio.nl; - } - -private: - Bu::Conduit &rCond; -}; - -int main() -{ - Conduit c; - Reader r( c ); - r.start(); - - sleep( 3 ); - c.write("Hi there", 8 ); - sleep( 3 ); - c.write("Goodbye, soon.", 14 ); - sleep( 3 ); - c.write("...NOW!", 9 ); - c.close(); - sleep( 3 ); - - return 0; -} - -- cgit v1.2.3