From f073e37d2f3463ce5e9b456d4509f8dd57e405f5 Mon Sep 17 00:00:00 2001 From: Jude Melton-Houghton Date: Wed, 12 Oct 2022 13:48:59 -0400 Subject: [PATCH] Test on-lighting node param1 in lighting test --- src/unittest/test_voxelalgorithms.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/unittest/test_voxelalgorithms.cpp b/src/unittest/test_voxelalgorithms.cpp index 6514d3713..767e9de31 100644 --- a/src/unittest/test_voxelalgorithms.cpp +++ b/src/unittest/test_voxelalgorithms.cpp @@ -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); + } }