X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=tst%2Fworld%2FChunkTest.cpp;h=c40f9da917a979abcc79d62f6c766a6bc5e5a4cb;hb=d122d3e445d64f7d710c1cfaf285ff01bbe955b9;hp=c8dac8319f30835cbacf20a6b9c3d4391db1531a;hpb=695918769a616db82dbebb987ea91f3204dee8a9;p=blank.git diff --git a/tst/world/ChunkTest.cpp b/tst/world/ChunkTest.cpp index c8dac83..c40f9da 100644 --- a/tst/world/ChunkTest.cpp +++ b/tst/world/ChunkTest.cpp @@ -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(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));