diff options
author | Mattes D <github@xoft.cz> | 2014-05-30 18:32:15 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-05-30 18:32:15 +0200 |
commit | f2470ff7c11fc8226b20a5d53f5a4e8ee0e8454e (patch) | |
tree | 4d11102ee2fc641aad0c9ebb0fe8fdd7f29a6e41 /tests/ChunkData | |
parent | Fix bugs in test (diff) | |
download | cuberite-f2470ff7c11fc8226b20a5d53f5a4e8ee0e8454e.tar cuberite-f2470ff7c11fc8226b20a5d53f5a4e8ee0e8454e.tar.gz cuberite-f2470ff7c11fc8226b20a5d53f5a4e8ee0e8454e.tar.bz2 cuberite-f2470ff7c11fc8226b20a5d53f5a4e8ee0e8454e.tar.lz cuberite-f2470ff7c11fc8226b20a5d53f5a4e8ee0e8454e.tar.xz cuberite-f2470ff7c11fc8226b20a5d53f5a4e8ee0e8454e.tar.zst cuberite-f2470ff7c11fc8226b20a5d53f5a4e8ee0e8454e.zip |
Diffstat (limited to '')
-rw-r--r-- | tests/ChunkData/CopyBlocks.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/tests/ChunkData/CopyBlocks.cpp b/tests/ChunkData/CopyBlocks.cpp index b31ce3c63..be8cab234 100644 --- a/tests/ChunkData/CopyBlocks.cpp +++ b/tests/ChunkData/CopyBlocks.cpp @@ -30,15 +30,18 @@ int main(int argc, char ** argv) BLOCKTYPE TestBuffer[5 * cChunkDef::NumBlocks]; size_t WritePosIdx = 2 * cChunkDef::NumBlocks; BLOCKTYPE * WritePosition = &TestBuffer[WritePosIdx]; - for (size_t idx = 0; idx < 5000; idx++) + memset(TestBuffer, 0x03, sizeof(TestBuffer)); + size_t LastReportedStep = 1; + for (size_t idx = 0; idx < 5000; idx += 7) { - for (size_t len = 1; len < 1000; len += 15) + if (idx / 500 != LastReportedStep) { - //printf("Testing copying %u blocks from index %u\n", (unsigned)len, (unsigned)idx); - - //initalize buffer - memset(TestBuffer, 0x03, sizeof(TestBuffer)); + printf("Testing index %u...\n", (unsigned)idx); + LastReportedStep = idx / 500; + } + for (size_t len = 3; len < 1000; len += 13) + { Data.CopyBlockTypes(WritePosition, idx, len); // Verify the data copied: @@ -56,7 +59,13 @@ int main(int argc, char ** argv) { assert_test(TestBuffer[i] == 0x03); } - } + + // Re-initialize the buffer for the next test: + for (size_t i = 0; i < len; i++) + { + WritePosition[i] = 0x03; + } + } // for len } // for idx return 0; } |