diff options
author | Mattes D <github@xoft.cz> | 2019-08-26 21:38:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-26 21:38:34 +0200 |
commit | 74579fbadf0f89154cba5d9157a57f59fcda8f70 (patch) | |
tree | 2aca1ce5d8e41e91adcfe25dfb4bb51369fb865e /tests/ChunkData/CopyBlocks.cpp | |
parent | Added BlockState implementation for 1.13 support. (diff) | |
download | cuberite-74579fbadf0f89154cba5d9157a57f59fcda8f70.tar cuberite-74579fbadf0f89154cba5d9157a57f59fcda8f70.tar.gz cuberite-74579fbadf0f89154cba5d9157a57f59fcda8f70.tar.bz2 cuberite-74579fbadf0f89154cba5d9157a57f59fcda8f70.tar.lz cuberite-74579fbadf0f89154cba5d9157a57f59fcda8f70.tar.xz cuberite-74579fbadf0f89154cba5d9157a57f59fcda8f70.tar.zst cuberite-74579fbadf0f89154cba5d9157a57f59fcda8f70.zip |
Diffstat (limited to 'tests/ChunkData/CopyBlocks.cpp')
-rw-r--r-- | tests/ChunkData/CopyBlocks.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/tests/ChunkData/CopyBlocks.cpp b/tests/ChunkData/CopyBlocks.cpp index 623ed208b..ad1524fe5 100644 --- a/tests/ChunkData/CopyBlocks.cpp +++ b/tests/ChunkData/CopyBlocks.cpp @@ -8,16 +8,16 @@ #include "Globals.h" +#include "../TestHelpers.h" #include "ChunkData.h" -int main(int argc, char ** argv) +/** Performs the entire CopyBlocks test. */ +static void test() { - LOGD("Test started"); - // Set up a cChunkData with known contents - all blocks 0x01, all metas 0x02: class cMockAllocationPool : public cAllocationPool<cChunkData::sChunkSection> @@ -67,17 +67,17 @@ int main(int argc, char ** argv) // Verify the data copied: for (size_t i = 0; i < len; i++) { - assert_test(WritePosition[i] == 0x01); + TEST_EQUAL(WritePosition[i], 0x01); } // Verify the space before the copied data hasn't been changed: for (size_t i = 0; i < WritePosIdx; i++) { - assert_test(TestBuffer[i] == 0x03); + TEST_EQUAL(TestBuffer[i], 0x03); } // Verify the space after the copied data hasn't been changed: for (size_t i = WritePosIdx + idx + len; i < ARRAYCOUNT(TestBuffer); i++) { - assert_test(TestBuffer[i] == 0x03); + TEST_EQUAL(TestBuffer[i], 0x03); } // Re-initialize the buffer for the next test: @@ -87,10 +87,12 @@ int main(int argc, char ** argv) } } // for len } // for idx - return 0; } +IMPLEMENT_TEST_MAIN("ChunkData CopyBlocks", + test() +) |