Ver código fonte

Everywhere: Prefer `VERIFY` over `assert()`

Dan Klishch 1 ano atrás
pai
commit
3e43d15440

+ 0 - 1
AK/Assertions.h

@@ -9,7 +9,6 @@
 #if defined(KERNEL)
 #    include <Kernel/Library/Assertions.h>
 #else
-#    include <assert.h>
 extern "C" __attribute__((noreturn)) void ak_verification_failed(char const*);
 #    define __stringify_helper(x) #x
 #    define __stringify(x) __stringify_helper(x)

+ 1 - 0
Tests/LibJS/test262-runner.cpp

@@ -23,6 +23,7 @@
 #include <LibJS/Runtime/ValueInlines.h>
 #include <LibJS/Script.h>
 #include <LibJS/SourceTextModule.h>
+#include <assert.h>
 #include <fcntl.h>
 #include <signal.h>
 #include <unistd.h>

+ 2 - 2
Userland/Libraries/LibDSP/MDCT.h

@@ -26,8 +26,8 @@ public:
 
     void transform(ReadonlySpan<float> data, Span<float> 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++) {

+ 1 - 1
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()) {