1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:48:10 +00:00

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.
This commit is contained in:
Andreas Kling 2021-02-23 20:42:32 +01:00
parent b33a6a443e
commit 5d180d1f99
725 changed files with 3448 additions and 3448 deletions

View file

@ -104,7 +104,7 @@ String String::empty()
bool String::copy_characters_to_buffer(char* buffer, size_t buffer_size) const
{
// We must fit at least the NUL-terminator.
ASSERT(buffer_size > 0);
VERIFY(buffer_size > 0);
size_t characters_to_copy = min(length(), buffer_size - 1);
__builtin_memcpy(buffer, characters(), characters_to_copy);
@ -127,8 +127,8 @@ String String::isolated_copy() const
String String::substring(size_t start) const
{
ASSERT(m_impl);
ASSERT(start <= length());
VERIFY(m_impl);
VERIFY(start <= length());
return { characters() + start, length() - start };
}
@ -136,24 +136,24 @@ String String::substring(size_t start, size_t length) const
{
if (!length)
return "";
ASSERT(m_impl);
ASSERT(start + length <= m_impl->length());
VERIFY(m_impl);
VERIFY(start + length <= m_impl->length());
// FIXME: This needs some input bounds checking.
return { characters() + start, length };
}
StringView String::substring_view(size_t start, size_t length) const
{
ASSERT(m_impl);
ASSERT(start + length <= m_impl->length());
VERIFY(m_impl);
VERIFY(start + length <= m_impl->length());
// FIXME: This needs some input bounds checking.
return { characters() + start, length };
}
StringView String::substring_view(size_t start) const
{
ASSERT(m_impl);
ASSERT(start <= length());
VERIFY(m_impl);
VERIFY(start <= length());
return { characters() + start, length() - start };
}