Skip to content

Commit 833e60d

Browse files
osjcsfan5
authored andcommittedAug 13, 2019
Fix compare between pointer and 0 in unittests
Pointers shall be set to nullptr, not 0, according to the coding standards. By implication they shall be compared with nullptr, not 0, too. Fix this code to match that.
1 parent 2f879e8 commit 833e60d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎src/unittest/test.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -650,12 +650,12 @@ struct TestMapSector: public TestBase
650650
// Create one with no heightmaps
651651
ServerMapSector sector(&parent, v2s16(1,1));
652652

653-
UASSERT(sector.getBlockNoCreateNoEx(0) == 0);
654-
UASSERT(sector.getBlockNoCreateNoEx(1) == 0);
653+
UASSERT(sector.getBlockNoCreateNoEx(0) == nullptr);
654+
UASSERT(sector.getBlockNoCreateNoEx(1) == nullptr);
655655

656656
MapBlock * bref = sector.createBlankBlock(-2);
657657

658-
UASSERT(sector.getBlockNoCreateNoEx(0) == 0);
658+
UASSERT(sector.getBlockNoCreateNoEx(0) == nullptr);
659659
UASSERT(sector.getBlockNoCreateNoEx(-2) == bref);
660660

661661
//TODO: Check for AlreadyExistsException

0 commit comments

Comments
 (0)
Please sign in to comment.