summaryrefslogtreecommitdiffstats
path: root/tests/ChunkData/Coordinates.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/Coordinates.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 '')
-rw-r--r--tests/ChunkData/Coordinates.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/tests/ChunkData/Coordinates.cpp b/tests/ChunkData/Coordinates.cpp
index c0c46000e..0a7d5e3f1 100644
--- a/tests/ChunkData/Coordinates.cpp
+++ b/tests/ChunkData/Coordinates.cpp
@@ -6,8 +6,16 @@
int main(int argc, char** argv)
{
+ class cStarvationCallbacks
+ : public cAllocationPool<cChunkData::sChunkSection,1600>::cStarvationCallbacks
{
- cChunkData buffer;
+ virtual void OnStartingUsingBuffer() {}
+ virtual void OnStopUsingBuffer() {}
+ virtual void OnBufferEmpty() {}
+ };
+ cAllocationPool<cChunkData::sChunkSection,1600> Pool(std::auto_ptr<cAllocationPool<cChunkData::sChunkSection,1600>::cStarvationCallbacks>(new cStarvationCallbacks()));
+ {
+ cChunkData buffer(Pool);
// Empty chunks
buffer.SetBlock(0,0,0, 0xAB);
@@ -105,7 +113,7 @@ int main(int argc, char** argv)
}
{
- cChunkData buffer;
+ cChunkData buffer(Pool);
// Zero's
buffer.SetBlock(0,0,0, 0x0);
@@ -122,9 +130,9 @@ int main(int argc, char** argv)
{
// Operator =
- cChunkData buffer;
+ cChunkData buffer(Pool);
buffer.SetBlock(0,0,0,0x42);
- cChunkData copy;
+ cChunkData copy(Pool);
#if __cplusplus < 201103L
copy = buffer;
#else