aboutsummaryrefslogtreecommitdiff
path: root/src/unittest
diff options
context:
space:
mode:
authorVincent Glize <vincentglize@hotmail.fr>2017-06-19 23:54:58 +0200
committerLoïc Blot <nerzhul@users.noreply.github.com>2017-06-19 23:54:58 +0200
commit4a5e8ad343079f6552fab639770e5771ed7c4e7a (patch)
treeeeab3adec1fc3e7a3b06d9f53b92ab99a5e0d290 /src/unittest
parent4a789490834157baa8788a2f36c95b86c1e4440e (diff)
downloadminetest-4a5e8ad343079f6552fab639770e5771ed7c4e7a.tar.gz
minetest-4a5e8ad343079f6552fab639770e5771ed7c4e7a.tar.bz2
minetest-4a5e8ad343079f6552fab639770e5771ed7c4e7a.zip
C++11 cleanup on constructors (#6000)
* C++11 cleanup on constructors dir script
Diffstat (limited to 'src/unittest')
-rw-r--r--src/unittest/test.cpp20
-rw-r--r--src/unittest/test_connection.cpp11
2 files changed, 13 insertions, 18 deletions
diff --git a/src/unittest/test.cpp b/src/unittest/test.cpp
index 570807ba7..911b647f7 100644
--- a/src/unittest/test.cpp
+++ b/src/unittest/test.cpp
@@ -70,16 +70,16 @@ public:
virtual void unregisterModStorage(const std::string &name) {}
private:
- IItemDefManager *m_itemdef;
- INodeDefManager *m_nodedef;
- ICraftDefManager *m_craftdef;
- ITextureSource *m_texturesrc;
- IShaderSource *m_shadersrc;
- ISoundManager *m_soundmgr;
- MtEventManager *m_eventmgr;
- scene::ISceneManager *m_scenemgr;
- IRollbackManager *m_rollbackmgr;
- EmergeManager *m_emergemgr;
+ IItemDefManager *m_itemdef = nullptr;
+ INodeDefManager *m_nodedef = nullptr;
+ ICraftDefManager *m_craftdef = nullptr;
+ 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;
};
diff --git a/src/unittest/test_connection.cpp b/src/unittest/test_connection.cpp
index d63322d69..3ea3d7444 100644
--- a/src/unittest/test_connection.cpp
+++ b/src/unittest/test_connection.cpp
@@ -53,12 +53,7 @@ void TestConnection::runTests(IGameDef *gamedef)
struct Handler : public con::PeerHandler
{
- Handler(const char *a_name)
- {
- count = 0;
- last_id = 0;
- name = a_name;
- }
+ Handler(const char *a_name) : name(a_name) {}
void peerAdded(con::Peer *peer)
{
@@ -76,8 +71,8 @@ struct Handler : public con::PeerHandler
count--;
}
- s32 count;
- u16 last_id;
+ s32 count = 0;
+ u16 last_id = 0;
const char *name;
};