Andreas Kling
a9a1a5dfa9
AK: Add a test for iterating a HashTable during clear (should assert)
...
Ideally we should also verify that the assertion actually happens,
but we need some support in the TestSuite framework for that.
2019-08-02 09:25:35 +02:00
Andreas Kling
6560116b67
TestSuite: Hijack the ASSERT macros during unit tests.
...
Instead of aborting the program when we hit an assertion, just print a
message and keep going.
This allows us to write tests that provoke assertions on purpose.
2019-08-02 09:23:03 +02:00
Robin Burchell
41d2c674d7
AK: Add a new TestSuite.h from my own work, adapted to match the existing one a bit
...
This gives a few new features:
* benchmarks
* the ability to run individual testcases easily
* timing of tests
2019-07-16 11:03:38 +02:00
Andreas Kling
d9d13f2445
AK: Support case-insensitive HashMap<String, T>.
...
We achieve this by allowing you to specify custom traits for the key type.
For convenience, we also provide a CaseInsensitiveStringTraits for String.
2019-07-13 11:00:29 +02:00
Andreas Kling
2282e89d3f
AK: Use a SinglyLinkedList<T> as HashTable's bucket chain storage.
...
We were using a DoublyLinkedList<T> simply because it supported remove().
This patch consolidates the SinglyLinkedList iterators and adds remove().
2019-06-27 16:36:31 +02:00
Andreas Kling
516d736afe
AK: Consolidate iterators for HashTable and DoublyLinkedList respectively.
...
Get rid of the ConstIterator classes for these containers and use templated
FooIterator<T, ...> and FooIterator<const T, ...> helpers.
This makes the HashTable class a lot easier to read.
2019-06-27 15:57:49 +02:00