diff options
author | Loïc Blot <nerzhul@users.noreply.github.com> | 2017-08-20 13:30:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-20 13:30:50 +0200 |
commit | 1c1c97cbd1d7913ac12bf550ec02c97f843a0fd3 (patch) | |
tree | 03dd0c39e323c7f0b1f06014ff30e74f429bfa01 /src/unittest/test.cpp | |
parent | 50669cd2822a11570ae462972194eeb2d585a8c1 (diff) | |
download | minetest-1c1c97cbd1d7913ac12bf550ec02c97f843a0fd3.tar.gz minetest-1c1c97cbd1d7913ac12bf550ec02c97f843a0fd3.tar.bz2 minetest-1c1c97cbd1d7913ac12bf550ec02c97f843a0fd3.zip |
Modernize source code: last part (#6285)
* Modernize source code: last par
* Use empty when needed
* Use emplace_back instead of push_back when needed
* For range-based loops
* Initializers fixes
* constructors, destructors default
* c++ C stl includes
Diffstat (limited to 'src/unittest/test.cpp')
-rw-r--r-- | src/unittest/test.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/unittest/test.cpp b/src/unittest/test.cpp index b52189cb4..615ec2162 100644 --- a/src/unittest/test.cpp +++ b/src/unittest/test.cpp @@ -120,8 +120,8 @@ void TestGameDef::defineSomeNodes() "{default_stone.png"; f = ContentFeatures(); f.name = itemdef.name; - for(int i = 0; i < 6; i++) - f.tiledef[i].name = "default_stone.png"; + for (TileDef &tiledef : f.tiledef) + tiledef.name = "default_stone.png"; f.is_ground_content = true; idef->registerItem(itemdef); t_CONTENT_STONE = ndef->set(f.name, f); @@ -175,8 +175,8 @@ void TestGameDef::defineSomeNodes() f.liquid_viscosity = 4; f.is_ground_content = true; f.groups["liquids"] = 3; - for(int i = 0; i < 6; i++) - f.tiledef[i].name = "default_water.png"; + for (TileDef &tiledef : f.tiledef) + tiledef.name = "default_water.png"; idef->registerItem(itemdef); t_CONTENT_WATER = ndef->set(f.name, f); @@ -197,8 +197,8 @@ void TestGameDef::defineSomeNodes() f.light_source = LIGHT_MAX-1; f.is_ground_content = true; f.groups["liquids"] = 3; - for(int i = 0; i < 6; i++) - f.tiledef[i].name = "default_lava.png"; + for (TileDef &tiledef : f.tiledef) + tiledef.name = "default_lava.png"; idef->registerItem(itemdef); t_CONTENT_LAVA = ndef->set(f.name, f); @@ -215,8 +215,8 @@ void TestGameDef::defineSomeNodes() "{default_brick.png"; f = ContentFeatures(); f.name = itemdef.name; - for(int i = 0; i < 6; i++) - f.tiledef[i].name = "default_brick.png"; + for (TileDef &tiledef : f.tiledef) + tiledef.name = "default_brick.png"; f.is_ground_content = true; idef->registerItem(itemdef); t_CONTENT_BRICK = ndef->set(f.name, f); |