From b6e100b94b12f3f92ec025dc2363eaf7c0ee6662 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 10 Apr 2007 16:02:07 +0000 Subject: Well, we've got the basis of a workable unit test harness thing. There should be a few more add-ons to it, but it works just fine, and eventually it should cover command line options and creating logs, and possibly even provide output functionality so that output from tests can be logged and kept track of well. --- src/unitsuite.h | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 src/unitsuite.h (limited to 'src/unitsuite.h') diff --git a/src/unitsuite.h b/src/unitsuite.h new file mode 100644 index 0000000..3502a1b --- /dev/null +++ b/src/unitsuite.h @@ -0,0 +1,60 @@ +#ifndef UNIT_SUITE_H +#define UNIT_SUITE_H + +#include +#include +#include "fstring.h" + +namespace Bu +{ + /** + * + */ + class UnitSuite + { + public: + UnitSuite(); + virtual ~UnitSuite(); + + int run( int argc=0, char *argv[]=NULL ); + + typedef void (UnitSuite::*Test)(); + + class Failed + { + public: + Failed() : str(""), bFile( false ) { } + Failed( const FString &s ) : str( s ), bFile( false ) { } + Failed( const FString &s, const FString &sFile, int nLine ) : + str( s ), sFile( sFile ), nLine( nLine ), bFile( true ) { } + + FString str; + FString sFile; + int nLine; + bool bFile; + }; + + protected: + void add( Test fTest, Bu::FString sName ); + void setName( const FString &sName ); + + private: + typedef struct TestInfo + { + FString sName; + Test fTest; + } TestInfo; + + typedef std::list TestList; + TestList lTests; + FString sSuiteName; + }; +} + +#define addTest( fn ) add( static_cast(&fn), #fn ) +#define unitTest( tst ) if( !(tst) ) \ +{ \ + throw Bu::UnitSuite::Failed( #tst, __FILE__, __LINE__ ); \ +} + +#endif -- cgit v1.2.3 From 903e7a1e3d4fe99e9de7f4adc1e401ba871caec9 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 10 Apr 2007 17:23:35 +0000 Subject: Wrote some cute file unit tests, and added some more error reporting to SFile. Also fixed the stream system to use void * pointers instead of char *. --- src/sfile.cpp | 16 +++++++++-- src/sfile.h | 4 +-- src/stream.h | 4 +-- src/unit/sfile.cpp | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- src/unitsuite.h | 1 + 5 files changed, 99 insertions(+), 10 deletions(-) (limited to 'src/unitsuite.h') diff --git a/src/sfile.cpp b/src/sfile.cpp index d7c5c83..529d8cd 100644 --- a/src/sfile.cpp +++ b/src/sfile.cpp @@ -1,9 +1,14 @@ #include "sfile.h" #include "exceptions.h" +#include Bu::SFile::SFile( const char *sName, const char *sFlags ) { fh = fopen( sName, sFlags ); + if( fh == NULL ) + { + throw Bu::FileException( errno, strerror(errno) ); + } } Bu::SFile::~SFile() @@ -20,15 +25,20 @@ void Bu::SFile::close() } } -size_t Bu::SFile::read( char *pBuf, size_t nBytes ) +size_t Bu::SFile::read( void *pBuf, size_t nBytes ) { if( !fh ) throw FileException("File not open."); - return fread( pBuf, 1, nBytes, fh ); + int nAmnt = fread( pBuf, 1, nBytes, fh ); + + if( nAmnt == 0 ) + throw FileException("End of file."); + + return nAmnt; } -size_t Bu::SFile::write( const char *pBuf, size_t nBytes ) +size_t Bu::SFile::write( const void *pBuf, size_t nBytes ) { if( !fh ) throw FileException("File not open."); diff --git a/src/sfile.h b/src/sfile.h index 304f6b7..f63b812 100644 --- a/src/sfile.h +++ b/src/sfile.h @@ -14,8 +14,8 @@ namespace Bu virtual ~SFile(); virtual void close(); - virtual size_t read( char *pBuf, size_t nBytes ); - virtual size_t write( const char *pBuf, size_t nBytes ); + virtual size_t read( void *pBuf, size_t nBytes ); + virtual size_t write( const void *pBuf, size_t nBytes ); virtual long tell(); virtual void seek( long offset ); diff --git a/src/stream.h b/src/stream.h index 274f4fd..ae94234 100644 --- a/src/stream.h +++ b/src/stream.h @@ -13,8 +13,8 @@ namespace Bu virtual ~Stream(); virtual void close() = 0; - virtual size_t read( char *pBuf, size_t nBytes ) = 0; - virtual size_t write( const char *pBuf, size_t nBytes ) = 0; + virtual size_t read( void *pBuf, size_t nBytes ) = 0; + virtual size_t write( const void *pBuf, size_t nBytes ) = 0; virtual long tell() = 0; virtual void seek( long offset ) = 0; diff --git a/src/unit/sfile.cpp b/src/unit/sfile.cpp index 7b19942..3f52272 100644 --- a/src/unit/sfile.cpp +++ b/src/unit/sfile.cpp @@ -1,4 +1,10 @@ #include "unitsuite.h" +#include "sfile.h" +#include "exceptions.h" + +#include +#include +#include class Unit : public Bu::UnitSuite { @@ -6,7 +12,10 @@ public: Unit() { setName("SFile"); - addTest( Unit::test ); + addTest( Unit::writeFull ); + addTest( Unit::readBlocks ); + addTest( Unit::readError1 ); + addTest( Unit::readError2 ); } virtual ~Unit() { } @@ -14,9 +23,78 @@ public: // // Tests go here // - void test() + void writeFull() + { + Bu::SFile sf("testfile1", "wb"); + for( int c = 0; c < 256; c++ ) + { + unsigned char ch = (unsigned char)c; + sf.write( &ch, 1 ); + unitTest( sf.tell() == c+1 ); + } + //unitTest( sf.canRead() == false ); + //unitTest( sf.canWrite() == true ); + //unitTest( sf.canSeek() == true ); + sf.close(); + struct stat sdat; + stat("testfile1", &sdat ); + unitTest( sdat.st_size == 256 ); + } + + void readBlocks() + { + Bu::SFile sf("testfile1", "rb"); + unsigned char buf[50]; + size_t total = 0; + for(;;) + { + size_t s = sf.read( buf, 50 ); + for( size_t c = 0; c < s; c++ ) + { + unitTest( buf[c] == (unsigned char)(c+total) ); + } + total += s; + if( s < 50 ) + { + unitTest( total == 256 ); + unitTest( sf.isEOS() == true ); + break; + } + } + sf.close(); + } + + void readError1() + { + try + { + Bu::SFile sf("doesn'texist", "rb"); + unitFailed("No exception thrown"); + } + catch( Bu::FileException &e ) + { + return; + } + } + + void readError2() { - unitTest( 1 == 1 ); + Bu::SFile sf("testfile1", "rb"); + char buf[256]; + int r = sf.read( buf, 256 ); + unitTest( r == 256 ); + // You have to read past the end to set the EOS flag. + unitTest( sf.isEOS() == false ); + try + { + int r = sf.read( buf, 5 ); + unitFailed("No exception thrown"); + } + catch( Bu::FileException &e ) + { + sf.close(); + return; + } } }; diff --git a/src/unitsuite.h b/src/unitsuite.h index 3502a1b..db249b2 100644 --- a/src/unitsuite.h +++ b/src/unitsuite.h @@ -56,5 +56,6 @@ namespace Bu { \ throw Bu::UnitSuite::Failed( #tst, __FILE__, __LINE__ ); \ } +#define unitFailed( msg ) throw Bu::UnitSuite::Failed(msg, __FILE__, __LINE__); #endif -- cgit v1.2.3 From 070374dde0f53bff26078550997f7682e84412e5 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 10 Apr 2007 20:16:19 +0000 Subject: I did it, the streams don't start with an S now. --- src/file.cpp | 100 +++++++++++++++++++++++++++++++++++++++++++++++ src/file.h | 36 +++++++++++++++++ src/sfile.cpp | 100 ----------------------------------------------- src/sfile.h | 36 ----------------- src/socket.cpp | 10 +++++ src/socket.h | 24 ++++++++++++ src/ssocket.cpp | 9 ----- src/ssocket.h | 24 ------------ src/tests/archive.cpp | 4 +- src/unit/file.cpp | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/unit/sfile.cpp | 105 -------------------------------------------------- src/unitsuite.h | 35 +++++++++++++++++ 12 files changed, 312 insertions(+), 276 deletions(-) create mode 100644 src/file.cpp create mode 100644 src/file.h delete mode 100644 src/sfile.cpp delete mode 100644 src/sfile.h create mode 100644 src/socket.cpp create mode 100644 src/socket.h delete mode 100644 src/ssocket.cpp delete mode 100644 src/ssocket.h create mode 100644 src/unit/file.cpp delete mode 100644 src/unit/sfile.cpp (limited to 'src/unitsuite.h') diff --git a/src/file.cpp b/src/file.cpp new file mode 100644 index 0000000..5de5f6c --- /dev/null +++ b/src/file.cpp @@ -0,0 +1,100 @@ +#include "file.h" +#include "exceptions.h" +#include + +Bu::File::File( const char *sName, const char *sFlags ) +{ + fh = fopen( sName, sFlags ); + if( fh == NULL ) + { + throw Bu::FileException( errno, strerror(errno) ); + } +} + +Bu::File::~File() +{ + close(); +} + +void Bu::File::close() +{ + if( fh ) + { + fclose( fh ); + fh = NULL; + } +} + +size_t Bu::File::read( void *pBuf, size_t nBytes ) +{ + if( !fh ) + throw FileException("File not open."); + + int nAmnt = fread( pBuf, 1, nBytes, fh ); + + if( nAmnt == 0 ) + throw FileException("End of file."); + + return nAmnt; +} + +size_t Bu::File::write( const void *pBuf, size_t nBytes ) +{ + if( !fh ) + throw FileException("File not open."); + + return fwrite( pBuf, 1, nBytes, fh ); +} + +long Bu::File::tell() +{ + if( !fh ) + throw FileException("File not open."); + + return ftell( fh ); +} + +void Bu::File::seek( long offset ) +{ + if( !fh ) + throw FileException("File not open."); + + fseek( fh, offset, SEEK_CUR ); +} + +void Bu::File::setPos( long pos ) +{ + if( !fh ) + throw FileException("File not open."); + + fseek( fh, pos, SEEK_SET ); +} + +void Bu::File::setPosEnd( long pos ) +{ + if( !fh ) + throw FileException("File not open."); + + fseek( fh, pos, SEEK_END ); +} + +bool Bu::File::isEOS() +{ + return feof( fh ); +} + +bool Bu::File::canRead() +{ + return true; +} + +bool Bu::File::canWrite() +{ + return true; +} + +bool Bu::File::canSeek() +{ + return true; +} + diff --git a/src/file.h b/src/file.h new file mode 100644 index 0000000..bbc620c --- /dev/null +++ b/src/file.h @@ -0,0 +1,36 @@ +#ifndef FILE_H +#define FILE_H + +#include + +#include "stream.h" + +namespace Bu +{ + class File : public Bu::Stream + { + public: + File( const char *sName, const char *sFlags ); + virtual ~File(); + + virtual void close(); + virtual size_t read( void *pBuf, size_t nBytes ); + virtual size_t write( const void *pBuf, size_t nBytes ); + + virtual long tell(); + virtual void seek( long offset ); + virtual void setPos( long pos ); + virtual void setPosEnd( long pos ); + virtual bool isEOS(); + + virtual bool canRead(); + virtual bool canWrite(); + virtual bool canSeek(); + + private: + FILE *fh; + + }; +} + +#endif diff --git a/src/sfile.cpp b/src/sfile.cpp deleted file mode 100644 index 529d8cd..0000000 --- a/src/sfile.cpp +++ /dev/null @@ -1,100 +0,0 @@ -#include "sfile.h" -#include "exceptions.h" -#include - -Bu::SFile::SFile( const char *sName, const char *sFlags ) -{ - fh = fopen( sName, sFlags ); - if( fh == NULL ) - { - throw Bu::FileException( errno, strerror(errno) ); - } -} - -Bu::SFile::~SFile() -{ - close(); -} - -void Bu::SFile::close() -{ - if( fh ) - { - fclose( fh ); - fh = NULL; - } -} - -size_t Bu::SFile::read( void *pBuf, size_t nBytes ) -{ - if( !fh ) - throw FileException("File not open."); - - int nAmnt = fread( pBuf, 1, nBytes, fh ); - - if( nAmnt == 0 ) - throw FileException("End of file."); - - return nAmnt; -} - -size_t Bu::SFile::write( const void *pBuf, size_t nBytes ) -{ - if( !fh ) - throw FileException("File not open."); - - return fwrite( pBuf, 1, nBytes, fh ); -} - -long Bu::SFile::tell() -{ - if( !fh ) - throw FileException("File not open."); - - return ftell( fh ); -} - -void Bu::SFile::seek( long offset ) -{ - if( !fh ) - throw FileException("File not open."); - - fseek( fh, offset, SEEK_CUR ); -} - -void Bu::SFile::setPos( long pos ) -{ - if( !fh ) - throw FileException("File not open."); - - fseek( fh, pos, SEEK_SET ); -} - -void Bu::SFile::setPosEnd( long pos ) -{ - if( !fh ) - throw FileException("File not open."); - - fseek( fh, pos, SEEK_END ); -} - -bool Bu::SFile::isEOS() -{ - return feof( fh ); -} - -bool Bu::SFile::canRead() -{ - return true; -} - -bool Bu::SFile::canWrite() -{ - return true; -} - -bool Bu::SFile::canSeek() -{ - return true; -} - diff --git a/src/sfile.h b/src/sfile.h deleted file mode 100644 index f63b812..0000000 --- a/src/sfile.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef SFILE_H -#define SFILE_H - -#include - -#include "stream.h" - -namespace Bu -{ - class SFile : public Bu::Stream - { - public: - SFile( const char *sName, const char *sFlags ); - virtual ~SFile(); - - virtual void close(); - virtual size_t read( void *pBuf, size_t nBytes ); - virtual size_t write( const void *pBuf, size_t nBytes ); - - virtual long tell(); - virtual void seek( long offset ); - virtual void setPos( long pos ); - virtual void setPosEnd( long pos ); - virtual bool isEOS(); - - virtual bool canRead(); - virtual bool canWrite(); - virtual bool canSeek(); - - private: - FILE *fh; - - }; -} - -#endif diff --git a/src/socket.cpp b/src/socket.cpp new file mode 100644 index 0000000..c5c592b --- /dev/null +++ b/src/socket.cpp @@ -0,0 +1,10 @@ +#include "socket.h" + +Bu::Socket::Socket() +{ +} + +Bu::Socket::~Socket() +{ +} + diff --git a/src/socket.h b/src/socket.h new file mode 100644 index 0000000..8ccde71 --- /dev/null +++ b/src/socket.h @@ -0,0 +1,24 @@ +#ifndef SOCKET_H +#define SOCKET_H + +#include + +#include "stream.h" + +namespace Bu +{ + /** + * + */ + class Socket : public Stream + { + public: + Socket(); + virtual ~Socket(); + + private: + + }; +} + +#endif diff --git a/src/ssocket.cpp b/src/ssocket.cpp deleted file mode 100644 index 85a2da0..0000000 --- a/src/ssocket.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "ssocket.h" - -Bu::SSocket::SSocket() -{ -} - -Bu::SSocket::~SSocket() -{ -} diff --git a/src/ssocket.h b/src/ssocket.h deleted file mode 100644 index ce02091..0000000 --- a/src/ssocket.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef S_SOCKET_H -#define S_SOCKET_H - -#include - -#include "stream.h" - -namespace Bu -{ - /** - * - */ - class SSocket : public Stream - { - public: - SSocket(); - virtual ~SSocket(); - - private: - - }; -} - -#endif diff --git a/src/tests/archive.cpp b/src/tests/archive.cpp index 5b7e285..2035aa6 100644 --- a/src/tests/archive.cpp +++ b/src/tests/archive.cpp @@ -1,11 +1,11 @@ #include "archive.h" -#include "sfile.h" +#include "file.h" using namespace Bu; int main() { - SFile f("test.dat", "wb"); + File f("test.dat", "wb"); Archive ar( f, Archive::save ); std::string s("Hello there"); diff --git a/src/unit/file.cpp b/src/unit/file.cpp new file mode 100644 index 0000000..a45b8d7 --- /dev/null +++ b/src/unit/file.cpp @@ -0,0 +1,105 @@ +#include "unitsuite.h" +#include "file.h" +#include "exceptions.h" + +#include +#include +#include + +class Unit : public Bu::UnitSuite +{ +public: + Unit() + { + setName("File"); + addTest( Unit::writeFull ); + addTest( Unit::readBlocks ); + addTest( Unit::readError1 ); + addTest( Unit::readError2 ); + } + + virtual ~Unit() { } + + // + // Tests go here + // + void writeFull() + { + Bu::File sf("testfile1", "wb"); + for( int c = 0; c < 256; c++ ) + { + unsigned char ch = (unsigned char)c; + sf.write( &ch, 1 ); + unitTest( sf.tell() == c+1 ); + } + //unitTest( sf.canRead() == false ); + //unitTest( sf.canWrite() == true ); + //unitTest( sf.canSeek() == true ); + sf.close(); + struct stat sdat; + stat("testfile1", &sdat ); + unitTest( sdat.st_size == 256 ); + } + + void readBlocks() + { + Bu::File sf("testfile1", "rb"); + unsigned char buf[50]; + size_t total = 0; + for(;;) + { + size_t s = sf.read( buf, 50 ); + for( size_t c = 0; c < s; c++ ) + { + unitTest( buf[c] == (unsigned char)(c+total) ); + } + total += s; + if( s < 50 ) + { + unitTest( total == 256 ); + unitTest( sf.isEOS() == true ); + break; + } + } + sf.close(); + } + + void readError1() + { + try + { + Bu::File sf("doesn'texist", "rb"); + unitFailed("No exception thrown"); + } + catch( Bu::FileException &e ) + { + return; + } + } + + void readError2() + { + Bu::File sf("testfile1", "rb"); + char buf[256]; + int r = sf.read( buf, 256 ); + unitTest( r == 256 ); + // You have to read past the end to set the EOS flag. + unitTest( sf.isEOS() == false ); + try + { + sf.read( buf, 5 ); + unitFailed("No exception thrown"); + } + catch( Bu::FileException &e ) + { + sf.close(); + return; + } + } +}; + +int main( int argc, char *argv[] ) +{ + return Unit().run( argc, argv ); +} + diff --git a/src/unit/sfile.cpp b/src/unit/sfile.cpp deleted file mode 100644 index 2aff312..0000000 --- a/src/unit/sfile.cpp +++ /dev/null @@ -1,105 +0,0 @@ -#include "unitsuite.h" -#include "sfile.h" -#include "exceptions.h" - -#include -#include -#include - -class Unit : public Bu::UnitSuite -{ -public: - Unit() - { - setName("SFile"); - addTest( Unit::writeFull ); - addTest( Unit::readBlocks ); - addTest( Unit::readError1 ); - addTest( Unit::readError2 ); - } - - virtual ~Unit() { } - - // - // Tests go here - // - void writeFull() - { - Bu::SFile sf("testfile1", "wb"); - for( int c = 0; c < 256; c++ ) - { - unsigned char ch = (unsigned char)c; - sf.write( &ch, 1 ); - unitTest( sf.tell() == c+1 ); - } - //unitTest( sf.canRead() == false ); - //unitTest( sf.canWrite() == true ); - //unitTest( sf.canSeek() == true ); - sf.close(); - struct stat sdat; - stat("testfile1", &sdat ); - unitTest( sdat.st_size == 256 ); - } - - void readBlocks() - { - Bu::SFile sf("testfile1", "rb"); - unsigned char buf[50]; - size_t total = 0; - for(;;) - { - size_t s = sf.read( buf, 50 ); - for( size_t c = 0; c < s; c++ ) - { - unitTest( buf[c] == (unsigned char)(c+total) ); - } - total += s; - if( s < 50 ) - { - unitTest( total == 256 ); - unitTest( sf.isEOS() == true ); - break; - } - } - sf.close(); - } - - void readError1() - { - try - { - Bu::SFile sf("doesn'texist", "rb"); - unitFailed("No exception thrown"); - } - catch( Bu::FileException &e ) - { - return; - } - } - - void readError2() - { - Bu::SFile sf("testfile1", "rb"); - char buf[256]; - int r = sf.read( buf, 256 ); - unitTest( r == 256 ); - // You have to read past the end to set the EOS flag. - unitTest( sf.isEOS() == false ); - try - { - sf.read( buf, 5 ); - unitFailed("No exception thrown"); - } - catch( Bu::FileException &e ) - { - sf.close(); - return; - } - } -}; - -int main( int argc, char *argv[] ) -{ - return Unit().run( argc, argv ); -} - diff --git a/src/unitsuite.h b/src/unitsuite.h index db249b2..6e9270a 100644 --- a/src/unitsuite.h +++ b/src/unitsuite.h @@ -8,7 +8,42 @@ namespace Bu { /** + * Provides a unit testing framework. This is pretty easy to use, probably + * the best way to get started is to use ch to generate a template, or use + * the code below with appropriate tweaks: + *@code + * #include "unitsuite.h" + * + * class Unit : public Bu::UnitSuite + * { + * public: + * Unit() + * { + * setName("Example"); + * addTest( Unit::test ); + * } + * + * virtual ~Unit() { } + * + * // + * // Tests go here + * // + * void test() + * { + * unitTest( 1 == 1 ); + * } + * }; + * + * int main( int argc, char *argv[] ) + * { + * return Unit().run( argc, argv ); + * } * + @endcode + * The main function can contain other things, but using this one exactly + * makes all of the test suites work exactly the same. Using the optional + * setName at the top of the constructor replaces the class name with the + * chosen name when printing out stats and info. */ class UnitSuite { -- cgit v1.2.3 From 932677862376e9642a496a15b7f09f1106f495a5 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 28 Jun 2007 20:49:39 +0000 Subject: Many minor changes, hopefully the header fixes will keep future header macro conflicts from happening. And, from now on, other projects should do -Ilibbu++ not -Ilibbu++/src so we can get ready for an installed version of libbu++. --- bu | 1 + src/archival.h | 4 ++-- src/archive.h | 4 ++-- src/atom.h | 4 ++-- src/bzip2.h | 4 ++-- src/client.h | 4 ++-- src/exceptionbase.h | 4 ++-- src/exceptions.h | 4 ++-- src/file.h | 4 ++-- src/filter.h | 4 ++-- src/fstring.h | 4 ++-- src/hash.h | 4 ++-- src/ito.h | 4 ++-- src/itoatom.h | 4 ++-- src/itocondition.h | 4 ++-- src/itomutex.h | 4 ++-- src/itoqueue.h | 4 ++-- src/linkmessage.h | 4 ++-- src/list.h | 4 ++-- src/membuf.h | 4 ++-- src/paramproc.h | 4 ++-- src/plugger.h | 4 ++-- src/programchain.h | 4 ++-- src/programlink.h | 4 ++-- src/protocol.h | 4 ++-- src/ringbuffer.h | 4 ++-- src/server.h | 4 ++-- src/serversocket.h | 4 ++-- src/singleton.h | 4 ++-- src/socket.h | 4 ++-- src/sptr.h | 4 ++-- src/stream.h | 4 ++-- src/unitsuite.h | 4 ++-- 33 files changed, 65 insertions(+), 64 deletions(-) create mode 120000 bu (limited to 'src/unitsuite.h') diff --git a/bu b/bu new file mode 120000 index 0000000..02b8847 --- /dev/null +++ b/bu @@ -0,0 +1 @@ +src/bu/ \ No newline at end of file diff --git a/src/archival.h b/src/archival.h index e2c803c..8be3308 100644 --- a/src/archival.h +++ b/src/archival.h @@ -1,5 +1,5 @@ -#ifndef ARCHIVAL_H -#define ARCHIVAL_H +#ifndef BU_ARCHIVAL_H +#define BU_ARCHIVAL_H namespace Bu { diff --git a/src/archive.h b/src/archive.h index 05c6f57..6c0c1df 100644 --- a/src/archive.h +++ b/src/archive.h @@ -1,5 +1,5 @@ -#ifndef ARCHIVE_H -#define ARCHIVE_H +#ifndef BU_ARCHIVE_H +#define BU_ARCHIVE_H #include #include diff --git a/src/atom.h b/src/atom.h index a0469b6..fad47eb 100644 --- a/src/atom.h +++ b/src/atom.h @@ -1,5 +1,5 @@ -#ifndef ATOM_H -#define ATOM_H +#ifndef BU_ATOM_H +#define BU_ATOM_H #include #include diff --git a/src/bzip2.h b/src/bzip2.h index 25f10c5..0a111e8 100644 --- a/src/bzip2.h +++ b/src/bzip2.h @@ -1,5 +1,5 @@ -#ifndef B_ZIP2_H -#define B_ZIP2_H +#ifndef BU_BZIP2_H +#define BU_BZIP2_H #include #include diff --git a/src/client.h b/src/client.h index 02ba077..cee558d 100644 --- a/src/client.h +++ b/src/client.h @@ -1,5 +1,5 @@ -#ifndef CLIENT_H -#define CLIENT_H +#ifndef BU_CLIENT_H +#define BU_CLIENT_H #include diff --git a/src/exceptionbase.h b/src/exceptionbase.h index fd78089..24e4bbf 100644 --- a/src/exceptionbase.h +++ b/src/exceptionbase.h @@ -1,5 +1,5 @@ -#ifndef EXCEPTION_BASE_H -#define EXCEPTION_BASE_H +#ifndef BU_EXCEPTION_BASE_H +#define BU_EXCEPTION_BASE_H #include #include diff --git a/src/exceptions.h b/src/exceptions.h index d5a9d39..b824b91 100644 --- a/src/exceptions.h +++ b/src/exceptions.h @@ -1,5 +1,5 @@ -#ifndef EXCEPTIONS_H -#define EXCEPTIONS_H +#ifndef BU_EXCEPTIONS_H +#define BU_EXCEPTIONS_H #include "exceptionbase.h" #include diff --git a/src/file.h b/src/file.h index 0f638a7..d4e43eb 100644 --- a/src/file.h +++ b/src/file.h @@ -1,5 +1,5 @@ -#ifndef FILE_H -#define FILE_H +#ifndef BU_FILE_H +#define BU_FILE_H #include diff --git a/src/filter.h b/src/filter.h index 7bb04bc..bd557b2 100644 --- a/src/filter.h +++ b/src/filter.h @@ -1,5 +1,5 @@ -#ifndef FILTER_H -#define FILTER_H +#ifndef BU_FILTER_H +#define BU_FILTER_H #include diff --git a/src/fstring.h b/src/fstring.h index 7180f5f..bf6518b 100644 --- a/src/fstring.h +++ b/src/fstring.h @@ -1,5 +1,5 @@ -#ifndef F_STRING_H -#define F_STRING_H +#ifndef BU_F_STRING_H +#define BU_F_STRING_H #include #include diff --git a/src/hash.h b/src/hash.h index 6c4a443..0fa3af7 100644 --- a/src/hash.h +++ b/src/hash.h @@ -1,5 +1,5 @@ -#ifndef HASH_H -#define HASH_H +#ifndef BU_HASH_H +#define BU_HASH_H #include #include diff --git a/src/ito.h b/src/ito.h index 01253f5..c062052 100644 --- a/src/ito.h +++ b/src/ito.h @@ -1,5 +1,5 @@ -#ifndef ITO_H -#define ITO_H +#ifndef BU_ITO_H +#define BU_ITO_H #include diff --git a/src/itoatom.h b/src/itoatom.h index 96090f2..7fc9090 100644 --- a/src/itoatom.h +++ b/src/itoatom.h @@ -1,5 +1,5 @@ -#ifndef ITO_QUEUE_H -#define ITO_QUEUE_H +#ifndef BU_ITO_QUEUE_H +#define BU_ITO_QUEUE_H #include diff --git a/src/itocondition.h b/src/itocondition.h index 4771b22..1793f81 100644 --- a/src/itocondition.h +++ b/src/itocondition.h @@ -1,5 +1,5 @@ -#ifndef ITO_CONDITION_H -#define ITO_CONDITION_H +#ifndef BU_ITO_CONDITION_H +#define BU_ITO_CONDITION_H #include diff --git a/src/itomutex.h b/src/itomutex.h index 80956b8..9c9d205 100644 --- a/src/itomutex.h +++ b/src/itomutex.h @@ -1,5 +1,5 @@ -#ifndef ITO_MUTEX_H -#define ITO_MUTEX_H +#ifndef BU_ITO_MUTEX_H +#define BU_ITO_MUTEX_H #include diff --git a/src/itoqueue.h b/src/itoqueue.h index 322698d..75a2f27 100644 --- a/src/itoqueue.h +++ b/src/itoqueue.h @@ -1,5 +1,5 @@ -#ifndef ITO_QUEUE_H -#define ITO_QUEUE_H +#ifndef BU_ITO_QUEUE_H +#define BU_ITO_QUEUE_H #include diff --git a/src/linkmessage.h b/src/linkmessage.h index 64b8bc2..baa22a6 100644 --- a/src/linkmessage.h +++ b/src/linkmessage.h @@ -1,8 +1,8 @@ /**\file linkmessage.h */ -#ifndef LINKMESSAGE_H -#define LINKMESSAGE_H +#ifndef BU_LINKMESSAGE_H +#define BU_LINKMESSAGE_H namespace Bu { diff --git a/src/list.h b/src/list.h index 314459e..6235619 100644 --- a/src/list.h +++ b/src/list.h @@ -1,5 +1,5 @@ -#ifndef LIST_H -#define LIST_H +#ifndef BU_LIST_H +#define BU_LIST_H #include #include "bu/exceptionbase.h" diff --git a/src/membuf.h b/src/membuf.h index 877b35e..b82f943 100644 --- a/src/membuf.h +++ b/src/membuf.h @@ -1,5 +1,5 @@ -#ifndef MEM_BUF_H -#define MEM_BUF_H +#ifndef BU_MEM_BUF_H +#define BU_MEM_BUF_H #include diff --git a/src/paramproc.h b/src/paramproc.h index beee4a0..2bca588 100644 --- a/src/paramproc.h +++ b/src/paramproc.h @@ -1,5 +1,5 @@ -#ifndef PARAM_PROC_H -#define PARAM_PROC_H +#ifndef BU_PARAM_PROC_H +#define BU_PARAM_PROC_H #include #include diff --git a/src/plugger.h b/src/plugger.h index 4d2e7af..79a3271 100644 --- a/src/plugger.h +++ b/src/plugger.h @@ -1,5 +1,5 @@ -#ifndef PLUGGER_H -#define PLUGGER_H +#ifndef BU_PLUGGER_H +#define BU_PLUGGER_H #include "bu/hash.h" diff --git a/src/programchain.h b/src/programchain.h index e73d659..336a9f1 100644 --- a/src/programchain.h +++ b/src/programchain.h @@ -1,5 +1,5 @@ -#ifndef PROGRAMCHAIN_H -#define PROGRAMCHAIN_H +#ifndef BU_PROGRAMCHAIN_H +#define BU_PROGRAMCHAIN_H #include "bu/list.h" #include "bu/linkmessage.h" diff --git a/src/programlink.h b/src/programlink.h index 7c31a18..07d7489 100644 --- a/src/programlink.h +++ b/src/programlink.h @@ -1,5 +1,5 @@ -#ifndef PROGRAMLINK_H -#define PROGRAMLINK_H +#ifndef BU_PROGRAMLINK_H +#define BU_PROGRAMLINK_H #include "bu/linkmessage.h" #include "bu/programchain.h" diff --git a/src/protocol.h b/src/protocol.h index 3accd99..c7a9275 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -1,5 +1,5 @@ -#ifndef PROTOCOL_H -#define PROTOCOL_H +#ifndef BU_PROTOCOL_H +#define BU_PROTOCOL_H #include diff --git a/src/ringbuffer.h b/src/ringbuffer.h index 625f65b..be80e2f 100644 --- a/src/ringbuffer.h +++ b/src/ringbuffer.h @@ -1,5 +1,5 @@ -#ifndef RING_BUFFER_H -#define RING_BUFFER_H +#ifndef BU_RING_BUFFER_H +#define BU_RING_BUFFER_H #include #include "bu/exceptionbase.h" diff --git a/src/server.h b/src/server.h index 07eef95..302b6e3 100644 --- a/src/server.h +++ b/src/server.h @@ -1,5 +1,5 @@ -#ifndef SERVER_H -#define SERVER_H +#ifndef BU_SERVER_H +#define BU_SERVER_H #include diff --git a/src/serversocket.h b/src/serversocket.h index cb86078..b4ee247 100644 --- a/src/serversocket.h +++ b/src/serversocket.h @@ -1,5 +1,5 @@ -#ifndef SERVER_SOCKET_H -#define SERVER_SOCKET_H +#ifndef BU_SERVER_SOCKET_H +#define BU_SERVER_SOCKET_H #include #include "bu/fstring.h" diff --git a/src/singleton.h b/src/singleton.h index 4976a61..c43d71b 100644 --- a/src/singleton.h +++ b/src/singleton.h @@ -1,5 +1,5 @@ -#ifndef SINGLETON_H -#define SINGLETON_H +#ifndef BU_SINGLETON_H +#define BU_SINGLETON_H #include diff --git a/src/socket.h b/src/socket.h index c9dbd8d..0ccee3b 100644 --- a/src/socket.h +++ b/src/socket.h @@ -1,5 +1,5 @@ -#ifndef SOCKET_H -#define SOCKET_H +#ifndef BU_SOCKET_H +#define BU_SOCKET_H #include diff --git a/src/sptr.h b/src/sptr.h index 4baa697..75851a6 100644 --- a/src/sptr.h +++ b/src/sptr.h @@ -1,5 +1,5 @@ -#ifndef SPTR_H -#define SPTR_H +#ifndef BU_SPTR_H +#define BU_SPTR_H #include #include diff --git a/src/stream.h b/src/stream.h index 056de0c..1e236a6 100644 --- a/src/stream.h +++ b/src/stream.h @@ -1,5 +1,5 @@ -#ifndef STREAM_H -#define STREAM_H +#ifndef BU_STREAM_H +#define BU_STREAM_H #include #include diff --git a/src/unitsuite.h b/src/unitsuite.h index 6e9270a..578b4cc 100644 --- a/src/unitsuite.h +++ b/src/unitsuite.h @@ -1,5 +1,5 @@ -#ifndef UNIT_SUITE_H -#define UNIT_SUITE_H +#ifndef BU_UNIT_SUITE_H +#define BU_UNIT_SUITE_H #include #include -- cgit v1.2.3