diff options
author | SmallJoker <mk939@ymail.com> | 2020-09-22 18:40:34 +0200 |
---|---|---|
committer | SmallJoker <mk939@ymail.com> | 2020-09-22 19:05:04 +0200 |
commit | add68369a59af90f8b4203b53695521c6d657d6b (patch) | |
tree | a0014dc120d08775be67410e820a283a986593be /src/unittest | |
parent | 55e2dd911b16a70ee976e067cf34a48922db9dcb (diff) | |
download | minetest-add68369a59af90f8b4203b53695521c6d657d6b.tar.gz minetest-add68369a59af90f8b4203b53695521c6d657d6b.tar.bz2 minetest-add68369a59af90f8b4203b53695521c6d657d6b.zip |
Settings: Fix unittest memory leak, change input types
Diffstat (limited to 'src/unittest')
-rw-r--r-- | src/unittest/test_settings.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/unittest/test_settings.cpp b/src/unittest/test_settings.cpp index aa56f3e06..f91ba5b67 100644 --- a/src/unittest/test_settings.cpp +++ b/src/unittest/test_settings.cpp @@ -149,15 +149,15 @@ void TestSettings::testAllSettings() UASSERT(group->getS16("a") == 5); UASSERT(fabs(group->getFloat("bb") - 2.5) < 0.001); - Settings *group3 = new Settings; - group3->set("cat", "meow"); - group3->set("dog", "woof"); - - Settings *group2 = new Settings; - group2->setS16("num_apples", 4); - group2->setS16("num_oranges", 53); - group2->setGroup("animals", group3); - group2->set("animals", "cute"); //destroys group 3 + Settings group3; + group3.set("cat", "meow"); + group3.set("dog", "woof"); + + Settings group2; + group2.setS16("num_apples", 4); + group2.setS16("num_oranges", 53); + group2.setGroup("animals", group3); + group2.set("animals", "cute"); //destroys group 3 s.setGroup("groupy_thing", group2); // Test set failure conditions |