aboutsummaryrefslogtreecommitdiff
path: root/assets/manual_img/Bildschirmfoto_2016-09-17_10-04-12.png
diff options
context:
space:
mode:
authorGabriel PĂ©rez-Cerezo <gabriel@gpcf.eu>2018-02-21 19:58:45 +0100
committerorwell96 <orwell@bleipb.de>2018-02-21 20:03:34 +0100
commit481f6218a8b377a0826b7e080046b5a890702e12 (patch)
tree3baa24616afb8790eb16f882863241b9f7d91523 /assets/manual_img/Bildschirmfoto_2016-09-17_10-04-12.png
parent4c512f1dc5755efc7afd55b58078ec466442f648 (diff)
downloadadvtrains-481f6218a8b377a0826b7e080046b5a890702e12.tar.gz
advtrains-481f6218a8b377a0826b7e080046b5a890702e12.tar.bz2
advtrains-481f6218a8b377a0826b7e080046b5a890702e12.zip
Log certain events in a logfile in the world directory
(also fix the output of /at_sync_ndb)
Diffstat (limited to 'assets/manual_img/Bildschirmfoto_2016-09-17_10-04-12.png')
0 files changed, 0 insertions, 0 deletions
m">but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "test.h" #include "areastore.h" class TestAreaStore : public TestBase { public: TestAreaStore() { TestManager::registerTestModule(this); } const char *getName() { return "TestAreaStore"; } void runTests(IGameDef *gamedef); void genericStoreTest(AreaStore *store); void testVectorStore(); void testSpatialStore(); }; static TestAreaStore g_test_instance; void TestAreaStore::runTests(IGameDef *gamedef) { TEST(testVectorStore); #if USE_SPATIAL TEST(testSpatialStore); #endif } //////////////////////////////////////////////////////////////////////////////// void TestAreaStore::testVectorStore() { VectorAreaStore store; genericStoreTest(&store); } void TestAreaStore::testSpatialStore() { #if USE_SPATIAL SpatialAreaStore store; genericStoreTest(&store); #endif } void TestAreaStore::genericStoreTest(AreaStore *store) { Area a(v3s16(-10, -3, 5), v3s16(0, 29, 7)); a.id = 1; Area b(v3s16(-5, -2, 5), v3s16(0, 28, 6)); b.id = 2; Area c(v3s16(-7, -3, 6), v3s16(-1, 27, 7)); c.id = 3; std::vector<Area *> res; UASSERTEQ(size_t, store->size(), 0); store->reserve(2); // sic store->insertArea(a); store->insertArea(b); store->insertArea(c); UASSERTEQ(size_t, store->size(), 3); store->getAreasForPos(&res, v3s16(-1, 0, 6)); UASSERTEQ(size_t, res.size(), 3); res.clear(); store->getAreasForPos(&res, v3s16(0, 0, 7)); UASSERTEQ(size_t, res.size(), 1); UASSERTEQ(u32, res[0]->id, 1); res.clear(); store->removeArea(1); store->getAreasForPos(&res, v3s16(0, 0, 7)); UASSERTEQ(size_t, res.size(), 0); res.clear(); store->insertArea(a); store->getAreasForPos(&res, v3s16(0, 0, 7)); UASSERTEQ(size_t, res.size(), 1); UASSERTEQ(u32, res[0]->id, 1); res.clear(); store->getAreasInArea(&res, v3s16(-10, -3, 5), v3s16(0, 29, 7), false); UASSERTEQ(size_t, res.size(), 3); res.clear(); store->getAreasInArea(&res, v3s16(-100, 0, 6), v3s16(200, 0, 6), false); UASSERTEQ(size_t, res.size(), 0); res.clear(); store->getAreasInArea(&res, v3s16(-100, 0, 6), v3s16(200, 0, 6), true); UASSERTEQ(size_t, res.size(), 3); res.clear(); store->removeArea(1); store->removeArea(2);