mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:37:36 +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:
parent
b33a6a443e
commit
5d180d1f99
725 changed files with 3448 additions and 3448 deletions
|
@ -35,7 +35,7 @@
|
|||
namespace HTTP {
|
||||
void HttpJob::start()
|
||||
{
|
||||
ASSERT(!m_socket);
|
||||
VERIFY(!m_socket);
|
||||
m_socket = Core::TCPSocket::construct(this);
|
||||
m_socket->on_connected = [this] {
|
||||
#if CHTTPJOB_DEBUG
|
||||
|
|
|
@ -48,7 +48,7 @@ String HttpRequest::method_name() const
|
|||
case Method::POST:
|
||||
return "POST";
|
||||
default:
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,7 @@ Optional<HttpRequest> HttpRequest::from_raw_request(ReadonlyBytes raw_request)
|
|||
};
|
||||
|
||||
auto consume = [&]() -> u8 {
|
||||
ASSERT(index < raw_request.size());
|
||||
VERIFY(index < raw_request.size());
|
||||
return raw_request[index++];
|
||||
};
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace HTTP {
|
|||
|
||||
void HttpsJob::start()
|
||||
{
|
||||
ASSERT(!m_socket);
|
||||
VERIFY(!m_socket);
|
||||
m_socket = TLS::TLSv12::construct(this);
|
||||
m_socket->set_root_certificates(m_override_ca_certificates ? *m_override_ca_certificates : DefaultRootCACertificates::the().certificates());
|
||||
m_socket->on_tls_connected = [this] {
|
||||
|
@ -91,7 +91,7 @@ void HttpsJob::set_certificate(String certificate, String private_key)
|
|||
if (!m_socket->add_client_key(certificate.bytes(), private_key.bytes())) {
|
||||
dbgln("LibHTTP: Failed to set a client certificate");
|
||||
// FIXME: Do something about this failure
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ void Job::flush_received_buffers()
|
|||
--i;
|
||||
continue;
|
||||
}
|
||||
ASSERT(written < payload.size());
|
||||
VERIFY(written < payload.size());
|
||||
payload = payload.slice(written, payload.size() - written);
|
||||
break;
|
||||
}
|
||||
|
@ -121,8 +121,8 @@ void Job::on_socket_connected()
|
|||
// and then get eof() == true.
|
||||
[[maybe_unused]] auto payload = receive(64);
|
||||
// These assertions are only correct if "Connection: close".
|
||||
ASSERT(payload.is_empty());
|
||||
ASSERT(eof());
|
||||
VERIFY(payload.is_empty());
|
||||
VERIFY(eof());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -204,8 +204,8 @@ void Job::on_socket_connected()
|
|||
dbgln_if(JOB_DEBUG, "Job: [{}] = '{}'", name, value);
|
||||
return;
|
||||
}
|
||||
ASSERT(m_state == State::InBody);
|
||||
ASSERT(can_read());
|
||||
VERIFY(m_state == State::InBody);
|
||||
VERIFY(can_read());
|
||||
|
||||
read_while_data_available([&] {
|
||||
auto read_size = 64 * KiB;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue