Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
osjc authored and sfan5 committed Aug 13, 2019
1 parent 2f879e8 commit 833e60d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/unittest/test.cpp
Expand Up @@ -650,12 +650,12 @@ struct TestMapSector: public TestBase
// Create one with no heightmaps
ServerMapSector sector(&parent, v2s16(1,1));

UASSERT(sector.getBlockNoCreateNoEx(0) == 0);
UASSERT(sector.getBlockNoCreateNoEx(1) == 0);
UASSERT(sector.getBlockNoCreateNoEx(0) == nullptr);
UASSERT(sector.getBlockNoCreateNoEx(1) == nullptr);

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

UASSERT(sector.getBlockNoCreateNoEx(0) == 0);
UASSERT(sector.getBlockNoCreateNoEx(0) == nullptr);
UASSERT(sector.getBlockNoCreateNoEx(-2) == bref);

//TODO: Check for AlreadyExistsException
Expand Down

0 comments on commit 833e60d

Please sign in to comment.