1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

Tests: Add NodeResolver unittests

Minor misc. NodeResolver cleanups
Prefix faux content type constants for testing with t_ to avoid
confusion or name collisions
This commit is contained in:
kwolekr 2015-05-05 11:36:40 -04:00
parent 1be2d32fd5
commit b45df9d6a7
8 changed files with 349 additions and 25 deletions

View file

@ -87,10 +87,10 @@ void TestVoxelManipulator::testVoxelManipulator(INodeDefManager *nodedef)
v.print(infostream, nodedef);
infostream << "*** Setting (-1,0,-1)=2 ***" << std::endl;
v.setNodeNoRef(v3s16(-1,0,-1), MapNode(CONTENT_GRASS));
v.setNodeNoRef(v3s16(-1,0,-1), MapNode(t_CONTENT_GRASS));
v.print(infostream, nodedef);
UASSERT(v.getNode(v3s16(-1,0,-1)).getContent() == CONTENT_GRASS);
UASSERT(v.getNode(v3s16(-1,0,-1)).getContent() == t_CONTENT_GRASS);
infostream << "*** Reading from inexistent (0,0,-1) ***" << std::endl;
@ -103,6 +103,6 @@ void TestVoxelManipulator::testVoxelManipulator(INodeDefManager *nodedef)
v.addArea(a);
v.print(infostream, nodedef);
UASSERT(v.getNode(v3s16(-1,0,-1)).getContent() == CONTENT_GRASS);
UASSERT(v.getNode(v3s16(-1,0,-1)).getContent() == t_CONTENT_GRASS);
EXCEPTION_CHECK(InvalidPositionException, v.getNode(v3s16(0,1,1)));
}