From ee50790398791c38e563eee04cf12780fab74baf Mon Sep 17 00:00:00 2001 From: Tycho Date: Mon, 16 Jun 2014 15:12:50 +0100 Subject: Merge branch 'master' of github.com:mc-server/MCServer --- tests/ChunkData/ArraytoCoord.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'tests/ChunkData/ArraytoCoord.cpp') diff --git a/tests/ChunkData/ArraytoCoord.cpp b/tests/ChunkData/ArraytoCoord.cpp index 0daf38f7b..9d0ca6c8c 100644 --- a/tests/ChunkData/ArraytoCoord.cpp +++ b/tests/ChunkData/ArraytoCoord.cpp @@ -6,9 +6,23 @@ int main(int argc, char** argv) { + class cMockAllocationPool + : public cAllocationPool + { + virtual cChunkData::sChunkSection * Allocate() + { + return new cChunkData::sChunkSection(); + } + + virtual void Free(cChunkData::sChunkSection * a_Ptr) + { + delete a_Ptr; + } + } Pool; { + // Test first segment - cChunkData buffer; + cChunkData buffer(Pool); BLOCKTYPE SrcBlockBuffer[16 * 16 * 256]; memset(SrcBlockBuffer, 0x00, sizeof(SrcBlockBuffer)); @@ -35,7 +49,7 @@ int main(int argc, char** argv) { // test following segment - cChunkData buffer; + cChunkData buffer(Pool); BLOCKTYPE SrcBlockBuffer[16 * 16 * 256]; memset(SrcBlockBuffer, 0x00, sizeof(SrcBlockBuffer)); @@ -62,7 +76,7 @@ int main(int argc, char** argv) { // test zeros - cChunkData buffer; + cChunkData buffer(Pool); BLOCKTYPE SrcBlockBuffer[16 * 16 * 256]; memset(SrcBlockBuffer, 0x00, sizeof(SrcBlockBuffer)); -- cgit v1.2.3