summaryrefslogtreecommitdiffstats
path: root/tests/ChunkBuffer/Copies.cpp
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-05-11 16:57:56 +0200
committerTycho <work.tycho+git@gmail.com>2014-05-11 16:57:56 +0200
commit79ab80718ef18f174c73ecb804cb8604e0717fa5 (patch)
tree4cf0e7884c820037fcad387f78833df188e92fde /tests/ChunkBuffer/Copies.cpp
parentFixed a bug in writting zeros to a non-allocated section (diff)
downloadcuberite-79ab80718ef18f174c73ecb804cb8604e0717fa5.tar
cuberite-79ab80718ef18f174c73ecb804cb8604e0717fa5.tar.gz
cuberite-79ab80718ef18f174c73ecb804cb8604e0717fa5.tar.bz2
cuberite-79ab80718ef18f174c73ecb804cb8604e0717fa5.tar.lz
cuberite-79ab80718ef18f174c73ecb804cb8604e0717fa5.tar.xz
cuberite-79ab80718ef18f174c73ecb804cb8604e0717fa5.tar.zst
cuberite-79ab80718ef18f174c73ecb804cb8604e0717fa5.zip
Diffstat (limited to '')
-rw-r--r--tests/ChunkBuffer/Copies.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/ChunkBuffer/Copies.cpp b/tests/ChunkBuffer/Copies.cpp
index 6bdf80268..a6c83f75d 100644
--- a/tests/ChunkBuffer/Copies.cpp
+++ b/tests/ChunkBuffer/Copies.cpp
@@ -50,4 +50,40 @@ int main(int argc, char** argv)
delete DstNibbleBuffer;
SrcNibbleBuffer = NULL;
DstNibbleBuffer = NULL;
+
+ SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2];
+ for (int i = 0; i < 16 * 16 * 256 / 2; i += 4)
+ {
+ SrcNibbleBuffer[i+0] = 0xDE;
+ SrcNibbleBuffer[i+1] = 0xAD;
+ SrcNibbleBuffer[i+2] = 0xBE;
+ SrcNibbleBuffer[i+3] = 0xEF;
+ }
+
+ buffer.SetLight(SrcNibbleBuffer);
+ DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2];
+ buffer.CopyLight(DstNibbleBuffer);
+ testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) -1) == 0);
+ delete SrcNibbleBuffer;
+ delete DstNibbleBuffer;
+ SrcNibbleBuffer = NULL;
+ DstNibbleBuffer = NULL;
+
+ SrcNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/2];
+ for (int i = 0; i < 16 * 16 * 256 / 2; i += 4)
+ {
+ SrcNibbleBuffer[i+0] = 0xAD;
+ SrcNibbleBuffer[i+1] = 0xBE;
+ SrcNibbleBuffer[i+2] = 0xEF;
+ SrcNibbleBuffer[i+3] = 0xDE;
+ }
+
+ buffer.SetSkyLight(SrcNibbleBuffer);
+ DstNibbleBuffer = new NIBBLETYPE[16 * 16 * 256/ 2];
+ buffer.CopySkyLight(DstNibbleBuffer);
+ testassert(memcmp(SrcNibbleBuffer, DstNibbleBuffer, (16 * 16 * 256 /2) -1) == 0);
+ delete SrcNibbleBuffer;
+ delete DstNibbleBuffer;
+ SrcNibbleBuffer = NULL;
+ DstNibbleBuffer = NULL;
}