assert, include path, and virtual ~ patches by Lukas Fittl

git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@414 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
syntheticpp 2006-01-05 09:55:09 +00:00
parent d5a206bb96
commit c65487fd89
6 changed files with 19 additions and 13 deletions

View file

@ -131,6 +131,7 @@ namespace Loki
public:
typedef R ReturnType;
typedef T ParamType;
virtual ~Visitor() {}
virtual ReturnType Visit(ParamType&) = 0;
};
@ -140,6 +141,7 @@ namespace Loki
public:
typedef R ReturnType;
typedef const T ParamType;
virtual ~Visitor() {}
virtual ReturnType Visit(ParamType&) = 0;
};

View file

@ -157,8 +157,6 @@ private:
#ifdef LOKI_NONCC
#include "../../include/noncc/loki/Singleton.cpp"
#else
#include "../../src/Singleton.cpp"
#endif
#endif

View file

@ -256,7 +256,7 @@ inline void TypeTraitsTest2::testEnd()
cout << "---------------------------"
<< "-----------------------" << endl;
for (int i = 0;i < textBuffer_.size();++i)
for (size_t i = 0;i < textBuffer_.size();++i)
{
cout << textBuffer_[i];
}

View file

@ -84,4 +84,4 @@ int main()
try{ u2.AddFriendGuarded(u1); }
catch (...){}
std::cout << "u2 countFriends: " << u2.countFriends() << "\n";
}
}

View file

@ -18,7 +18,7 @@
#define LOKI_SMALL_OBJECT_USE_NEW_ARRAY
#include "../../include/loki/SmallObj.h"
#include <loki/SmallObj.h>
#include "timer.h"
#include <iostream>
@ -255,7 +255,7 @@ void testSize()
typedef BoostPoolNew<Size> D;
#endif
assert( !Loki::AllocatorSingleton< LOKI_ALLOCATOR_PARAMETERS >::IsCorrupted() );
assert( (!Loki::AllocatorSingleton< LOKI_ALLOCATOR_PARAMETERS >::IsCorrupted()) );
cout << endl << endl;
cout << "Allocator Benchmark Tests with " << Size << " bytes big objects " << endl;
cout << endl;
@ -278,25 +278,25 @@ void testSize()
cout << loop << " times ";
LOKI_SMALLOBJBECH_ABCD(delete_new ,0,loop,t,"'delete new T'");
assert( !Loki::AllocatorSingleton< LOKI_ALLOCATOR_PARAMETERS >::IsCorrupted() );
assert( (!Loki::AllocatorSingleton< LOKI_ALLOCATOR_PARAMETERS >::IsCorrupted()) );
cout << "N=" << N <<" : " << loop << " times ";
LOKI_SMALLOBJBECH_ABCD(delete_new_array ,N,loop,t,"'delete[] new T[N]'");
assert( !Loki::AllocatorSingleton< LOKI_ALLOCATOR_PARAMETERS >::IsCorrupted() );
assert( (!Loki::AllocatorSingleton< LOKI_ALLOCATOR_PARAMETERS >::IsCorrupted()) );
cout << "i=0..." << Narr << " : ";
LOKI_SMALLOBJBECH_ABCD(new_del_on_arr ,0,Narr,t,"1. 'arr[i] = new T' 2. 'delete arr[i]'");
assert( !Loki::AllocatorSingleton< LOKI_ALLOCATOR_PARAMETERS >::IsCorrupted() );
assert( (!Loki::AllocatorSingleton< LOKI_ALLOCATOR_PARAMETERS >::IsCorrupted()) );
cout << "i=0..." << Narr << ", N=" << N <<" : ";
LOKI_SMALLOBJBECH_ABCD(new_del_a_on_a ,N,Narr,t,"1. 'arr[i] = new T[N]' 2. 'delete[] arr[i]'");
assert( !Loki::AllocatorSingleton< LOKI_ALLOCATOR_PARAMETERS >::IsCorrupted() );
assert( (!Loki::AllocatorSingleton< LOKI_ALLOCATOR_PARAMETERS >::IsCorrupted()) );
delete [] a;
cout << "_________________________________________________________________" << endl;
assert( !Loki::AllocatorSingleton< LOKI_ALLOCATOR_PARAMETERS >::IsCorrupted() );
assert( (!Loki::AllocatorSingleton< LOKI_ALLOCATOR_PARAMETERS >::IsCorrupted()) );
Loki::AllocatorSingleton< LOKI_ALLOCATOR_PARAMETERS >::ClearExtraMemory();
}
@ -324,6 +324,9 @@ int main()
// ----------------------------------------------------------------------------
// $Log$
// Revision 1.18 2006/01/05 09:55:09 syntheticpp
// assert, include path, and virtual ~ patches by Lukas Fittl
//
// Revision 1.17 2006/01/04 23:54:30 syntheticpp
// remove system(PAUSE) for gcc, Thanks to Lukas Fittl
//

View file

@ -14,8 +14,8 @@
// $Header$
#include "../../include/loki/SmallObj.h"
#include "../../include/loki/Singleton.h"
#include <loki/SmallObj.h>
#include <loki/Singleton.h>
#include <iostream>
// define DO_EXTRA_LOKI_TESTS in src/SmallObj.cpp to get
@ -366,6 +366,9 @@ int main()
// ----------------------------------------------------------------------------
// $Log$
// Revision 1.13 2006/01/05 09:55:09 syntheticpp
// assert, include path, and virtual ~ patches by Lukas Fittl
//
// Revision 1.12 2006/01/04 23:54:30 syntheticpp
// remove system(PAUSE) for gcc, Thanks to Lukas Fittl
//