serenity/AK/Tests
Andreas Kling 7ea264a660 AK: NonnullRefPtr should allow assigning owner to ownee
Given the following situation:

    struct Object : public RefCounted<Object> {
        RefPtr<Object> parent;
    }

    NonnullRefPtr<Object> object = get_some_object();
    object = *object->parent;

We would previously crash if 'object' was the only strongly referencing
pointer to 'parent'. This happened because NonnullRefPtr would unref
the outgoing pointee before reffing the incoming pointee.

This patch fixes that by implementing NonnullRefPtr assignments using
pointer swaps, just like RefPtr already did.
2020-01-18 14:40:04 +01:00
..
4chan_catalog.json AK: Add a benchmark for parsing 4chan catalog JSON 2019-08-04 11:57:32 +02:00
Makefile Build: HOST_CXX -> USE_HOST_CXX 2020-01-02 21:03:53 +01:00
TestAtomic.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
TestBinarySearch.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
TestCircularQueue.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
TestFileSystemPath.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
TestFixedArray.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
TestHashMap.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
TestJSON.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
TestNonnullRefPtr.cpp AK: NonnullRefPtr should allow assigning owner to ownee 2020-01-18 14:40:04 +01:00
TestOptional.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
TestQueue.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
TestRefPtr.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
TestString.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
TestStringView.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
TestURL.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
TestUtf8.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
TestVector.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
TestWeakPtr.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00