From: Jozef Behran Date: Tue, 13 Aug 2019 12:26:37 +0000 (+0200) Subject: Fix compare between pointer and 0 in unittests X-Git-Tag: 5.1.0~108 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=833e60d8d229a082e9841dc89494e6bda9cd5020;p=oweals%2Fminetest.git 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. --- diff --git a/src/unittest/test.cpp b/src/unittest/test.cpp index 3ac8ffb19..a783ccd32 100644 --- a/src/unittest/test.cpp +++ b/src/unittest/test.cpp @@ -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