]> git.lizzy.rs Git - minetest.git/blobdiff - src/test.cpp
Fix a crash (assert) when client set serial version < 24 in INIT
[minetest.git] / src / test.cpp
index fa18989e5dd1b5745cb59945b056f4d58fca9378..80494e07a4351bfd42295572ed843ede9c2ef486 100644 (file)
@@ -59,7 +59,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define UTEST(x, fmt, ...)\
 {\
        if(!(x)){\
-               LOGLINEF(LMT_ERROR, "Test (%s) failed: " fmt, #x, ##__VA_ARGS__);\
+               dstream << "Test (" #x ") failed: " fmt << std::endl; \
                test_failed = true;\
        }\
 }
@@ -189,7 +189,7 @@ struct TestUtilities: public TestBase
                str_replace(test_str, "there", "world");
                UASSERT(test_str == "Hello world");
                test_str = "ThisAisAaAtest";
-               str_replace_char(test_str, 'A', ' ');
+               str_replace(test_str, 'A', ' ');
                UASSERT(test_str == "This is a test");
                UASSERT(string_allowed("hello", "abcdefghijklmno") == true);
                UASSERT(string_allowed("123", "abcdefghijklmno") == false);
@@ -273,8 +273,8 @@ struct TestPath: public TestBase
                                expected fs::PathStartsWith results
                                0 = returns false
                                1 = returns true
-                               2 = returns false on windows, false elsewhere
-                               3 = returns true on windows, true elsewhere
+                               2 = returns false on windows, true elsewhere
+                               3 = returns true on windows, false elsewhere
                                4 = returns true if and only if
                                    FILESYS_CASE_INSENSITIVE is true
                        */
@@ -855,9 +855,8 @@ struct TestMapNode: public TestBase
 {
        void Run(INodeDefManager *nodedef)
        {
-               MapNode n;
+               MapNode n(CONTENT_AIR);
 
-               // Default values
                UASSERT(n.getContent() == CONTENT_AIR);
                UASSERT(n.getLight(LIGHTBANK_DAY, nodedef) == 0);
                UASSERT(n.getLight(LIGHTBANK_NIGHT, nodedef) == 0);