summaryrefslogtreecommitdiff
path: root/AK/Assertions.h
AgeCommit message (Collapse)Author
2022-12-03Everywhere: Run clang-formatLinus Groh
2022-10-14AK+Userland: Stub out code that isn't currently implemented on AARCH64Gunnar Beutner
Even though this almost certainly wouldn't run properly even if we had a working kernel for AARCH64 this at least lets us build all the userland binaries.
2022-10-06AK: Print VERIFY() error messages in release buildsAndreas Kling
Until now, VERIFY() failures would just cause a __builtin_trap() in release builds, which made them a bit too harsh. This commit adds an out-of-line helper function that prints the error before trapping.
2022-07-09AK: Make VERIFY() work in MinSizeRel buildsAndreas Kling
2022-02-21AK: Suppress clang-tidy warning on TODO()Max Wipfli
This adds a NOLINT directive to the definition of the TODO() macro. clang-tidy wants the assert replaced with a static_assert, since the macro simply resolves to assert(false). This is obviously nonsensical, since we want the code to still compile even with TODO(). The same fix has already been implemented for VERIFY_NOT_REACHED().
2021-11-14AK: Suppress false-positive clang-tidy warning in Assertions.hAndrew Kaster
The definition of VERIFY_NOT_REACHED() as `assert(false)` causes the tool to suggest converting it to a static_assert. Which doesn't make any sense in context for what the macro is trying to do: crash the program at runtime.
2021-08-04AK+Kernel: Print TODO when a TODO() is executedsin-ack
Previously we would just print "ASSERTION FAILED: false", which was kinda cryptic and also didn't make it clear whether this was a TODO or an unreachable condition. Now, we actually print "ASSERTION FAILED: TODO", making it crystal clear.
2021-06-08LibC+AK: Remove our custom macros from <assert.h>Gunnar Beutner
Other software might not expect these to be defined and behave differently if they _are_ defined, e.g. scummvm which checks if the TODO macro is defined and fails to build if it is.
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-02-23Everywhere: Remove unused RELEASE_ASSERT macroAndreas Kling
2021-02-23Everywhere: Rename ASSERT => VERIFYAndreas Kling
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED) Since all of these checks are done in release builds as well, let's rename them to VERIFY to prevent confusion, as everyone is used to assertions being compiled out in release. We can introduce a new ASSERT macro that is specifically for debug checks, but I'm doing this wholesale conversion first since we've accumulated thousands of these already, and it's not immediately obvious which ones are suitable for ASSERT.
2021-02-23AK: Untangle TestSuite assertions a bitAnotherTest
2020-05-30AK+LibC: Add TODO() as an alternative to ASSERT_NOT_REACHED()Andreas Kling
I've been using this in the new HTML parser and it makes it much easier to understand the state of unfinished code branches. TODO() is for places where it's okay to end up but we need to implement something there. ASSERT_NOT_REACHED() is for places where it's not okay to end up, and something has gone wrong.
2020-05-16Kernel: Absorb LibBareMetal back into the kernelAndreas Kling
This was supposed to be the foundation for some kind of pre-kernel environment, but nobody is working on it right now, so let's move everything back into the kernel and remove all the confusion.
2020-02-09AK: Apply changes for the Bootstrapper environmentLiav A
2020-01-18Meta: Add license header to source filesAndreas Kling
As suggested by Joshua, this commit adds the 2-clause BSD license as a comment block to the top of every source file. For the first pass, I've just added myself for simplicity. I encourage everyone to add themselves as copyright holders of any file they've added or modified in some significant way. If I've added myself in error somewhere, feel free to replace it with the appropriate copyright holder instead. Going forward, all new source files should include a license header.
2019-11-06AK: Remove unused AK::not_implemented()Andreas Kling
Whatever this was supposed to be, it was ironically... not implemented.
2019-08-02TestSuite: Hijack the ASSERT macros during unit tests.Andreas Kling
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-07-26AK: Add RELEASE_ASSERT in non-Serenity builds.Andreas Kling
2019-06-18AK: Make ASSERT_NOT_REACHED() work nicely in host builds.Andreas Kling
2019-05-28Add clang-format fileRobin Burchell
Also run it across the whole tree to get everything using the One True Style. We don't yet run this in an automated fashion as it's a little slow, but there is a snippet to do so in makeall.sh.
2019-04-20Get rid of SERENITY macro since the compiler already defines __serenity__Andreas Kling
This makes it a bit easier to use AK templates out-of-tree.
2019-04-03Kernel: Remove unneeded kassert.h.Andreas Kling
2019-01-31Big, possibly complete sweep of naming changes.Andreas Kling
2019-01-17Get rid of #ifdef SERENITY. We're past that phase of bootstrapping.Andreas Kling
2018-10-28Canonicalize the path used by sh.Andreas Kling
With a bunch of LibC work to support the feature. LibC now initializes AK::StringImpl by default. It's now fine to use AK in LibC/Userland! :^)
2018-10-25ELFLoader should fail with an error message for unresolved symbols.Andreas Kling
2018-10-22Import very modest Userland.Andreas Kling
2018-10-16Start fixing up AK to work inside the kernel.Andreas Kling
2018-10-10Import all this stuff into a single repo called Serenity.Andreas Kling