summaryrefslogtreecommitdiffstats
path: root/tests/ChunkData
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-05-30 18:13:36 +0200
committerTycho <work.tycho+git@gmail.com>2014-05-30 18:13:36 +0200
commitcbb9e152577e3db07832b96583f0ab0618d0d983 (patch)
treed763836733eed97b2511bdf7ae9cceb801aa82b0 /tests/ChunkData
parentAdded a cChunkData::CopyBlockTypes() unit test. (diff)
downloadcuberite-cbb9e152577e3db07832b96583f0ab0618d0d983.tar
cuberite-cbb9e152577e3db07832b96583f0ab0618d0d983.tar.gz
cuberite-cbb9e152577e3db07832b96583f0ab0618d0d983.tar.bz2
cuberite-cbb9e152577e3db07832b96583f0ab0618d0d983.tar.lz
cuberite-cbb9e152577e3db07832b96583f0ab0618d0d983.tar.xz
cuberite-cbb9e152577e3db07832b96583f0ab0618d0d983.tar.zst
cuberite-cbb9e152577e3db07832b96583f0ab0618d0d983.zip
Diffstat (limited to 'tests/ChunkData')
-rw-r--r--tests/ChunkData/CopyBlocks.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/ChunkData/CopyBlocks.cpp b/tests/ChunkData/CopyBlocks.cpp
index d132411db..b31ce3c63 100644
--- a/tests/ChunkData/CopyBlocks.cpp
+++ b/tests/ChunkData/CopyBlocks.cpp
@@ -30,12 +30,14 @@ int main(int argc, char ** argv)
BLOCKTYPE TestBuffer[5 * cChunkDef::NumBlocks];
size_t WritePosIdx = 2 * cChunkDef::NumBlocks;
BLOCKTYPE * WritePosition = &TestBuffer[WritePosIdx];
- memset(TestBuffer, 0x03, sizeof(TestBuffer));
for (size_t idx = 0; idx < 5000; idx++)
{
for (size_t len = 1; len < 1000; len += 15)
{
- printf("Testing copying %u blocks from index %u\n", (unsigned)len, (unsigned)idx);
+ //printf("Testing copying %u blocks from index %u\n", (unsigned)len, (unsigned)idx);
+
+ //initalize buffer
+ memset(TestBuffer, 0x03, sizeof(TestBuffer));
Data.CopyBlockTypes(WritePosition, idx, len);
@@ -45,7 +47,7 @@ int main(int argc, char ** argv)
assert_test(WritePosition[i] == 0x01);
}
// Verify the space before the copied data hasn't been changed:
- for (size_t i = 0; i < WritePosIdx + idx; i++)
+ for (size_t i = 0; i < WritePosIdx; i++)
{
assert_test(TestBuffer[i] == 0x03);
}