Commit Graph

222 Commits

Author SHA1 Message Date
sfan5 178943b4b7 Improve ServerEnvironment::getRemovedActiveObjects() in many ways 2024-03-20 16:37:32 +01:00
sfan5 e3b9828f24 Add unit tests for SAO load / unload behaviour 2024-03-17 15:55:24 +01:00
SmallJoker 61a5733692 Unittest: Add inventory callback tests 2024-03-16 20:14:05 +01:00
sfan5 492aab20fe Fix compiler warnings 2024-02-24 12:39:12 +01:00
numzero 0d30a3071a Add meshgen tests 2024-02-22 15:45:17 +00:00
numzero 753f03ff6a Add mesh comparison functions, for tests 2024-02-22 15:45:17 +00:00
sfan5 6ca214fefc
Introduce `std::string_view` into wider use (#14368) 2024-02-17 15:35:33 +01:00
cx384 7901087466
Rename `MINETEST_SUBGAME_PATH` to `MINETEST_GAME_PATH` (#14351) 2024-02-12 23:21:19 +01:00
cx384 adaa4cc2f3
Move hard coded minimap to builtin (#14071) 2024-02-07 20:13:23 +01:00
sfan5 c9e10e1dd9 Drop valgrind from CI and instead enable ASan
The recently added ioctl use is reported as a false-positive by valgrind.
I tried moving it to different compilers/versions two times and only
hit further issues that were valgrind's fault.

Also includes a tiny fix.
2024-02-04 21:23:05 +01:00
sfan5 714c9361ea Add unit tests for fs::CopyFileContents 2024-02-04 21:23:05 +01:00
sfan5 5dbc1d4c08 Move some files to src/server/ 2024-01-27 10:33:32 +01:00
sfan5 8cbd629010
Fix bugs in ModifySafeMap (#14276) 2024-01-20 15:37:30 +01:00
sfan5 abf3142b26 Send initial dummy packet as empty
No functional change and no compatibility implicatons
but this better matches what is documented everywhere.
2024-01-17 20:05:57 +01:00
sfan5 2587302987 Assign peer IDs randomly 2024-01-17 20:05:57 +01:00
sfence ceaa7e2fb0
Add API for restoring PseudoRandom and PcgRandom state (#14123) 2024-01-16 23:20:52 +01:00
sfan5 e824e9023f Simplify LuaPseudoRandom::l_next and fix docs
Also extends the allowed range on the C++ side. This has no side-effects.
2024-01-14 13:17:53 +01:00
sfan5 e83530d40b Use explicit types on PseudoRandom implementation 2024-01-14 13:17:53 +01:00
sfan5 6f494a968d Move setenv compat code to porting.h 2024-01-14 13:17:53 +01:00
sfan5 133f706bf3 Make unittests less reliant on files in the source distribution 2024-01-14 13:17:53 +01:00
sfan5 863c9b55b4 Remove broken MINETEST_SUBGAME_PATH test
The path being tested for is in the default search path for games,
so it would still pass if the env var was not working.
2024-01-14 13:17:53 +01:00
sfan5 45561b89a4 Make sure unittests don't try to write to cwd 2024-01-14 13:17:53 +01:00
sfan5 dc7fb26921 Extend capabilities of Address class 2024-01-07 21:49:05 +01:00
sfan5 3fbe42c3a2 Add unittest to check thread_local destructor brokenness 2024-01-06 15:38:09 +01:00
SmallJoker 94a54375e2
Inventory: prevent item loss when stacking oversized ItemStacks (#14072) 2023-12-15 10:24:04 +01:00
Vitaliy 64b59184d1
Reduce test framework macrosity 2023-12-15 10:23:32 +01:00
Gary Miguel 6eb9269741
Try to fix safeWriteToFile producing empty files on Windows (#14085)
Use win32 APIs to write the temporary file before copying to the final
destination. Because we've observed the final file being empty, we
suspect that std::ostream::flush is not flushing.

Also add a test for it.
2023-12-13 13:15:37 +01:00
Nils Dagsson Moskopp 2025dcffbd Revert "Don't trigger a key event if a key with the same associated char was pressed (#13773)"
This partially reverts commit d57c936b08.

The reverted commit prevented recognition of key combinations.
It correctly changed a test case to no longer use “KEY_NUMPAD_5”.

Several keyboard layouts use a key combination to input a “+” (e.g. Neo2);
therefore some users could no longer input “+” to increase the view range.

Co-authored-by: savilli <78875209+savilli@users.noreply.github.com>
2023-10-30 21:23:59 +01:00
DS 11ec75c2ad
ActiveObjectMgr fixes (#13560) 2023-10-09 17:13:04 +02:00
savilli d57c936b08
Don't trigger a key event if a key with the same associated char was pressed (#13773) 2023-09-22 21:25:13 +02:00
numzero 21035bf5d4 Add unit test on client::ActiveObjectMgr::getActiveSelectableObjects 2023-06-29 18:58:10 +02:00
sfan5 442d5fc75c Add unit tests for isBlockInSight() 2023-06-26 22:51:49 +02:00
Vitaliy 2f6a9d12f1
Allow running individual unit tests 2023-06-25 11:13:48 +02:00
sfan5 84fb663d6c Add VoxelArea::intersect() 2023-06-23 09:05:26 +02:00
Desour f947e2afec Fix some gcc -Wself-move warnings 2023-06-15 13:55:20 +02:00
Thresher 00c647e4cc
Convert spaces to tabs (#13506)
* Convert spaces to tabs

* Desour reviews 1-3 fix

* Desour fixes

* Undo alignment changes
2023-05-26 15:13:57 +02:00
Thresher 180ec92ef9
Remove trailing whitespace (#13505) 2023-05-18 20:34:18 +02:00
Desour 8b73743baa Reduce number of recursively included headers
This should improve compilation speed.

Things changed:
* Prefer forward-declarations in headers.
* Move header-includes out of headers if possible.
* Move some functions definitions out of headers.
* Put some member variables into unique_ptrs (see Client).
2023-04-27 18:50:33 +02:00
Desour 50e91b882c Add some simple unittests for shapeless recipes
Note: devtest also has craft unittests (see devtest/mods/unittests/crafting.lua),
      but those aren't run at load-time.
2023-04-14 21:10:09 +02:00
Jude Melton-Houghton 5f2925c59c
Increase `ftos` precision (#13141) 2023-01-12 14:12:31 -05:00
Jude Melton-Houghton 7c21347a40 Rename "mod metadata" to "mod storage" everywhere 2022-11-24 17:58:25 -05:00
Jude Melton-Houghton cd8a7fe472
Add MetaDataRef:get_keys (#12841) 2022-11-15 16:45:12 +01:00
Jude Melton-Houghton aaa05f901a Add mod storage PostgreSQL backend 2022-11-10 18:56:48 +01:00
Jude Melton-Houghton 9dbac989bd Improve testListMods 2022-11-10 18:56:48 +01:00
Abdou-31 d1b80b462e
Fix typos and en_US/en_GB inconsistency in various files (#12902) 2022-11-09 11:57:19 -05:00
Jude Melton-Houghton cb725a4555 Speed up find_nodes_in_area (#12845) 2022-10-13 09:35:19 -04:00
Jude Melton-Houghton f073e37d2f Test on-lighting node param1 in lighting test 2022-10-13 08:46:16 -04:00
Jude Melton-Houghton 9676364c1f
Optimize lighting calculation (#12797) 2022-10-09 10:50:26 -04:00
savilli 907dcdcf7b
Add unittests for item movement code (#11885) 2022-09-27 16:22:11 -04:00
Jude Melton-Houghton f4a01f3a5d
Avoid duplication of mod metadata in memory (#12562)
Co-authored-by: sfan5 <sfan5@live.de>
2022-09-26 17:03:43 -04:00