summaryrefslogtreecommitdiff
path: root/tests/core/templates
AgeCommit message (Collapse)Author
2022-10-03Remove NO_THREADS fallback code, Godot 4 requires thread supportRémi Verschelde
This also removes `OS::can_use_threads` from the public API since it's always true.
2022-08-04Tests: Silence some intentional errorsRémi Verschelde
Also fix printing messages in ClassDB test.
2022-08-04Add unit tests for RID class.Sean Kim
2022-07-25Code quality: Fix header guards consistencyRémi Verschelde
Adds `header_guards.sh` bash script, used in CI to validate future changes. Can be run locally to fix invalid header guards.
2022-05-20Add a new HashSet templatereduz
* Intended to replace RBSet in most cases. * Optimized for iteration speed
2022-05-12Add a new HashMap implementationreduz
Adds a new, cleaned up, HashMap implementation. * Uses Robin Hood Hashing (https://en.wikipedia.org/wiki/Hash_table#Robin_Hood_hashing). * Keeps elements in a double linked list for simpler, ordered, iteration. * Allows keeping iterators for later use in removal (Unlike Map<>, it does not do much for performance vs keeping the key, but helps replace old code). * Uses a more modern C++ iterator API, deprecates the old one. * Supports custom allocator (in case there is a wish to use a paged one). This class aims to unify all the associative template usage and replace it by this one: * Map<> (whereas key order does not matter, which is 99% of cases) * HashMap<> * OrderedHashMap<> * OAHashMap<>
2022-04-07Remove unused legacy testsRémi Verschelde
They haven't been updated for years and still use the old MainLoop basic framework instead of the new doctest one. They're of dubious quality and best redone from scratch using the new framework.
2022-01-10`Array`: Relax `slice` bound checks to properly handle negative indicesRémi Verschelde
The same is done for `Vector` (and thus `Packed*Array`). `begin` and `end` can now take any value and will be clamped to `[-size(), size()]`. Negative values are a shorthand for indexing the array from the last element upward. `end` is given a default `INT_MAX` value (which will be clamped to `size()`) so that the `end` parameter can be omitted to go from `begin` to the max size of the array. This makes `slice` works similarly to numpy's and JavaScript's.
2022-01-05Add list initialization support for Vector & LocalVectorHaoyu Qiu
2022-01-03Update copyright statements to 2022Rémi Verschelde
Happy new year to the wonderful Godot community!
2021-12-07Merge pull request #35901 from nathanfranke/pool-byte-array-subarray-exclusiveRémi Verschelde
2021-11-30Don't return reference on copy assignment operatorsRémi Verschelde
We prefer to prevent using chained assignment (`T a = b = c = T();`) as this can lead to confusing code and subtle bugs. According to https://en.wikipedia.org/wiki/Assignment_operator_(C%2B%2B), C++ allows any arbitrary return type, so this is standard compliant. This could be re-assessed if/when we have an actual need for a behavior more akin to that of the C++ STL, for now this PR simply changes a handful of cases which were inconsistent with the rest of the codebase (`void` return type was already the most common case prior to this commit).
2021-11-26PackedByteArray, Array slice end exclusive, rename subarray to sliceNathan Franke
2021-11-23Rename `remove()` to `remove_at()` when removing by indexLightning_A
2021-11-07Move and organize tests into subfoldersAaron Franke