X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Ftest.cpp;h=072bda8ef79ab63bd5abae70662328667918db68;hb=00fc0babe0c6c5464fa9ffbc5a257b1e2aa93111;hp=adae8ff572edec739f87fe2fa7d8929147dd7261;hpb=88c28414f4a88c8d66f9cadb150896f9e25527ae;p=oweals%2Fminetest.git diff --git a/src/test.cpp b/src/test.cpp index adae8ff57..072bda8ef 100644 --- a/src/test.cpp +++ b/src/test.cpp @@ -440,7 +440,7 @@ struct TestPath: public TestBase "some multiline text\n" \ " with leading whitespace!\n" \ "\"\"\"\n" \ - "np_terrain = 5, 40, (250, 250, 250), 12345, 5, 0.7\n" \ + "np_terrain = 5, 40, (250, 250, 250), 12341, 5, 0.7, 2.4\n" \ "zoop = true" #define TEST_CONFIG_TEXT_AFTER \ @@ -467,12 +467,12 @@ struct TestPath: public TestBase "\"\"\"\n" \ "np_terrain = {\n" \ " flags = defaults\n" \ - " lacunarity = 2\n" \ + " lacunarity = 2.4\n" \ " octaves = 6\n" \ " offset = 3.5\n" \ " persistence = 0.7\n" \ " scale = 40\n" \ - " seed = 12345\n" \ + " seed = 12341\n" \ " spread = (250,250,250)\n" \ "}\n" \ "zoop = true\n" \ @@ -531,9 +531,12 @@ struct TestSettings: public TestBase group2->setS16("num_oranges", 53); group2->setGroup("animals", group3); group2->set("animals", "cute"); //destroys group 3 + s.setGroup("groupy_thing", group2); - // the bad chars in here should be stripped - s.setGroup("groupy \"_\" thing", group2); + // Test set failure conditions + UASSERT(s.set("Zoop = Poop\nsome_other_setting", "false") == false); + UASSERT(s.set("sneaky", "\"\"\"\njabberwocky = false") == false); + UASSERT(s.set("hehe", "asdfasdf\n\"\"\"\nsomething = false") == false); // Test multiline settings UASSERT(group->get("ccc") == "testy\n testa "); @@ -552,7 +555,7 @@ struct TestSettings: public TestBase UASSERT(fabs(np.spread.X - 250) < 0.001); UASSERT(fabs(np.spread.Y - 250) < 0.001); UASSERT(fabs(np.spread.Z - 250) < 0.001); - UASSERT(np.seed == 12345); + UASSERT(np.seed == 12341); UASSERT(np.octaves == 5); UASSERT(fabs(np.persist - 0.7) < 0.001);