summaryrefslogtreecommitdiffstats
path: root/tests/ChunkData/ArraytoCoord.cpp
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-05-23 18:18:11 +0200
committerTycho <work.tycho+git@gmail.com>2014-05-23 18:18:11 +0200
commit8be3a8f7dc10dbc49dfcdeca572677ef1e00f714 (patch)
tree204743272c8948237a8322027510f5240bfdb71e /tests/ChunkData/ArraytoCoord.cpp
parentUse placement new to initalise objects (diff)
downloadcuberite-8be3a8f7dc10dbc49dfcdeca572677ef1e00f714.tar
cuberite-8be3a8f7dc10dbc49dfcdeca572677ef1e00f714.tar.gz
cuberite-8be3a8f7dc10dbc49dfcdeca572677ef1e00f714.tar.bz2
cuberite-8be3a8f7dc10dbc49dfcdeca572677ef1e00f714.tar.lz
cuberite-8be3a8f7dc10dbc49dfcdeca572677ef1e00f714.tar.xz
cuberite-8be3a8f7dc10dbc49dfcdeca572677ef1e00f714.tar.zst
cuberite-8be3a8f7dc10dbc49dfcdeca572677ef1e00f714.zip
Diffstat (limited to 'tests/ChunkData/ArraytoCoord.cpp')
-rw-r--r--tests/ChunkData/ArraytoCoord.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/ChunkData/ArraytoCoord.cpp b/tests/ChunkData/ArraytoCoord.cpp
index fe82a3a7b..04e6fbc5a 100644
--- a/tests/ChunkData/ArraytoCoord.cpp
+++ b/tests/ChunkData/ArraytoCoord.cpp
@@ -6,9 +6,18 @@
int main(int argc, char** argv)
{
+ class cStarvationCallbacks
+ : public cAllocationPool<cChunkData::sChunkSection,1600>::cStarvationCallbacks
{
+ virtual void OnStartingUsingBuffer() {}
+ virtual void OnStopUsingBuffer() {}
+ virtual void OnBufferEmpty() {}
+ };
+ cAllocationPool<cChunkData::sChunkSection,1600> Pool(std::auto_ptr<cAllocationPool<cChunkData::sChunkSection,1600>::cStarvationCallbacks>(new cStarvationCallbacks()));
+ {
+
// Test first segment
- cChunkData buffer;
+ cChunkData buffer(Pool);
BLOCKTYPE* SrcBlockBuffer = new BLOCKTYPE[16 * 16 * 256];
memset(SrcBlockBuffer, 0x00, 16 * 16 * 256);
@@ -45,7 +54,7 @@ int main(int argc, char** argv)
{
// test following segment
- cChunkData buffer;
+ cChunkData buffer(Pool);
BLOCKTYPE* SrcBlockBuffer = new BLOCKTYPE[16 * 16 * 256];
memset(SrcBlockBuffer, 0x00, 16 * 16 * 256);
@@ -82,7 +91,7 @@ int main(int argc, char** argv)
{
// test zeros
- cChunkData buffer;
+ cChunkData buffer(Pool);
BLOCKTYPE* SrcBlockBuffer = new BLOCKTYPE[16 * 16 * 256];
memset(SrcBlockBuffer, 0x00, 16 * 16 * 256);