newly added. Not for productive used yetsvn diff | grep Index:
This commit is contained in:
0
src/tests/stl_check/.kdbgrc.stl_check
Executable file
0
src/tests/stl_check/.kdbgrc.stl_check
Executable file
37
src/tests/stl_check/PPointObj.cpp
Normal file
37
src/tests/stl_check/PPointObj.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
#include "PPointObj.h"
|
||||
|
||||
PPointObj::PPointObj(unsigned int counter) : fCounter(counter)
|
||||
{
|
||||
fTest = new int[5];
|
||||
|
||||
for (unsigned int i=0; i<5; i++)
|
||||
fTest[i] = 10*counter+i;
|
||||
|
||||
cout << endl << "in PPointObj() " << fCounter << ": fTest = " << fTest;
|
||||
cout << endl;
|
||||
}
|
||||
|
||||
PPointObj::~PPointObj()
|
||||
{
|
||||
cout << endl << "in ~PPointObj() " << fCounter << ": fTest = " << fTest;
|
||||
cout << endl;
|
||||
}
|
||||
|
||||
void PPointObj::PrintTest()
|
||||
{
|
||||
cout << endl << fCounter << ": ";
|
||||
for (unsigned int i=0; i<5; i++)
|
||||
cout << fTest[i] << ", ";
|
||||
cout << endl;
|
||||
}
|
||||
|
||||
void PPointObj::CleanUp()
|
||||
{
|
||||
if (fTest) {
|
||||
delete [] fTest;
|
||||
fTest = 0;
|
||||
}
|
||||
}
|
||||
17
src/tests/stl_check/PPointObj.h
Normal file
17
src/tests/stl_check/PPointObj.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifndef _PPOINTOBJ_H_
|
||||
#define _PPOINTOBJ_H_
|
||||
|
||||
class PPointObj {
|
||||
public:
|
||||
PPointObj(unsigned int counter);
|
||||
~PPointObj();
|
||||
|
||||
void PrintTest();
|
||||
void CleanUp();
|
||||
|
||||
private:
|
||||
int fCounter;
|
||||
int *fTest;
|
||||
};
|
||||
|
||||
#endif // _PPOINTOBJ_H_
|
||||
10
src/tests/stl_check/PStlCheck.cpp
Normal file
10
src/tests/stl_check/PStlCheck.cpp
Normal file
@@ -0,0 +1,10 @@
|
||||
#include "PStlCheck.h"
|
||||
|
||||
PStlCheck::PStlCheck()
|
||||
{
|
||||
}
|
||||
|
||||
PStlCheck::~PStlCheck()
|
||||
{
|
||||
fPpo.clear();
|
||||
}
|
||||
17
src/tests/stl_check/PStlCheck.h
Normal file
17
src/tests/stl_check/PStlCheck.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifndef _PSTLCHECK_H_
|
||||
#define _PSTLCHECK_H_
|
||||
|
||||
#include <list>
|
||||
using namespace std;
|
||||
|
||||
#include "PPointObj.h"
|
||||
|
||||
class PStlCheck {
|
||||
public:
|
||||
PStlCheck();
|
||||
~PStlCheck();
|
||||
|
||||
list<PPointObj> fPpo;
|
||||
};
|
||||
|
||||
#endif // _PSTLCHECK_H_
|
||||
28
src/tests/stl_check/stl_check.cpp
Normal file
28
src/tests/stl_check/stl_check.cpp
Normal file
@@ -0,0 +1,28 @@
|
||||
#include <iostream>
|
||||
#include <list>
|
||||
using namespace std;
|
||||
|
||||
#include "PStlCheck.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
PStlCheck check;
|
||||
unsigned int counter = 0;
|
||||
|
||||
for (unsigned int i=0; i<2; i++) {
|
||||
check.fPpo.push_back(PPointObj(counter++));
|
||||
cout << endl << "----------";
|
||||
}
|
||||
|
||||
cout << endl << "size = " << check.fPpo.size();
|
||||
cout << endl;
|
||||
|
||||
list<PPointObj>::iterator iter;
|
||||
for (iter=check.fPpo.begin(); iter!=check.fPpo.end(); ++iter)
|
||||
iter->PrintTest();
|
||||
|
||||
for (iter=check.fPpo.begin(); iter!=check.fPpo.end(); ++iter)
|
||||
iter->CleanUp();
|
||||
|
||||
return 0;
|
||||
}
|
||||
22
src/tests/stl_check/stl_check.pro
Normal file
22
src/tests/stl_check/stl_check.pro
Normal file
@@ -0,0 +1,22 @@
|
||||
#------------------------------------------------------
|
||||
# stl_check.pro
|
||||
# qmake file for stl_check
|
||||
#
|
||||
# Andreas Suter, 2007/05/14
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
#------------------------------------------------------
|
||||
|
||||
MAKEFILE = Makefile.stl_check
|
||||
|
||||
CONFIG += warn_on debug
|
||||
|
||||
HEADERS = PStlCheck.h \
|
||||
PPointObj.h
|
||||
|
||||
SOURCES = stl_check.cpp \
|
||||
PStlCheck.cpp \
|
||||
PPointObj.cpp
|
||||
|
||||
TARGET=stl_check
|
||||
Reference in New Issue
Block a user