diff options
author | Andreas Kling <kling@serenityos.org> | 2021-02-23 20:42:32 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-02-23 20:56:54 +0100 |
commit | 5d180d1f996ead27f9c5cb3db7f91e293de34d9d (patch) | |
tree | e881854dac5d749518562970d6194a0ef65736ec /Userland/Tests/LibC | |
parent | b33a6a443e700cd80325d312f21c985b0687bb97 (diff) | |
download | serenity-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 'Userland/Tests/LibC')
-rw-r--r-- | Userland/Tests/LibC/overlong_realpath.cpp | 6 | ||||
-rw-r--r-- | Userland/Tests/LibC/scanf.cpp | 2 | ||||
-rw-r--r-- | Userland/Tests/LibC/snprintf-correctness.cpp | 2 | ||||
-rw-r--r-- | Userland/Tests/LibC/strlcpy-correctness.cpp | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Tests/LibC/overlong_realpath.cpp b/Userland/Tests/LibC/overlong_realpath.cpp index e4ce53f874..890ed7ba84 100644 --- a/Userland/Tests/LibC/overlong_realpath.cpp +++ b/Userland/Tests/LibC/overlong_realpath.cpp @@ -100,9 +100,9 @@ int main() all_good &= check_result("getcwd", expected_str, getcwd(nullptr, 0)); all_good &= check_result("realpath", expected_str, realpath(".", nullptr)); - ASSERT(strlen(PATH_LOREM_250) == 250); - ASSERT(strlen(TMPDIR_PATTERN) + ITERATION_DEPTH * (1 + strlen(PATH_LOREM_250)) == expected_str.length()); - ASSERT(expected_str.length() > PATH_MAX); + VERIFY(strlen(PATH_LOREM_250) == 250); + VERIFY(strlen(TMPDIR_PATTERN) + ITERATION_DEPTH * (1 + strlen(PATH_LOREM_250)) == expected_str.length()); + VERIFY(expected_str.length() > PATH_MAX); if (all_good) { printf("Overall: %sPASS%s\n", TEXT_PASS, TEXT_RESET); diff --git a/Userland/Tests/LibC/scanf.cpp b/Userland/Tests/LibC/scanf.cpp index da358ddac2..71aeb0a51f 100644 --- a/Userland/Tests/LibC/scanf.cpp +++ b/Userland/Tests/LibC/scanf.cpp @@ -126,7 +126,7 @@ static Array<u8, 32> arg_to_value_t(const Argument& arg) return value; } - ASSERT_NOT_REACHED(); + VERIFY_NOT_REACHED(); } #define DECL_WITH_TYPE(ty) \ diff --git a/Userland/Tests/LibC/snprintf-correctness.cpp b/Userland/Tests/LibC/snprintf-correctness.cpp index 3089419df3..71ec7028bf 100644 --- a/Userland/Tests/LibC/snprintf-correctness.cpp +++ b/Userland/Tests/LibC/snprintf-correctness.cpp @@ -76,7 +76,7 @@ static bool test_single(const Testcase& testcase) ByteBuffer actual = ByteBuffer::create_uninitialized(SANDBOX_CANARY_SIZE + testcase.dest_n + SANDBOX_CANARY_SIZE); AK::fill_with_random(actual.data(), actual.size()); ByteBuffer expected = actual.isolated_copy(); - ASSERT(actual.offset_pointer(0) != expected.offset_pointer(0)); + VERIFY(actual.offset_pointer(0) != expected.offset_pointer(0)); actual.overwrite(SANDBOX_CANARY_SIZE, testcase.dest, testcase.dest_n); expected.overwrite(SANDBOX_CANARY_SIZE, testcase.dest_expected, testcase.dest_expected_n); // "unsigned char" != "char", so we have to convince the compiler to allow this. diff --git a/Userland/Tests/LibC/strlcpy-correctness.cpp b/Userland/Tests/LibC/strlcpy-correctness.cpp index 00c3beeb38..adf56ff09d 100644 --- a/Userland/Tests/LibC/strlcpy-correctness.cpp +++ b/Userland/Tests/LibC/strlcpy-correctness.cpp @@ -78,7 +78,7 @@ static bool test_single(const Testcase& testcase) ByteBuffer actual = ByteBuffer::create_uninitialized(SANDBOX_CANARY_SIZE + testcase.dest_n + SANDBOX_CANARY_SIZE); AK::fill_with_random(actual.data(), actual.size()); ByteBuffer expected = actual.isolated_copy(); - ASSERT(actual.offset_pointer(0) != expected.offset_pointer(0)); + VERIFY(actual.offset_pointer(0) != expected.offset_pointer(0)); actual.overwrite(SANDBOX_CANARY_SIZE, testcase.dest, testcase.dest_n); expected.overwrite(SANDBOX_CANARY_SIZE, testcase.dest_expected, testcase.dest_expected_n); // "unsigned char" != "char", so we have to convince the compiler to allow this. |