From 3e43d154409e2437a3e0b1554023b803a5a42c4a Mon Sep 17 00:00:00 2001 From: Dan Klishch Date: Sat, 18 Nov 2023 15:01:26 -0500 Subject: [PATCH] Everywhere: Prefer `VERIFY` over `assert()` --- AK/Assertions.h | 1 - Tests/LibJS/test262-runner.cpp | 1 + Userland/Libraries/LibDSP/MDCT.h | 4 ++-- Userland/Utilities/tsort.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/AK/Assertions.h b/AK/Assertions.h index fb486092260..53766c2994d 100644 --- a/AK/Assertions.h +++ b/AK/Assertions.h @@ -9,7 +9,6 @@ #if defined(KERNEL) # include #else -# include extern "C" __attribute__((noreturn)) void ak_verification_failed(char const*); # define __stringify_helper(x) #x # define __stringify(x) __stringify_helper(x) diff --git a/Tests/LibJS/test262-runner.cpp b/Tests/LibJS/test262-runner.cpp index 83e1faedd40..0a34d66c7c0 100644 --- a/Tests/LibJS/test262-runner.cpp +++ b/Tests/LibJS/test262-runner.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include diff --git a/Userland/Libraries/LibDSP/MDCT.h b/Userland/Libraries/LibDSP/MDCT.h index a3f61868cfe..e13b3dadd68 100644 --- a/Userland/Libraries/LibDSP/MDCT.h +++ b/Userland/Libraries/LibDSP/MDCT.h @@ -26,8 +26,8 @@ public: void transform(ReadonlySpan data, Span output) { - assert(N == 2 * data.size()); - assert(N == output.size()); + VERIFY(N == 2 * data.size()); + VERIFY(N == output.size()); for (size_t n = 0; n < N; n++) { output[n] = 0; for (size_t k = 0; k < N / 2; k++) { diff --git a/Userland/Utilities/tsort.cpp b/Userland/Utilities/tsort.cpp index 074136f98cd..2176b41b2b1 100644 --- a/Userland/Utilities/tsort.cpp +++ b/Userland/Utilities/tsort.cpp @@ -53,7 +53,7 @@ static void prioritize_nodes(Node& start, NodeMap& node_map, NodeStack& stack, b // chains, this function does not call itself recursively. Instead, the recursive // algorithm is implemented on a provided stack. - assert(stack.is_empty()); + VERIFY(stack.is_empty()); stack.append(start); while (!stack.is_empty()) {