]> git.localhorst.tv Git - blank.git/blobdiff - tst/world/ChunkTest.cpp
added simple command line
[blank.git] / tst / world / ChunkTest.cpp
index c8dac8319f30835cbacf20a6b9c3d4391db1531a..c40f9da917a979abcc79d62f6c766a6bc5e5a4cb 100644 (file)
@@ -305,7 +305,7 @@ void ChunkTest::testNeighbor() {
        for (int i = 0; i < Block::FACE_COUNT; ++i) {
                Block::Face face = Block::Face(i);
                neighbor->Position(Block::FaceNormal(face));
-               chunk->SetNeighbor(*neighbor);
+               chunk->SetNeighbor(face, *neighbor);
                CPPUNIT_ASSERT_MESSAGE(
                        "chunk did not link right neighbor",
                        chunk->HasNeighbor(face)
@@ -322,16 +322,7 @@ void ChunkTest::testNeighbor() {
                        "chunk did not link correct neighbor",
                        &*chunk, &neighbor->GetNeighbor(Block::Opposite(face))
                );
-               chunk->ClearNeighbors();
-       }
-
-       neighbor->Position({1, 1, 1});
-       chunk->SetNeighbor(*neighbor);
-       for (int i = 0; i < Block::FACE_COUNT; ++i) {
-               CPPUNIT_ASSERT_MESSAGE(
-                       "chunk linked with non-neighbor",
-                       !chunk->HasNeighbor(Block::Face(i))
-               );
+               chunk->Unlink();
        }
 }
 
@@ -389,6 +380,8 @@ void ChunkTest::testLight() {
 
 void ChunkTest::testLightPropagation() {
        unique_ptr<Chunk> chunk(new Chunk(types));
+       // this is required to make the chunk do lighting propagation at all
+       chunk->ScanLights();
 
        // 0 air, 1 solid, 2 solid and emits light level of 5
        chunk->SetBlock(Chunk::Pos(7, 7, 7), Block(2));