summaryrefslogtreecommitdiff
path: root/Kernel/Assertions.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-02-23 20:42:32 +0100
committerAndreas Kling <kling@serenityos.org>2021-02-23 20:56:54 +0100
commit5d180d1f996ead27f9c5cb3db7f91e293de34d9d (patch)
treee881854dac5d749518562970d6194a0ef65736ec /Kernel/Assertions.h
parentb33a6a443e700cd80325d312f21c985b0687bb97 (diff)
downloadserenity-5d180d1f996ead27f9c5cb3db7f91e293de34d9d.zip
Everywhere: Rename ASSERT => VERIFY
(...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.
Diffstat (limited to 'Kernel/Assertions.h')
-rw-r--r--Kernel/Assertions.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/Kernel/Assertions.h b/Kernel/Assertions.h
index 6a0c6b70e1..350e3caf83 100644
--- a/Kernel/Assertions.h
+++ b/Kernel/Assertions.h
@@ -31,11 +31,11 @@
#ifdef DEBUG
[[noreturn]] void __assertion_failed(const char* msg, const char* file, unsigned line, const char* func);
-# define ASSERT(expr) (static_cast<bool>(expr) ? void(0) : __assertion_failed(# expr, __FILE__, __LINE__, __PRETTY_FUNCTION__))
-# define ASSERT_NOT_REACHED() ASSERT(false)
+# define VERIFY(expr) (static_cast<bool>(expr) ? void(0) : __assertion_failed(# expr, __FILE__, __LINE__, __PRETTY_FUNCTION__))
+# define VERIFY_NOT_REACHED() VERIFY(false)
#else
-# define ASSERT(expr)
-# define ASSERT_NOT_REACHED() CRASH()
+# define VERIFY(expr)
+# define VERIFY_NOT_REACHED() CRASH()
#endif
#define CRASH() \
do { \
@@ -47,6 +47,6 @@
CRASH(); \
} while (0)
-#define ASSERT_INTERRUPTS_DISABLED() ASSERT(!(cpu_flags() & 0x200))
-#define ASSERT_INTERRUPTS_ENABLED() ASSERT(cpu_flags() & 0x200)
-#define TODO ASSERT_NOT_REACHED
+#define VERIFY_INTERRUPTS_DISABLED() VERIFY(!(cpu_flags() & 0x200))
+#define VERIFY_INTERRUPTS_ENABLED() VERIFY(cpu_flags() & 0x200)
+#define TODO VERIFY_NOT_REACHED