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

View file

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

View file

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

View file

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

View file

@ -14,8 +14,8 @@
// $Header$ // $Header$
#include "../../include/loki/SmallObj.h" #include <loki/SmallObj.h>
#include "../../include/loki/Singleton.h" #include <loki/Singleton.h>
#include <iostream> #include <iostream>
// define DO_EXTRA_LOKI_TESTS in src/SmallObj.cpp to get // define DO_EXTRA_LOKI_TESTS in src/SmallObj.cpp to get
@ -366,6 +366,9 @@ int main()
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// $Log$ // $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 // Revision 1.12 2006/01/04 23:54:30 syntheticpp
// remove system(PAUSE) for gcc, Thanks to Lukas Fittl // remove system(PAUSE) for gcc, Thanks to Lukas Fittl
// //