Translated using Weblate (Russian)
[oweals/minetest.git] / src / unittest / test.cpp
index 150bddc567ff2fa8637d5724921fb03b5a6896bf..a783ccd3293d7cbea5c6a06f8c8ae4a4f3465dda 100644 (file)
@@ -19,12 +19,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 #include "test.h"
 
+#include "client/sound.h"
 #include "nodedef.h"
 #include "itemdef.h"
 #include "gamedef.h"
 #include "modchannels.h"
-#include "mods.h"
+#include "content/mods.h"
 #include "util/numeric.h"
+#include "porting.h"
 
 content_t t_CONTENT_STONE;
 content_t t_CONTENT_GRASS;
@@ -50,7 +52,6 @@ public:
        ITextureSource *getTextureSource() { return m_texturesrc; }
        IShaderSource *getShaderSource() { return m_shadersrc; }
        ISoundManager *getSoundManager() { return m_soundmgr; }
-       MtEventManager *getEventManager() { return m_eventmgr; }
        scene::ISceneManager *getSceneManager() { return m_scenemgr; }
        IRollbackManager *getRollbackManager() { return m_rollbackmgr; }
        EmergeManager *getEmergeManager() { return m_emergemgr; }
@@ -85,7 +86,6 @@ private:
        ITextureSource *m_texturesrc = nullptr;
        IShaderSource *m_shadersrc = nullptr;
        ISoundManager *m_soundmgr = nullptr;
-       MtEventManager *m_eventmgr = nullptr;
        scene::ISceneManager *m_scenemgr = nullptr;
        IRollbackManager *m_rollbackmgr = nullptr;
        EmergeManager *m_emergemgr = nullptr;
@@ -324,7 +324,7 @@ std::string TestBase::getTestTempDirectory()
                return m_test_dir;
 
        char buf[32];
-       snprintf(buf, sizeof(buf), "%08X", myrand());
+       porting::mt_snprintf(buf, sizeof(buf), "%08X", myrand());
 
        m_test_dir = fs::TempPath() + DIR_DELIM "mttest_" + buf;
        if (!fs::CreateDir(m_test_dir))
@@ -336,7 +336,7 @@ std::string TestBase::getTestTempDirectory()
 std::string TestBase::getTestTempFile()
 {
        char buf[32];
-       snprintf(buf, sizeof(buf), "%08X", myrand());
+       porting::mt_snprintf(buf, sizeof(buf), "%08X", myrand());
 
        return getTestTempDirectory() + DIR_DELIM + buf + ".tmp";
 }
@@ -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