serenity/Tests/AK
Nico Weber e4c36876d2 AK: Make Function a little bit constexpr
Just enough to make it possible to pass a lambda to a constexpr function
taking an AK::Function parameter and have that constexpr function call
the passed-in AK::Function.

The main thing is that bit_cast<>s of pointers aren't ok in constexpr
functions, and neither is placement new. So add a union with stronger
typing for the constexpr case.

The body of the `if (is_constexpr_evaluated())` in
`init_with_callable()` is identical to the `if constexpr` right
after it. But `if constexpr (is_constexpr_evaluated())` always
evaluates `is_constexpr_evaluated()` in a constexpr context, so
this can't just add ` || is_constexpr_evaluated()` to that
`if constexpr`.
2024-12-20 12:05:06 -05:00
..
CMakeLists.txt AK: Make Function a little bit constexpr 2024-12-20 12:05:06 -05:00
TestAKMath.cpp AK: Avoid UB from pow() integer fast path 2024-10-13 03:44:49 +02:00
TestAllOf.cpp LibTest: Add more numeric generators 2024-01-12 16:42:51 -07:00
TestAnyOf.cpp LibTest: Add more numeric generators 2024-01-12 16:42:51 -07:00
TestArbitrarySizedEnum.cpp
TestArray.cpp Tests/AK: Add a test for the array ctor deduction guide 2024-02-11 18:53:00 +01:00
TestAtomic.cpp
TestBadge.cpp
TestBase64.cpp AK: Reject invalid Base64 encoded string lengths 2024-03-25 08:13:27 +01:00
TestBinaryHeap.cpp LibTest: Add more numeric generators 2024-01-12 16:42:51 -07:00
TestBinarySearch.cpp LibTest: Add more numeric generators 2024-01-12 16:42:51 -07:00
TestBitCast.cpp
TestBitmap.cpp LibTest: Add more numeric generators 2024-01-12 16:42:51 -07:00
TestBitStream.cpp LibTest: Add more numeric generators 2024-01-12 16:42:51 -07:00
TestBuiltinWrappers.cpp LibTest: Add more numeric generators 2024-01-12 16:42:51 -07:00
TestByteBuffer.cpp AK: Add an option to zero-fill ByteBuffer data upon growth 2023-12-27 19:30:39 +01:00
TestByteString.cpp Everywhere: Use to_number<T> instead of to_{int,uint,float,double} 2023-12-23 20:41:07 +01:00
TestCharacterTypes.cpp AK: Add CharacterTypes::is_ascii_base36_digit() 2024-01-13 19:01:35 -07:00
TestChecked.cpp Everywhere: Run clang-format 2024-04-24 16:50:01 -04:00
TestCircularBuffer.cpp
TestCircularDeque.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
TestCircularQueue.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
TestComplex.cpp AK: Cover TestComplex with more tests 2024-01-12 16:42:51 -07:00
TestCoroutine.cpp AK+LibTest: Choose definition of CO_TRY and CO_TRY_OR_FAIL more robustly 2024-06-29 20:15:05 -06:00
TestDisjointChunks.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
TestDistinctNumeric.cpp
TestDoublyLinkedList.cpp
TestDuration.cpp Tests: Fix TestDuration build with 32-bit time_t 2023-09-06 07:21:07 -06:00
TestEndian.cpp
TestEnumBits.cpp
TestEnumerate.cpp AK: Introduce AK::enumerate 2024-03-23 09:02:58 -04:00
TestFind.cpp
TestFixedArray.cpp
TestFixedPoint.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
TestFloatingPoint.cpp
TestFloatingPointParsing.cpp Tests: Remove duplicated test for FloatingPointParsing 2024-11-14 23:38:34 -05:00
TestFlyString.cpp
TestFormat.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
TestFunction.cpp AK: Make Function a little bit constexpr 2024-12-20 12:05:06 -05:00
TestFuzzyMatch.cpp AK/FuzzyMatch: Return the best possible score in case of equality 2024-08-23 14:14:05 -04:00
TestGeneratorAK.cpp AK: Introduce AK::Generator 2024-06-13 17:40:24 +02:00
TestGenericLexer.cpp AK: Remove ByteString from GenericLexer 2024-01-12 17:03:53 -07:00
TestHashFunctions.cpp AK: Implement SipHash as the default hash algorithm for most use cases 2023-10-01 11:06:36 +03:30
TestHashMap.cpp Everywhere: Use to_number<T> instead of to_{int,uint,float,double} 2023-12-23 20:41:07 +01:00
TestHashTable.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
TestHex.cpp
TestIndexSequence.cpp AK: Make IndexSequence use size_t 2024-02-11 18:53:00 +01:00
TestInsertionSort.cpp AK: Fix InsertionSort to respect specified bounds 2024-12-08 13:24:15 -05:00
TestIntegerMath.cpp AK: Prevent overflow of the min when clamping unsigned values to signed 2024-07-04 22:09:32 +02:00
TestIntrusiveList.cpp
TestIntrusiveRedBlackTree.cpp
TestIPv4Address.cpp Everywhere: Run clang-format 2024-04-24 16:50:01 -04:00
TestIPv6Address.cpp AK: Add IPv6 subnet and address category handling 2024-09-08 18:27:55 -04:00
TestJSON.cpp AK: Make String::number() infallible 2024-11-29 16:03:30 -05:00
TestLEB128.cpp
TestLexicalPath.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
TestMACAddress.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
TestMemory.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
TestMemoryStream.cpp AK: Add methods to BufferedStream to resize the user supplied buffer 2024-04-21 11:46:55 +02:00
TestNeverDestroyed.cpp Tests: Stop invoking UB in AK::NeverDestroyed's tests 2024-06-06 13:01:12 +02:00
TestNonnullOwnPtr.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
TestNonnullRefPtr.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
TestNumberFormat.cpp
TestOptional.cpp AK: Don't implicitly convert Optional<T&> to Optional<T> 2024-09-14 13:30:27 +02:00
TestOptionParser.cpp AK: Update OptionParser::m_arg_index by substracting skipped args 2024-02-06 00:08:30 +01:00
TestOwnPtr.cpp
TestPrint.cpp
TestQueue.cpp Everywhere: Use to_number<T> instead of to_{int,uint,float,double} 2023-12-23 20:41:07 +01:00
TestQuickSelect.cpp
TestQuickSort.cpp
TestRedBlackTree.cpp
TestRefPtr.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
TestSegmentedVector.cpp AK+LibWeb: Use segmented vector to store commands in RecordingPainter 2023-12-30 23:02:46 +01:00
TestSIMD.cpp Tests: Fix building TestSIMD on non-SSE ABIs 2023-09-06 07:21:07 -06:00
TestSIMDExtras.cpp AK: Add TestSIMDExtras 2024-07-05 00:52:30 +02:00
TestSinglyLinkedList.cpp
TestSlugify.cpp AK: Implement slugify function for URL slug generation 2023-10-30 10:39:59 +00:00
TestSourceGenerator.cpp
TestSourceLocation.cpp
TestSpan.cpp Everywhere: Run clang-format 2024-04-24 16:50:01 -04:00
TestStack.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
TestStatistics.cpp
TestStdLibExtras.cpp AK: Make ceil_div() handle one argument being negative correctly 2024-04-27 07:09:08 +02:00
TestString.cpp AK+LibWeb: Add {Fly,}String::to_ascii_{upper,lower}_case() 2024-11-18 20:22:45 -05:00
TestStringFloatingPointConversions.cpp
TestStringUtils.cpp AK: Add unit tests for StringUtils::find_last 2024-01-04 11:28:03 -05:00
TestStringView.cpp AK: Ensure empty StringViews all compare as equal 2024-11-15 23:09:44 -05:00
TestTrie.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
TestTuple.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
TestTypedTransfer.cpp
TestTypeTraits.cpp
TestUFixedBigInt.cpp AK: Make BigIntBase more agnostic to non native word sizes 2024-03-25 14:26:29 -06:00
TestUtf8.cpp AK: Add Utf8View::for_each_split_view() method 2024-11-15 23:09:44 -05:00
TestUtf16.cpp AK: Add a method to compute UTF-16 length from a UTF-8 string 2024-10-18 18:21:18 -04:00
TestVariant.cpp Everywhere: Run clang-format 2024-04-24 16:50:01 -04:00
TestVector.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
TestWeakPtr.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30