+ chunk->SetBlock(RoughLocation::Fine(6, 7, 7), Block(1));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(
+ "adding obstacle affected unrelated index",
+ 5, chunk->GetLight(RoughLocation::Fine(7, 7, 7))
+ );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(
+ "adding obstacle affected unrelated index",
+ 4, chunk->GetLight(RoughLocation::Fine(8, 7, 7))
+ );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(
+ "adding obstacle affected unrelated index",
+ 4, chunk->GetLight(RoughLocation::Fine(7, 8, 7))
+ );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(
+ "adding obstacle affected unrelated index",
+ 4, chunk->GetLight(RoughLocation::Fine(7, 6, 7))
+ );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(
+ "adding obstacle affected unrelated index",
+ 4, chunk->GetLight(RoughLocation::Fine(7, 7, 8))
+ );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(
+ "adding obstacle affected unrelated index",
+ 4, chunk->GetLight(RoughLocation::Fine(7, 7, 6))
+ );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(
+ "adding obstacle affected unrelated index",
+ 3, chunk->GetLight(RoughLocation::Fine(6, 6, 7))
+ );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(
+ "adding obstacle affected unrelated index",
+ 3, chunk->GetLight(RoughLocation::Fine(6, 8, 7))
+ );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(
+ "adding obstacle affected unrelated index",
+ 3, chunk->GetLight(RoughLocation::Fine(6, 7, 6))
+ );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(
+ "adding obstacle affected unrelated index",
+ 3, chunk->GetLight(RoughLocation::Fine(6, 7, 6))
+ );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(
+ "adding obstacle affected unrelated index",
+ 2, chunk->GetLight(RoughLocation::Fine(5, 6, 7))
+ );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(
+ "adding obstacle affected unrelated index",
+ 2, chunk->GetLight(RoughLocation::Fine(5, 8, 7))
+ );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(
+ "adding obstacle affected unrelated index",
+ 2, chunk->GetLight(RoughLocation::Fine(5, 7, 6))
+ );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(
+ "adding obstacle affected unrelated index",
+ 2, chunk->GetLight(RoughLocation::Fine(5, 7, 6))
+ );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(
+ "adding obstacle resulted in unexpected light level behind it",
+ 1, chunk->GetLight(RoughLocation::Fine(5, 7, 7))
+ );
+
+ // and remove it again
+ chunk->SetBlock(RoughLocation::Fine(6, 7, 7), Block(0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(
+ "removing obstacle did not refill light correctly",
+ 4, chunk->GetLight(RoughLocation::Fine(6, 7, 7))
+ );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(
+ "removing obstacle did not refill light correctly",
+ 3, chunk->GetLight(RoughLocation::Fine(5, 7, 7))
+ );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(
+ "removing obstacle did not refill light correctly",
+ 2, chunk->GetLight(RoughLocation::Fine(4, 7, 7))
+ );