aboutsummaryrefslogtreecommitdiff
path: root/src/unittest (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Fix media overriding regression (#12602)Lars Müller2022-07-291-0/+8
|
* Re-order sound-related code (#12382)SmallJoker2022-06-201-1/+1
| | | | | | | | Dropped ServerSoundParams -> moved to ServerPlayingSound. This gets rid of the duplicated 'fade' and 'pitch' values on server-side where only one was used anyway. SimpleSoundSpec is the basic sound without positional information, hence 'loop' is included. Recursively added PROTOCOL_VERSION to most functions to reduce the versioning mess in the future. Per-type version numbers are kept for now as a safety rope in a special case.
* fix integer overflow in mapgen (#11641)JosiahWI2022-06-031-0/+54
| | | | | | | | | | | | | | | | | | | | * fix integer overflow in mapgen Some calculations involving the magic seed had overflow because the result of an intermediate arithmetic step could not fit in an s32. By making the magic seed unsigned, the other operand in the equation will be cast to unsigned, and possibly other operands or intermediate operands. This will result in unexpected behavior if an operand is negative, which is technically possible, but logically should not happen. * comment noise2d bitshift While working through the code I was momentarily concerned that the right bitshift in noise2d could fill ones in some cases. It turns out that with signed integers, this is indeed true, but this one is shifting an unsigned integer, so the behavior is as expected. I put a comment here to clarify this, in case someone else wonders the same thing down the line. * noise2d and noise3d unittests I have added 3 tests each for noise2d and noise3d, testing all zero inputs, a very large seed (case which caused UB in the old implementation) and some fun primes I picked for no particular reason. This should be sufficient to demonstrate that the behavior of the new implementation has not changed. I used uniform initialization because it is a good feature of C++11. Please do not explode. * uncomment the noise2d bitshift This reverts commit 583b77ee9f1ad6bb77340ebb5ba51eb9a88ff51c. It's a well-defined language semantic; it doesn't need to be commented. * code cleanliness
* Replace all uses of core::list with std::list (#12313)paradust72022-05-221-2/+2
|
* Improve testSerializeJsonString unit testssfan52022-05-212-18/+62
| | | | | this also removes the requirement that / is escaped, there is no reason for doing so.
* Use std::map instead of core::map (#12301)paradust72022-05-181-3/+3
|
* Don't test overflow behavior for VoxelArea extentsShadowNinja2022-04-081-2/+2
|
* Remove duplicate test for trimShadowNinja2022-04-081-11/+2
|
* Update directory name sanitizationShadowNinja2022-04-081-4/+8
| | | | | Only ASCII spaces have to be handles specially, and leading spaces are also disallowed.
* Add tests for sanitizeDirNameShadowNinja2022-04-081-0/+11
|
* Fix compiler warningsShadowNinja2022-04-082-3/+5
|
* Compile Lua as C++ (#11683)Jude Melton-Houghton2022-04-072-0/+80
| | | Co-authored-by: sfan5 <sfan5@live.de>
* Move the codebase to C++14sfan52022-02-263-6/+4
|
* Get rid of empty test filesfan52022-01-302-40/+0
|
* Raise max mapgen limit constant to align with mapblock sizesfan52022-01-302-0/+69
|
* Use a database for mod storage (#11763)Jude Melton-Houghton2022-01-073-1/+259
|
* Socket-related cleanupssfan52021-12-291-10/+8
| | | Improve error handling on Windows and reduce the size of the `Address` class
* Fix various code & correctness issues (#11815)sfan52021-12-052-24/+20
|
* Network: Delete copy constructor and use std::move instead (#11642)SmallJoker2021-12-011-5/+5
| | | This is a follow-up change which disables class copies where possible to avoid unnecessary memory movements.
* Fix find_nodes_in_area misbehaving with out-of-map coordinates (#11770)sfan52021-11-261-2/+16
| | | This ensures that no overflows (side-effects) happen within the find_nodes_in_area function by limiting coordinates like done in the map generation code.
* Localize error messages in mainmenu (#11495)Riceball LEE2021-11-012-0/+48
| | | | Co-authored-by: sfan5 <sfan5@live.de> Co-authored-by: rubenwardy <rw@rubenwardy.com>
* Add "MINETEST_MOD_PATH" environment variable (#11515)emixa-d2021-10-075-0/+26
| | | | This adds an environment variable MINETEST_MOD_PATH. When it exists, Minetest will look there for mods in addition to ~/.minetest/mods/.
* Shave off buffer copies in networking code (#11607)sfan52021-09-171-6/+6
|
* Hide Wself-assign-overloaded and Wself-move unittest compilation warningsHybridDog2021-09-171-0/+10
| | | | The warnings occured with the clang compiler
* Make sure relevant std::stringstreams are set to binarysfan52021-09-111-2/+2
|
* Switch MapBlock compression to zstd (#10788)lhofhansl2021-08-311-2/+40
| | | | | | | * 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-231-0/+5
|
* Fix base64 validation and add unittests (#10515)Lars Müller2021-05-301-0/+93
| | | Implement proper padding character checks
* fix: some code tidy about includes & irr namespacesLoic Blot2021-05-031-1/+1
|
* refacto: don't use RenderingEngine singleton on CAOLoic Blot2021-05-031-0/+1
| | | | | | * 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-202-17/+25
| | | | 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-021-0/+35
| | | | fixes #7643
* Drop wide/narrow conversion functionssfan52021-02-021-2/+2
| | | | | | | | | 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-021-3/+12
|
* Rework use_texture_alpha to provide three opaque/clip/blend modessfan52021-01-291-2/+2
| | | | | 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-291-1/+1
|
* Settings: Proper priority hierarchySmallJoker2021-01-292-42/+117
| | | | | | | | | | | 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-051-26/+2
| | | | | | | 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-011-28/+22
| | | | | | | 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-011-324/+0
| | | | | | | | 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-221-9/+9
|
* Remove Thread::kill() and related unittest (#10317)Sebastien Marie2020-09-101-25/+0
| | | | Closes: #6065
* Load media from subfolders (#9065)DS2020-08-201-2/+0
|
* TestBan: Clean up properly after completing test (#9994)ANAND2020-06-051-0/+3
|
* Rename “Minimal development test” to “Development Test” (#9928)Wuzzy2020-05-262-6/+6
|
* Allow ObjDefManager instances to be clonedsfan52020-05-051-4/+72
|
* Optimize get_objects_inside_radius calls (#9671)Loïc Blot2020-04-161-3/+15
| | | | | | | | | * 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-111-1/+0
| | | | | | | 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-081-32/+32
|
* Add limit parameter to decompressZlibBen Deutsch2020-02-011-0/+63
| | | | | This can prevent untrusted data, such as sent over the network, from consuming all memory with a specially crafted payload.