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/sharedcore.cpp | 98 ------------------------------------------------ 1 file changed, 98 deletions(-) delete mode 100644 src/tests/sharedcore.cpp (limited to 'src/tests/sharedcore.cpp') diff --git a/src/tests/sharedcore.cpp b/src/tests/sharedcore.cpp deleted file mode 100644 index c68f07b..0000000 --- a/src/tests/sharedcore.cpp +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (C) 2007-2011 Xagasoft, All rights reserved. - * - * This file is part of the libbu++ library and is released under the - * terms of the license contained in the file LICENSE. - */ - -#include "bu/sharedcore.h" -#include "bu/sio.h" - -using namespace Bu; - -struct ShintCore -{ - int val; -}; -class Shint : public Bu::SharedCore -{ -public: - Shint() - { - core->val = 0; - } - - Shint( int val ) - { - core->val = val; - } - - int getVal() const - { - return core->val; - } - - void setValBad( int val ) - { - core->val = val; - } - - void setVal( int val ) - { - _hardCopy(); - core->val = val; - } - - bool operator==( const Shint &rhs ) - { - if( core == rhs.core ) - { - sio << "Same pointer (" << Fmt::ptr() << core << ")" << sio.nl; - return true; - } - if( core->val == rhs.core->val ) - { - sio << "Same value " << core->val << " (" - << Fmt::ptr() << core << " vs " - << Fmt::ptr() << rhs.core << ")" - << sio.nl; - return true; - } - sio << "Different" << sio.nl; - return false; - } -}; - -#define line( x ) sio << __FILE__ ": " << __LINE__ << ": " << #x << sio.nl; x - -int main() -{ - line( Shint a; ) - line( Shint b( 5 ); ) - - line( a == b; ) - - line( b = a; ) - line( a == b; ) - - line( b.setValBad( 12 ); ) - sio << a.getVal() << " != " << b.getVal() << sio.nl; - line( a == b; ) - - line( a.setVal( 3 ); ) - sio << a.getVal() << " != " << b.getVal() << sio.nl; - line( a == b; ) - - line( a.setVal( b.getVal() ); ) - line( a == b; ) - - { - Shint c( b ); - Shint d( c ); - sio << c.getVal(); - d.setVal( 43 ); - } - - sio << b.getVal(); -} - -- cgit v1.2.3