summaryrefslogtreecommitdiff
path: root/src/unittest
Commit message (Collapse)AuthorAge
* Switch MapBlock compression to zstd (#10788)lhofhansl2021-08-31
| | | | | | | * Add zstd support. * Rearrange serialization order * Compress entire mapblock Co-authored-by: sfan5 <sfan5@live.de>
* Rework Settings to support arbitrary hierarchies (#11352)sfan52021-06-23
|
* Fix base64 validation and add unittests (#10515)Lars Müller2021-05-30
| | | Implement proper padding character checks
* fix: some code tidy about includes & irr namespacesLoic Blot2021-05-03
|
* refacto: don't use RenderingEngine singleton on CAOLoic Blot2021-05-03
| | | | | | * we don't need on CAO side more than SceneManager, and temporary. Pass only required SceneManager as a parameter to build CAO and add them to the current scene * Use temporary the RenderingEngine singleton from ClientEnvironment, waitfor for better solution * Make ClientActiveObject::addToScene virtual function mandatory to be defined by children to ensure we don't forget to properly define it
* Schematic: Properly deal with before/after node resolving and document (#11011)SmallJoker2021-03-20
| | | | This fixes an out-of-bounds index access when the node resolver was already applied to the schematic (i.e. biome decoration). Also improves the handling of the two cases: prior node resolving (m_nodenames), and after node resolving (manual lookup)
* Encode high codepoints as surrogates to safely transport wchar_t over networksfan52021-02-02
| | | | fixes #7643
* Drop wide/narrow conversion functionssfan52021-02-02
| | | | | | | | | The only valid usecase for these is interfacing with OS APIs that want a locale/OS-specific multibyte encoding. But they weren't used for that anywhere, instead UTF-8 is pretty much assumed when it comes to that. Since these are only a potential source of bugs and do not fulfil their purpose at all, drop them entirely.
* Refactor utf8_to_wide/wide_to_utf8 functionssfan52021-02-02
|
* Rework use_texture_alpha to provide three opaque/clip/blend modessfan52021-01-29
| | | | | The change that turns nodeboxes and meshes opaque when possible is kept, as is the compatibility code that warns modders to adjust their nodedefs.
* Settings: Purge getDefault, clean FontEngineSmallJoker2021-01-29
|
* Settings: Proper priority hierarchySmallJoker2021-01-29
| | | | | | | | | | | Remove old defaults system Introduce priority-based fallback list Use new functions for map_meta special functions Change groups to use end tags Unittest changes: * Adapt unittest to the new code * Compare Settings objects
* Remove unused functions reported by cppcheck (#10463)SmallJoker2020-10-05
| | | | | | | Run unused functions reported by cppcheck This change removes a few (but not all) unused functions. Some unused helper functions were not removed due to their complexity and potential of future use.
* (se)SerializeString: Include max length in the nameSmallJoker2020-10-01
| | | | | | | This commit clarifies the maximal length of the serialized strings. It will avoid accidental use of serializeString() when a larger string can be expected. Removes unused Wide String serialization functions
* Clean up serializationSmallJoker2020-10-01
| | | | | | | | This reverts 1a5b4b3 and further functions in serialize.cpp that are unused The intend for a sane NetworkPacket/stream replacement was good, but a wrapper class around i/ostream might be more versatile than introducing a new vector-based serialization class.
* Settings: Fix unittest memory leak, change input typesSmallJoker2020-09-22
|
* Remove Thread::kill() and related unittest (#10317)Sebastien Marie2020-09-10
| | | | Closes: #6065
* Load media from subfolders (#9065)DS2020-08-20
|
* TestBan: Clean up properly after completing test (#9994)ANAND2020-06-05
|
* Rename “Minimal development test” to “Development Test” (#9928)Wuzzy2020-05-26
|
* Allow ObjDefManager instances to be clonedsfan52020-05-05
|
* Optimize get_objects_inside_radius calls (#9671)Loïc Blot2020-04-16
| | | | | | | | | * Optimize getObjectsInsideRadius calls our previous implementation calls the ActiveObjectMgr to return ids and then lookup those ids in the same map and test each object Instead now we call the global map to return the pointers directly and we ask filtering when building the list using lamba. This drop double looping over ranges of active objects (and then filtered one) and drop x lookups on the map regarding the first call results
* Drop content_sao.{cpp,h}Loic Blot2020-04-11
| | | | | | | Move LuaEntitySAO to a new dedicated file Drop TestSAO (useless object) Drop the old static startup initialized SAO factory, which was pretty useless. This factory was using a std::map for 2 elements, now just use a simple condition owned by ServerEnvironment, which will be lightweight, that will also drop a one time useful test on each LuaEntitySAO creation. This should reduce server load on massive SAO creation
* Collision various fixes (#9343)TheTermos2020-04-08
|
* Add limit parameter to decompressZlibBen Deutsch2020-02-01
| | | | | This can prevent untrusted data, such as sent over the network, from consuming all memory with a specially crafted payload.
* Settings: Add get_flags API for mapgen flags (mg_flags, mgv6_spflags, ...) ↵SmallJoker2020-01-25
| | | | | | | | | | | (#9284) Unified flags handling in C++ and Lua Settings API -> Reading only, for now. Writing can be implemented later, if needed. API function to read the currently active flags -> was impossible from Lua Co-authored-by: Wuzzy <wuzzy2@mail.ru>
* StaticText/EnrichedString: Styling support (#9187)SmallJoker2020-01-22
| | | | | | | | * StaticText/EnrichedString: Styling support * Fix tooltip fg/bgcolor * Fix default color for substr(), add unittests
* Fix AreaStore's IDs persistence (#8888)SmallJoker2019-09-21
| | | | | Improve documentation Read old formats Fix free ID function. Return first gap in map
* Inventory: Send dirty lists where appropriate (#8742)SmallJoker2019-08-24
| | | | | This change reduces the amount of sent data towards clients. Inventory lists that are already known to the player are skipped, saving quite some data over time. Raises protocol version to 38 to ensure correct backwards-compatible code.
* Fix compare between pointer and 0 in unittestsJozef Behran2019-08-13
| | | | | | Pointers shall be set to nullptr, not 0, according to the coding standards. By implication they shall be compared with nullptr, not 0, too. Fix this code to match that.
* Optimize string (mis)handling (#8128)Jozef Behran2019-05-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Optimize statbar drawing The texture name of the statbar is a string passed by value. That slows down the client and creates litter in the heap as the content of the string is allocated there. Convert the offending parameter to a const reference to avoid the performance hit. * Optimize texture cache There is an unnecessary temporary created when the texture path is being generated. This slows down the cache each time a new texture is encountered and it needs to be loaded into the cache. Additionally, the heap litter created by this unnecessary temporary is particularly troublesome here as the following code then piles another string (the resulting full path of the texture) on top of it, followed by the texture itself, which both are quite long term objects as they are subsequently inserted into the cache where they can remain for quite a while (especially if the texture turns out to be a common one like dirt, grass or stone). Use std::string.append to get rid of the temporary which solves both issues (speed and heap fragmentation). * Optimize animations in client Each time an animated node is updated, an unnecessary copy of the texture name is created, littering the heap with lots of fragments. This can be specifically troublesome when looking at oceans or large lava lakes as both of these nodes are usually animated (the lava animation is pretty visible). Convert the parameter of GenericCAO::updateTextures to a const reference to get rid of the unnecessary copy. There is a comment stating "std::string copy is mandatory as mod can be a class member and there is a swap on those class members ... do NOT pass by reference", reinforcing the belief that the unnecessary copy is in fact necessary. However one of the first things the code of the method does is to assign the parameter to its class member, creating another copy. By rearranging the code a little bit this "another copy" can then be used by the subsequent code, getting rid of the need to pass the parameter by value and thus saving that copying effort. * Optimize chat console history handling The GUIChatConsole::replaceAndAddToHistory was getting the line to work on by value which turns out to be unnecessary. Get rid of that unnecessary copy by converting the parameter to a const reference. * Optimize gui texture setting The code used to set the texture for GUI components was getting the name of the texture by value, creating unnecessary performance bottleneck for mods/games with heavily textured GUIs. Get rid of the bottleneck by passing the texture name as a const reference. * Optimize sound playing code in GUIEngine The GUIEngine's code receives the specification of the sound to be played by value, which turns out to be most likely a mistake as the underlying sound manager interface receives the same thing by reference. Convert the offending parameter to a const reference to get rid of the rather bulky copying effort and the associated performance hit. * Silence CLANG TIDY warnings for unit tests Change "std::string" to "const std::string &" to avoid an unnecessary local value copy, silencing the CLANG TIDY process. * Optimize formspec handling The "formspec prepend" parameter was passed to the formspec handling code by value, creating unnecessary copy of std::string and slowing down the game if mods add things like textured backgrounds for the player inventory and/or other forms. Get rid of that performance bottleneck by converting the parameter to a const reference. * Optimize hotbar image handling The code that sets the background images for the hotbar is getting the name of the image by value, creating an unnecessary std::string copying effort. Fix that by converting the relevant parameters to const references. * Optimize inventory deserialization The inventory manager deserialization code gets the serialized version of the inventory by value, slowing the server and the client down when there are inventory updates. This can get particularly troublesome with pipeworks which adds nodes that can mess around with inventories automatically or with mods that have mobs with inventories that actively use them. * Optimize texture scaling cache There is an io::path parameter passed by value in the procedure used to add images converted from textures, leading to slowdown when the image is not yet created and the conversion is thus needed. The performance hit is quite significant as io::path is similar to std::string so convert the parameter to a const reference to get rid of it. * Optimize translation file loader Use "std::string::append" when calculating the final index for the translation table to avoid unnecessary temporary strings. This speeds the translation file loader up significantly as std::string uses heap allocation which tends to be rather slow. Additionally, the heap is no longer being littered by these unnecessary string temporaries, increasing performance of code that gets executed after the translation file loader finishes. * Optimize server map saving When the directory structure for the world data is created during server map saving, an unnecessary value passing of the directory name slows things down. Remove that overhead by converting the offending parameter to a const reference.
* Add Irrlicht-specific smart pointer (#6814)Vitaliy2019-04-12
|
* LINT fixLoïc Blot2019-02-15
|
* Fix Address::isLocalhost algorithmLoic Blot2019-02-09
|
* Use true pitch/yaw/roll rotations without loss of precision by pgimeno (#8019)Paul Ouellette2019-02-07
| | | | | Store the rotation in the node as a 4x4 transformation matrix internally (through IDummyTransformationSceneNode), which allows more manipulations without losing precision or having gimbal lock issues. Network rotation is still transmitted as Eulers, though, not as matrix. But it will stay this way in 5.0.
* Proselytize the network. Use IEEE F32 (#8030)SmallJoker2019-01-03
| | | | | * Proselytize the network. Use IEEE F32 * Remove unused V2F1000 functions
* Fix the part of the float test that requires IEC559/IEEE754 compliancePedro Gimeno2018-12-18
| | | | GCC and CLang compilers fail to support full IEC559 compliance required for the test, when certain compiler flags are active. This patch implements a heuristic that checks for the most common flag in GCC and CLang, plues an extra check which GCC disables when it's not compliant, to hopefully catch most cases where it can't run.
* Add an activeobject manager to hold active objects (#7939)Loïc Blot2018-12-13
| | | | * Add an activeobject manager to hold active objects * Add unittests
* Network: Send IEEE floats (#7768)SmallJoker2018-12-13
|
* Add testWrapDegrees_0_360_v3f unittestsLoïc Blot2018-12-04
|
* Move client-specific files to 'src/client' (#7902)Quentin Bazin2018-11-28
| | | | | Update Android.mk Remove 'src/client' from include_directories
* Fix temporary path crash in TestAuthDatabase (#7753)SmallJoker2018-09-28
| | | The constructor of TestAuthDatabase was called immediately, at a time when the settings weren't initialized properly yet.
* Replace auth.txt with SQLite auth database (#7279)Ben Deutsch2018-08-05
| | | | * Replace auth.txt with SQLite auth database
* Add a MSVC / Windows compatible snprintf function (#7353)nOOb31672018-07-22
| | | Use sizeof where applicable for mt_snprintf
* Revert 6587 - Optimize entity-entity collision (#7539)lhofhansl2018-07-08
|
* Server: move shutdown parts to a specific shutdown state object (#7437)Loïc Blot2018-06-13
| | | | * Server: move shutdown parts to a specific shutdown state object
* LINT fixLoic Blot2018-05-29
|
* Fix GameUI flag value regression introduced by ↵Loic Blot2018-05-29
| | | | | | a78659ed0529226ad937f5e241ad72ba93702959 Added more strong unittests on that part to prevent future regression
* Fix i386 bit build at OpenBSD (#7259)mazocomp2018-04-21
|
* Add online content repositoryrubenwardy2018-04-19
| | | | Replaces mods and texture pack tabs with a single content tab