]> git.lizzy.rs Git - minetest.git/commitdiff
Test on-lighting node param1 in lighting test
authorJude Melton-Houghton <jwmhjwmh@gmail.com>
Wed, 12 Oct 2022 17:48:59 +0000 (13:48 -0400)
committerJude Melton-Houghton <jwmhjwmh@gmail.com>
Thu, 13 Oct 2022 12:46:16 +0000 (08:46 -0400)
src/unittest/test_voxelalgorithms.cpp

index 6514d3713d00f2b2681ec8b31ae0f72e71ca5b09..767e9de31e93f1628c270096b674540f7303880c 100644 (file)
@@ -133,6 +133,7 @@ void TestVoxelAlgorithms::testLighting(IGameDef *gamedef)
                map.addNodeAndUpdate(v3s16(-10, 0, 0), MapNode(CONTENT_AIR), modified_blocks);
                map.addNodeAndUpdate(v3s16(9, 10, -9), MapNode(t_CONTENT_WATER), modified_blocks);
                map.addNodeAndUpdate(v3s16(0, 0, 0), MapNode(t_CONTENT_TORCH), modified_blocks);
+               map.addNodeAndUpdate(v3s16(-10, 1, 0), MapNode(t_CONTENT_STONE, 153), modified_blocks);
        }
 
        const NodeDefManager *ndef = gamedef->ndef();
@@ -161,4 +162,9 @@ void TestVoxelAlgorithms::testLighting(IGameDef *gamedef)
                UASSERTEQ(int, n.getLight(LIGHTBANK_NIGHT, ndef->getLightingFlags(n)), 2);
                UASSERTEQ(int, n.getLight(LIGHTBANK_DAY, ndef->getLightingFlags(n)), 15);
        }
+       {
+               // Test that irrelevant param1 values are not clobbered.
+               MapNode n = map.getNode(v3s16(-10, 1, 0));
+               UASSERTEQ(int, n.getParam1(), 153);
+       }
 }