aboutsummaryrefslogtreecommitdiff
path: root/src/rollback_interface.h
Commit message (Expand)AuthorAge
* Code modernization: src/p*, src/q*, src/r*, src/s* (partial) (#6282)Loïc Blot2017-08-19
* C++ modernize: Pragma once (#6264)Loïc Blot2017-08-17
* Cpp11 patchset 11: continue working on constructor style migration (#6004)Loïc Blot2017-06-18
* Clean up rollbackShadowNinja2014-11-19
* Rollback fixes and get_node_actionsShadowNinja2013-11-27
* Update Copyright YearsSfan52013-02-24
* Change Minetest-c55 to MinetestPilzAdam2013-02-24
* Tweak rollback and liquidsPerttu Ahola2012-07-27
* Tweak rollback stuffPerttu Ahola2012-07-27
* Make the rollback system VERY FUCKING GOD DAMN POWERFULPerttu Ahola2012-07-27
* Experimental-ish rollback functionalityPerttu Ahola2012-07-27
pan class="hl com">*/ #include "test.h" #include <sstream> #include "gamedef.h" #include "nodedef.h" #include "network/networkprotocol.h" class TestNodeDef : public TestBase { public: TestNodeDef() { TestManager::registerTestModule(this); } const char *getName() { return "TestNodeDef"; } void runTests(IGameDef *gamedef); void testContentFeaturesSerialization(); }; static TestNodeDef g_test_instance; void TestNodeDef::runTests(IGameDef *gamedef) { TEST(testContentFeaturesSerialization); } //////////////////////////////////////////////////////////////////////////////// void TestNodeDef::testContentFeaturesSerialization() { ContentFeatures f; f.name = "default:stone"; for (int i = 0; i < 6; i++) f.tiledef[i].name = "default_stone.png"; f.is_ground_content = true; std::ostringstream os(std::ios::binary); f.serialize(os, LATEST_PROTOCOL_VERSION); //verbosestream<<"Test ContentFeatures size: "<<os.str().size()<<std::endl; std::istringstream is(os.str(), std::ios::binary); ContentFeatures f2; f2.deSerialize(is); UASSERT(f.walkable == f2.walkable); UASSERT(f.node_box.type == f2.node_box.type); }