1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Add unittests on ActiveObject and BanManager class (#6866)

* Add unittests on ActiveObject and BanManager class

This also permit to fix a bug in ban manager setting bans modified when no modification occurs
This commit is contained in:
Loïc Blot 2018-01-01 18:48:52 +01:00 committed by GitHub
parent 9f6d84aee3
commit 0d6b58a772
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 231 additions and 1 deletions

View file

@ -1,6 +1,7 @@
/*
Minetest
Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
Copyright (C) 2018 nerzhul, Loic BLOT <loic.blot@unix-experience.fr>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -125,11 +126,11 @@ void BanManager::remove(const std::string &ip_or_name)
for (StringMap::iterator it = m_ips.begin(); it != m_ips.end();) {
if ((it->first == ip_or_name) || (it->second == ip_or_name)) {
m_ips.erase(it++);
m_modified = true;
} else {
++it;
}
}
m_modified = true;
}