serenity/AK/Tests
Tom 75f61fe3d9 AK: Make RefPtr, NonnullRefPtr, WeakPtr thread safe
This makes most operations thread safe, especially so that they
can safely be used in the Kernel. This includes obtaining a strong
reference from a weak reference, which now requires an explicit
call to WeakPtr::strong_ref(). Another major change is that
Weakable::make_weak_ref() may require the explicit target type.
Previously we used reinterpret_cast in WeakPtr, assuming that it
can be properly converted. But WeakPtr does not necessarily have
the knowledge to be able to do this. Instead, we now ask the class
itself to deliver a WeakPtr to the type that we want.

Also, WeakLink is no longer specific to a target type. The reason
for this is that we want to be able to safely convert e.g. WeakPtr<T>
to WeakPtr<U>, and before this we just reinterpret_cast the internal
WeakLink<T> to WeakLink<U>, which is a bold assumption that it would
actually produce the correct code. Instead, WeakLink now operates
on just a raw pointer and we only make those constructors/operators
available if we can verify that it can be safely cast.

In order to guarantee thread safety, we now use the least significant
bit in the pointer for locking purposes. This also means that only
properly aligned pointers can be used.
2020-11-10 19:11:52 +01:00
..
4chan_catalog.json AK: Add a benchmark for parsing 4chan catalog JSON 2019-08-04 11:57:32 +02:00
CMakeLists.txt CMake: Use CONFIGURE_DEPENDS in existing globs. 2020-10-29 11:52:47 +01:00
test.frm AK: Fix broken symlink used by JSON test 2020-08-06 00:05:52 +02:00
TestArray.cpp TestArray: constexpr_sum using span 2020-10-21 19:42:46 +02:00
TestAtomic.cpp Meta+AK: Make clang-format-10 clean 2020-09-25 21:18:17 +02:00
TestBase64.cpp Base64: Pre-allocate size of input and output 2020-10-13 23:59:46 +02:00
TestBinarySearch.cpp AK: Remove a really slow unit test. 2020-10-25 18:52:51 +01:00
TestBitmap.cpp Everywhere: Fix more typos 2020-10-03 12:36:49 +02:00
TestByteBuffer.cpp AK: Prevent confusing silent misuse of ByteBuffer 2020-08-22 17:18:14 +02:00
TestChecked.cpp Checked: constexpr support 2020-10-20 16:31:24 +02:00
TestCircularDeque.cpp Meta+AK: Make clang-format-10 clean 2020-09-25 21:18:17 +02:00
TestCircularDuplexStream.cpp LibCompress: Simplify logic in deflate implementation. 2020-09-06 12:54:45 +02:00
TestCircularQueue.cpp CircularQueue: Ensure constructor does not construct any values 2020-10-17 23:21:00 +02:00
TestDistinctNumeric.cpp AK: Implement and test DistinctNumeric class 2020-08-10 11:51:45 +02:00
TestEndian.cpp Endian: constexpr constructors and conversion operators 2020-10-08 23:28:54 +02:00
TestFormat.cpp AK: Add formatters for floating point numbers. 2020-11-09 16:21:29 +01:00
TestHashFunctions.cpp HashFunctions: constexpr capability 2020-10-21 19:42:12 +02:00
TestHashMap.cpp AK: Add some more checks to the HashMap test 2020-10-16 00:02:23 +02:00
TestIPv4Address.cpp IPv4Address: Unit tests 2020-11-10 09:30:39 +01:00
TestJSON.cpp AK: Add test case for duplicate JsonObject keys 2020-08-10 14:48:45 +02:00
TestLexicalPath.cpp AK: Remove relative_paths test from TestLexicalPath 2020-08-02 20:48:37 +02:00
TestMemoryStream.cpp AK: Re-add OutputMemoryStream for static buffers only. 2020-09-15 20:36:45 +02:00
TestNonnullRefPtr.cpp AK: Use unsigned int for refcount 2020-06-12 16:08:45 +02:00
TestNumberFormat.cpp AK: Eradicate calls to warn(). 2020-10-25 18:52:51 +01:00
TestOptional.cpp Meta+AK: Make clang-format-10 clean 2020-09-25 21:18:17 +02:00
TestQueue.cpp Meta+AK: Make clang-format-10 clean 2020-09-25 21:18:17 +02:00
TestRefPtr.cpp AK: Make RefPtr, NonnullRefPtr, WeakPtr thread safe 2020-11-10 19:11:52 +01:00
TestSourceGenerator.cpp AK: Introduce SourceGenerator::fork(). 2020-10-24 12:56:25 +02:00
TestSpan.cpp Span: constexpr support 2020-10-16 17:06:47 +02:00
TestString.cpp AK: printf was not accounting for plus sign with "%+d" 2020-11-05 11:04:10 +01:00
TestStringUtils.cpp AK: Make String::matches() capable of reporting match positions too 2020-10-29 11:53:01 +01:00
TestStringView.cpp AK: Add (more) tests for String(View)::split* 2020-07-30 18:47:41 +02:00
TestTypedTransfer.cpp AK: Moved TypedTransfer into it's own header. 2020-09-09 20:15:50 +02:00
TestURL.cpp AK::URL: Check if URL requires a port set to be considered a valid URL 2020-11-04 19:34:00 +01:00
TestUtf8.cpp Unicode: Try s/codepoint/code_point/g again 2020-08-05 22:33:42 +02:00
TestVector.cpp AK: Remove FixedArray class. 2020-09-08 14:01:21 +02:00
TestWeakPtr.cpp AK: Make RefPtr, NonnullRefPtr, WeakPtr thread safe 2020-11-10 19:11:52 +01:00