mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 13:57:35 +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
|
@ -57,7 +57,7 @@ DownloadWidget::DownloadWidget(const URL& url)
|
|||
|
||||
m_elapsed_timer.start();
|
||||
m_download = Web::ResourceLoader::the().protocol_client().start_download("GET", url.to_string());
|
||||
ASSERT(m_download);
|
||||
VERIFY(m_download);
|
||||
m_download->on_progress = [this](Optional<u32> total_size, u32 downloaded_size) {
|
||||
did_progress(total_size.value(), downloaded_size);
|
||||
};
|
||||
|
@ -109,7 +109,7 @@ DownloadWidget::DownloadWidget(const URL& url)
|
|||
m_cancel_button->set_fixed_size(100, 22);
|
||||
m_cancel_button->on_click = [this](auto) {
|
||||
bool success = m_download->stop();
|
||||
ASSERT(success);
|
||||
VERIFY(success);
|
||||
window()->close();
|
||||
};
|
||||
|
||||
|
|
|
@ -54,13 +54,13 @@ URL History::current() const
|
|||
|
||||
void History::go_back()
|
||||
{
|
||||
ASSERT(can_go_back());
|
||||
VERIFY(can_go_back());
|
||||
m_current--;
|
||||
}
|
||||
|
||||
void History::go_forward()
|
||||
{
|
||||
ASSERT(can_go_forward());
|
||||
VERIFY(can_go_forward());
|
||||
m_current++;
|
||||
}
|
||||
|
||||
|
|
|
@ -318,7 +318,7 @@ Tab::Tab(Type type)
|
|||
auto view_source_action = GUI::Action::create(
|
||||
"View source", { Mod_Ctrl, Key_U }, [this](auto&) {
|
||||
if (m_type == Type::InProcessWebView) {
|
||||
ASSERT(m_page_view->document());
|
||||
VERIFY(m_page_view->document());
|
||||
auto url = m_page_view->document()->url().to_string();
|
||||
auto source = m_page_view->document()->source();
|
||||
view_source(url, source);
|
||||
|
|
|
@ -35,13 +35,13 @@ static WindowActions* s_the;
|
|||
|
||||
WindowActions& WindowActions::the()
|
||||
{
|
||||
ASSERT(s_the);
|
||||
VERIFY(s_the);
|
||||
return *s_the;
|
||||
}
|
||||
|
||||
WindowActions::WindowActions(GUI::Window& window)
|
||||
{
|
||||
ASSERT(!s_the);
|
||||
VERIFY(!s_the);
|
||||
s_the = this;
|
||||
m_create_new_tab_action = GUI::Action::create(
|
||||
"New tab", { Mod_Ctrl, Key_T }, Gfx::Bitmap::load_from_file("/res/icons/16x16/new-tab.png"), [this](auto&) {
|
||||
|
|
|
@ -158,7 +158,7 @@ int main(int argc, char** argv)
|
|||
auto& tab_widget = *widget.find_descendant_of_type_named<GUI::TabWidget>("tab_widget");
|
||||
|
||||
auto default_favicon = Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-html.png");
|
||||
ASSERT(default_favicon);
|
||||
VERIFY(default_favicon);
|
||||
|
||||
tab_widget.on_change = [&](auto& active_widget) {
|
||||
auto& tab = static_cast<Browser::Tab&>(active_widget);
|
||||
|
|
|
@ -42,7 +42,7 @@ double Calculator::begin_operation(Operation operation, double argument)
|
|||
|
||||
switch (operation) {
|
||||
case Operation::None:
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
|
||||
case Operation::Add:
|
||||
case Operation::Subtract:
|
||||
|
@ -128,7 +128,7 @@ double Calculator::finish_operation(double argument)
|
|||
case Operation::MemRecall:
|
||||
case Operation::MemSave:
|
||||
case Operation::MemAdd:
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
clear_operation();
|
||||
|
|
|
@ -47,8 +47,8 @@ void Keypad::type_digit(int digit)
|
|||
m_frac_length = 0;
|
||||
break;
|
||||
case State::TypingInteger:
|
||||
ASSERT(m_frac_value == 0);
|
||||
ASSERT(m_frac_length == 0);
|
||||
VERIFY(m_frac_value == 0);
|
||||
VERIFY(m_frac_length == 0);
|
||||
m_int_value *= 10;
|
||||
m_int_value += digit;
|
||||
break;
|
||||
|
@ -72,8 +72,8 @@ void Keypad::type_decimal_point()
|
|||
m_frac_length = 0;
|
||||
break;
|
||||
case State::TypingInteger:
|
||||
ASSERT(m_frac_value == 0);
|
||||
ASSERT(m_frac_length == 0);
|
||||
VERIFY(m_frac_value == 0);
|
||||
VERIFY(m_frac_length == 0);
|
||||
m_state = State::TypingDecimal;
|
||||
break;
|
||||
case State::TypingDecimal:
|
||||
|
@ -97,12 +97,12 @@ void Keypad::type_backspace()
|
|||
m_frac_length--;
|
||||
break;
|
||||
}
|
||||
ASSERT(m_frac_value == 0);
|
||||
VERIFY(m_frac_value == 0);
|
||||
m_state = State::TypingInteger;
|
||||
[[fallthrough]];
|
||||
case State::TypingInteger:
|
||||
ASSERT(m_frac_value == 0);
|
||||
ASSERT(m_frac_length == 0);
|
||||
VERIFY(m_frac_value == 0);
|
||||
VERIFY(m_frac_length == 0);
|
||||
m_int_value /= 10;
|
||||
if (m_int_value == 0)
|
||||
m_negative = false;
|
||||
|
|
|
@ -135,7 +135,7 @@ String AddEventDialog::MonthListModel::column_name(int column) const
|
|||
case Column::Month:
|
||||
return "Month";
|
||||
default:
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -147,7 +147,7 @@ GUI::Variant AddEventDialog::MonthListModel::data(const GUI::ModelIndex& index,
|
|||
case Column::Month:
|
||||
return month;
|
||||
default:
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
return {};
|
||||
|
|
|
@ -227,7 +227,7 @@ int main(int argc, char** argv)
|
|||
return Debug::DebugSession::DebugDecision::Detach;
|
||||
}
|
||||
|
||||
ASSERT(optional_regs.has_value());
|
||||
VERIFY(optional_regs.has_value());
|
||||
const PtraceRegisters& regs = optional_regs.value();
|
||||
|
||||
auto symbol_at_ip = g_debug_session->symbolicate(regs.eip);
|
||||
|
|
|
@ -100,7 +100,7 @@ void MonitorWidget::paint_event(GUI::PaintEvent& event)
|
|||
} else if (m_desktop_wallpaper_mode == "stretch") {
|
||||
screen_painter.draw_scaled_bitmap(screen_bitmap->rect(), *m_desktop_wallpaper_bitmap, m_desktop_wallpaper_bitmap->rect());
|
||||
} else {
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -333,7 +333,7 @@ void DirectoryView::set_view_mode(ViewMode mode)
|
|||
set_active_widget(m_icon_view);
|
||||
return;
|
||||
}
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
void DirectoryView::add_path_to_history(const StringView& path)
|
||||
|
@ -479,7 +479,7 @@ Vector<String> DirectoryView::selected_file_paths() const
|
|||
void DirectoryView::do_delete(bool should_confirm)
|
||||
{
|
||||
auto paths = selected_file_paths();
|
||||
ASSERT(!paths.is_empty());
|
||||
VERIFY(!paths.is_empty());
|
||||
FileUtils::delete_paths(paths, should_confirm, window());
|
||||
}
|
||||
|
||||
|
@ -531,7 +531,7 @@ void DirectoryView::setup_actions()
|
|||
return;
|
||||
}
|
||||
rc = close(fd);
|
||||
ASSERT(rc >= 0);
|
||||
VERIFY(rc >= 0);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ public:
|
|||
case ViewMode::Icon:
|
||||
return *m_icon_view;
|
||||
default:
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ PropertiesWindow::PropertiesWindow(const String& path, bool disable_rename, Wind
|
|||
: Window(parent_window)
|
||||
{
|
||||
auto lexical_path = LexicalPath(path);
|
||||
ASSERT(lexical_path.is_valid());
|
||||
VERIFY(lexical_path.is_valid());
|
||||
|
||||
auto& main_widget = set_main_widget<GUI::Widget>();
|
||||
main_widget.set_layout<GUI::VerticalBoxLayout>();
|
||||
|
@ -122,7 +122,7 @@ PropertiesWindow::PropertiesWindow(const String& path, bool disable_rename, Wind
|
|||
perror("readlink");
|
||||
} else {
|
||||
auto link_directory = LexicalPath(link_destination);
|
||||
ASSERT(link_directory.is_valid());
|
||||
VERIFY(link_directory.is_valid());
|
||||
auto link_parent = URL::create_with_file_protocol(link_directory.dirname());
|
||||
properties.append({ "Link target:", link_destination, Optional(link_parent) });
|
||||
}
|
||||
|
|
|
@ -130,7 +130,7 @@ int main(int argc, char** argv)
|
|||
void do_copy(const Vector<String>& selected_file_paths, FileUtils::FileOperation file_operation)
|
||||
{
|
||||
if (selected_file_paths.is_empty())
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
|
||||
StringBuilder copy_text;
|
||||
if (file_operation == FileUtils::FileOperation::Cut) {
|
||||
|
@ -227,7 +227,7 @@ int run_in_desktop_mode([[maybe_unused]] RefPtr<Core::ConfigFile> config)
|
|||
auto paths = directory_view.selected_file_paths();
|
||||
|
||||
if (paths.is_empty())
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
|
||||
do_copy(paths, FileUtils::FileOperation::Copy);
|
||||
},
|
||||
|
@ -239,7 +239,7 @@ int run_in_desktop_mode([[maybe_unused]] RefPtr<Core::ConfigFile> config)
|
|||
auto paths = directory_view.selected_file_paths();
|
||||
|
||||
if (paths.is_empty())
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
|
||||
do_copy(paths, FileUtils::FileOperation::Cut);
|
||||
},
|
||||
|
@ -539,7 +539,7 @@ int run_in_windowed_mode(RefPtr<Core::ConfigFile> config, String initial_locatio
|
|||
paths = tree_view_selected_file_paths();
|
||||
|
||||
if (paths.is_empty())
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
|
||||
do_copy(paths, FileUtils::FileOperation::Copy);
|
||||
refresh_tree_view();
|
||||
|
@ -555,7 +555,7 @@ int run_in_windowed_mode(RefPtr<Core::ConfigFile> config, String initial_locatio
|
|||
paths = tree_view_selected_file_paths();
|
||||
|
||||
if (paths.is_empty())
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
|
||||
do_copy(paths, FileUtils::FileOperation::Cut);
|
||||
refresh_tree_view();
|
||||
|
|
|
@ -42,13 +42,13 @@ String History::current()
|
|||
|
||||
void History::go_back()
|
||||
{
|
||||
ASSERT(can_go_back());
|
||||
VERIFY(can_go_back());
|
||||
m_current_history_item--;
|
||||
}
|
||||
|
||||
void History::go_forward()
|
||||
{
|
||||
ASSERT(can_go_forward());
|
||||
VERIFY(can_go_forward());
|
||||
m_current_history_item++;
|
||||
}
|
||||
|
||||
|
|
|
@ -134,14 +134,14 @@ GUI::ModelIndex ManualModel::parent_index(const GUI::ModelIndex& index) const
|
|||
for (size_t row = 0; row < sizeof(s_sections) / sizeof(s_sections[0]); row++)
|
||||
if (&s_sections[row] == parent)
|
||||
return create_index(row, 0, parent);
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
for (size_t row = 0; row < parent->parent()->children().size(); row++) {
|
||||
ManualNode* child_at_row = &parent->parent()->children()[row];
|
||||
if (child_at_row == parent)
|
||||
return create_index(row, 0, parent);
|
||||
}
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
int ManualModel::row_count(const GUI::ModelIndex& index) const
|
||||
|
|
|
@ -167,7 +167,7 @@ int main(int argc, char* argv[])
|
|||
String html;
|
||||
{
|
||||
auto md_document = Markdown::Document::parse(source);
|
||||
ASSERT(md_document);
|
||||
VERIFY(md_document);
|
||||
html = md_document->render_to_html();
|
||||
}
|
||||
|
||||
|
|
|
@ -101,7 +101,7 @@ Result<ByteBuffer, String> FindDialog::process_input(String text_value, OptionId
|
|||
}
|
||||
|
||||
default:
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -418,8 +418,8 @@ void HexEditor::hex_mode_keydown_event(GUI::KeyEvent& event)
|
|||
if ((event.key() >= KeyCode::Key_0 && event.key() <= KeyCode::Key_9) || (event.key() >= KeyCode::Key_A && event.key() <= KeyCode::Key_F)) {
|
||||
if (m_buffer.is_empty())
|
||||
return;
|
||||
ASSERT(m_position >= 0);
|
||||
ASSERT(m_position < static_cast<int>(m_buffer.size()));
|
||||
VERIFY(m_position >= 0);
|
||||
VERIFY(m_position < static_cast<int>(m_buffer.size()));
|
||||
|
||||
// yes, this is terrible... but it works.
|
||||
auto value = (event.key() >= KeyCode::Key_0 && event.key() <= KeyCode::Key_9)
|
||||
|
@ -447,8 +447,8 @@ void HexEditor::text_mode_keydown_event(GUI::KeyEvent& event)
|
|||
{
|
||||
if (m_buffer.is_empty())
|
||||
return;
|
||||
ASSERT(m_position >= 0);
|
||||
ASSERT(m_position < static_cast<int>(m_buffer.size()));
|
||||
VERIFY(m_position >= 0);
|
||||
VERIFY(m_position < static_cast<int>(m_buffer.size()));
|
||||
|
||||
if (event.code_point() == 0) // This is a control key
|
||||
return;
|
||||
|
|
|
@ -50,7 +50,7 @@ IRCAppWindow& IRCAppWindow::the()
|
|||
IRCAppWindow::IRCAppWindow(String server, int port)
|
||||
: m_client(IRCClient::construct(server, port))
|
||||
{
|
||||
ASSERT(!s_the);
|
||||
VERIFY(!s_the);
|
||||
s_the = this;
|
||||
|
||||
set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-irc-client.png"));
|
||||
|
@ -100,7 +100,7 @@ void IRCAppWindow::setup_client()
|
|||
}
|
||||
update_title();
|
||||
bool success = m_client->connect();
|
||||
ASSERT(success);
|
||||
VERIFY(success);
|
||||
}
|
||||
|
||||
void IRCAppWindow::setup_actions()
|
||||
|
|
|
@ -54,7 +54,7 @@ String IRCChannelMemberListModel::column_name(int column) const
|
|||
case Column::Name:
|
||||
return "Name";
|
||||
}
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
GUI::Variant IRCChannelMemberListModel::data(const GUI::ModelIndex& index, GUI::ModelRole role) const
|
||||
|
|
|
@ -116,7 +116,7 @@ void IRCClient::on_socket_connected()
|
|||
bool IRCClient::connect()
|
||||
{
|
||||
if (m_socket->is_connected())
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
|
||||
m_socket->on_connected = [this] { on_socket_connected(); };
|
||||
|
||||
|
@ -132,7 +132,7 @@ void IRCClient::receive_from_server()
|
|||
outln("IRCClient: Connection closed!");
|
||||
exit(1);
|
||||
}
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
process_line(line);
|
||||
}
|
||||
|
|
|
@ -102,7 +102,7 @@ public:
|
|||
if (m_windows[i] == &window)
|
||||
return i;
|
||||
}
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
void did_part_from_channel(Badge<IRCChannel>, IRCChannel&);
|
||||
|
|
|
@ -53,7 +53,7 @@ String IRCWindowListModel::column_name(int column) const
|
|||
case Column::Name:
|
||||
return "Name";
|
||||
}
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
GUI::Variant IRCWindowListModel::data(const GUI::ModelIndex& index, GUI::ModelRole role) const
|
||||
|
|
|
@ -69,10 +69,10 @@ void KeyboardMapperWidget::create_frame()
|
|||
String value;
|
||||
if (GUI::InputBox::show(window(), value, "New Character:", "Select Character") == GUI::InputBox::ExecOK) {
|
||||
int i = m_keys.find_first_index(&tmp_button).value_or(0);
|
||||
ASSERT(i > 0);
|
||||
VERIFY(i > 0);
|
||||
|
||||
auto index = keys[i].map_index;
|
||||
ASSERT(index > 0);
|
||||
VERIFY(index > 0);
|
||||
|
||||
tmp_button.set_text(value);
|
||||
u32* map;
|
||||
|
@ -88,7 +88,7 @@ void KeyboardMapperWidget::create_frame()
|
|||
} else if (m_current_map_name == "shift_altgr_map") {
|
||||
map = m_character_map.shift_altgr_map;
|
||||
} else {
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
if (value.length() == 0)
|
||||
|
@ -146,7 +146,7 @@ void KeyboardMapperWidget::create_frame()
|
|||
void KeyboardMapperWidget::load_from_file(String file_name)
|
||||
{
|
||||
auto result = Keyboard::CharacterMapFile::load_from_file(file_name);
|
||||
ASSERT(result.has_value());
|
||||
VERIFY(result.has_value());
|
||||
|
||||
m_file_name = file_name;
|
||||
m_character_map = result.value();
|
||||
|
@ -163,7 +163,7 @@ void KeyboardMapperWidget::load_from_file(String file_name)
|
|||
void KeyboardMapperWidget::load_from_system()
|
||||
{
|
||||
auto result = Keyboard::CharacterMap::fetch_system_map();
|
||||
ASSERT(!result.is_error());
|
||||
VERIFY(!result.is_error());
|
||||
|
||||
m_file_name = String::formatted("/res/keymaps/{}.json", result.value().character_map_name());
|
||||
m_character_map = result.value().character_map_data();
|
||||
|
@ -274,7 +274,7 @@ void KeyboardMapperWidget::set_current_map(const String current_map)
|
|||
} else if (m_current_map_name == "shift_altgr_map") {
|
||||
map = m_character_map.shift_altgr_map;
|
||||
} else {
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
for (unsigned k = 0; k < KEY_COUNT; k++) {
|
||||
|
|
|
@ -50,8 +50,8 @@ public:
|
|||
|
||||
virtual GUI::Variant data(const GUI::ModelIndex& index, GUI::ModelRole role) const override
|
||||
{
|
||||
ASSERT(index.is_valid());
|
||||
ASSERT(index.column() == 0);
|
||||
VERIFY(index.is_valid());
|
||||
VERIFY(index.column() == 0);
|
||||
|
||||
if (role == GUI::ModelRole::Display)
|
||||
return m_file_names.at(index.row());
|
||||
|
|
|
@ -82,12 +82,12 @@ int main(int argc, char** argv)
|
|||
|
||||
auto proc_keymap = Core::File::construct("/proc/keymap");
|
||||
if (!proc_keymap->open(Core::IODevice::OpenMode::ReadOnly))
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
|
||||
auto json = JsonValue::from_string(proc_keymap->read_all());
|
||||
ASSERT(json.has_value());
|
||||
VERIFY(json.has_value());
|
||||
JsonObject keymap_object = json.value().as_object();
|
||||
ASSERT(keymap_object.has("keymap"));
|
||||
VERIFY(keymap_object.has("keymap"));
|
||||
String current_keymap = keymap_object.get("keymap").to_string();
|
||||
dbgln("KeyboardSettings thinks the current keymap is: {}", current_keymap);
|
||||
|
||||
|
@ -110,7 +110,7 @@ int main(int argc, char** argv)
|
|||
if (character_map_files[i].equals_ignoring_case(current_keymap))
|
||||
initial_keymap_index = i;
|
||||
}
|
||||
ASSERT(initial_keymap_index < character_map_files.size());
|
||||
VERIFY(initial_keymap_index < character_map_files.size());
|
||||
|
||||
auto window = GUI::Window::construct();
|
||||
window->set_title("Keyboard Settings");
|
||||
|
|
|
@ -58,7 +58,7 @@ void KeysWidget::set_key(int key, Switch switch_key)
|
|||
if (m_key_on[key] >= 1)
|
||||
--m_key_on[key];
|
||||
}
|
||||
ASSERT(m_key_on[key] <= 2);
|
||||
VERIFY(m_key_on[key] <= 2);
|
||||
|
||||
m_track_manager.set_note_current_octave(key, switch_key);
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ KnobsWidget::KnobsWidget(TrackManager& track_manager, MainWidget& main_widget)
|
|||
int new_octave = octave_max - value;
|
||||
if (m_change_underlying)
|
||||
m_main_widget.set_octave_and_ensure_note_change(new_octave);
|
||||
ASSERT(new_octave == m_track_manager.octave());
|
||||
VERIFY(new_octave == m_track_manager.octave());
|
||||
m_octave_value->set_text(String::number(new_octave));
|
||||
};
|
||||
|
||||
|
@ -94,7 +94,7 @@ KnobsWidget::KnobsWidget(TrackManager& track_manager, MainWidget& main_widget)
|
|||
int new_wave = last_wave - value;
|
||||
if (m_change_underlying)
|
||||
m_track_manager.current_track().set_wave(new_wave);
|
||||
ASSERT(new_wave == m_track_manager.current_track().wave());
|
||||
VERIFY(new_wave == m_track_manager.current_track().wave());
|
||||
m_wave_value->set_text(wave_strings[new_wave]);
|
||||
};
|
||||
|
||||
|
@ -106,7 +106,7 @@ KnobsWidget::KnobsWidget(TrackManager& track_manager, MainWidget& main_widget)
|
|||
int new_attack = max_attack - value;
|
||||
if (m_change_underlying)
|
||||
m_track_manager.current_track().set_attack(new_attack);
|
||||
ASSERT(new_attack == m_track_manager.current_track().attack());
|
||||
VERIFY(new_attack == m_track_manager.current_track().attack());
|
||||
m_attack_value->set_text(String::number(new_attack));
|
||||
};
|
||||
|
||||
|
@ -118,7 +118,7 @@ KnobsWidget::KnobsWidget(TrackManager& track_manager, MainWidget& main_widget)
|
|||
int new_decay = max_decay - value;
|
||||
if (m_change_underlying)
|
||||
m_track_manager.current_track().set_decay(new_decay);
|
||||
ASSERT(new_decay == m_track_manager.current_track().decay());
|
||||
VERIFY(new_decay == m_track_manager.current_track().decay());
|
||||
m_decay_value->set_text(String::number(new_decay));
|
||||
};
|
||||
|
||||
|
@ -130,7 +130,7 @@ KnobsWidget::KnobsWidget(TrackManager& track_manager, MainWidget& main_widget)
|
|||
int new_sustain = max_sustain - value;
|
||||
if (m_change_underlying)
|
||||
m_track_manager.current_track().set_sustain(new_sustain);
|
||||
ASSERT(new_sustain == m_track_manager.current_track().sustain());
|
||||
VERIFY(new_sustain == m_track_manager.current_track().sustain());
|
||||
m_sustain_value->set_text(String::number(new_sustain));
|
||||
};
|
||||
|
||||
|
@ -142,7 +142,7 @@ KnobsWidget::KnobsWidget(TrackManager& track_manager, MainWidget& main_widget)
|
|||
int new_release = max_release - value;
|
||||
if (m_change_underlying)
|
||||
m_track_manager.current_track().set_release(new_release);
|
||||
ASSERT(new_release == m_track_manager.current_track().release());
|
||||
VERIFY(new_release == m_track_manager.current_track().release());
|
||||
m_release_value->set_text(String::number(new_release));
|
||||
};
|
||||
|
||||
|
@ -153,7 +153,7 @@ KnobsWidget::KnobsWidget(TrackManager& track_manager, MainWidget& main_widget)
|
|||
int new_delay = max_delay - value;
|
||||
if (m_change_underlying)
|
||||
m_track_manager.current_track().set_delay(new_delay);
|
||||
ASSERT(new_delay == m_track_manager.current_track().delay());
|
||||
VERIFY(new_delay == m_track_manager.current_track().delay());
|
||||
m_delay_value->set_text(String::number(new_delay));
|
||||
};
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ void Track::fill_sample(Sample& sample)
|
|||
}
|
||||
break;
|
||||
default:
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
Audio::Sample note_sample;
|
||||
|
@ -107,7 +107,7 @@ void Track::fill_sample(Sample& sample)
|
|||
note_sample = recorded_sample(note);
|
||||
break;
|
||||
default:
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
new_sample.left += note_sample.left * m_power[note] * volume;
|
||||
new_sample.right += note_sample.right * m_power[note] * volume;
|
||||
|
@ -242,7 +242,7 @@ static inline double calculate_step(double distance, int milliseconds)
|
|||
|
||||
void Track::set_note(int note, Switch switch_note)
|
||||
{
|
||||
ASSERT(note >= 0 && note < note_count);
|
||||
VERIFY(note >= 0 && note < note_count);
|
||||
|
||||
if (switch_note == On) {
|
||||
if (m_note_on[note] == 0) {
|
||||
|
@ -260,8 +260,8 @@ void Track::set_note(int note, Switch switch_note)
|
|||
}
|
||||
}
|
||||
|
||||
ASSERT(m_note_on[note] != NumericLimits<u8>::max());
|
||||
ASSERT(m_power[note] >= 0);
|
||||
VERIFY(m_note_on[note] != NumericLimits<u8>::max());
|
||||
VERIFY(m_power[note] >= 0);
|
||||
}
|
||||
|
||||
void Track::sync_roll(int note)
|
||||
|
@ -277,9 +277,9 @@ void Track::set_roll_note(int note, u32 on_sample, u32 off_sample)
|
|||
{
|
||||
RollNote new_roll_note = { on_sample, off_sample };
|
||||
|
||||
ASSERT(note >= 0 && note < note_count);
|
||||
ASSERT(new_roll_note.off_sample < roll_length);
|
||||
ASSERT(new_roll_note.length() >= 2);
|
||||
VERIFY(note >= 0 && note < note_count);
|
||||
VERIFY(new_roll_note.off_sample < roll_length);
|
||||
VERIFY(new_roll_note.length() >= 2);
|
||||
|
||||
for (auto it = m_roll_notes[note].begin(); !it.is_end();) {
|
||||
if (it->on_sample > new_roll_note.off_sample) {
|
||||
|
@ -310,7 +310,7 @@ void Track::set_roll_note(int note, u32 on_sample, u32 off_sample)
|
|||
|
||||
void Track::set_wave(int wave)
|
||||
{
|
||||
ASSERT(wave >= first_wave && wave <= last_wave);
|
||||
VERIFY(wave >= first_wave && wave <= last_wave);
|
||||
m_wave = wave;
|
||||
}
|
||||
|
||||
|
@ -327,21 +327,21 @@ void Track::set_wave(Direction direction)
|
|||
|
||||
void Track::set_attack(int attack)
|
||||
{
|
||||
ASSERT(attack >= 0);
|
||||
VERIFY(attack >= 0);
|
||||
m_attack = attack;
|
||||
m_attack_step = calculate_step(1, m_attack);
|
||||
}
|
||||
|
||||
void Track::set_decay(int decay)
|
||||
{
|
||||
ASSERT(decay >= 0);
|
||||
VERIFY(decay >= 0);
|
||||
m_decay = decay;
|
||||
m_decay_step = calculate_step(1 - m_sustain_level, m_decay);
|
||||
}
|
||||
|
||||
void Track::set_sustain_impl(int sustain)
|
||||
{
|
||||
ASSERT(sustain >= 0);
|
||||
VERIFY(sustain >= 0);
|
||||
m_sustain = sustain;
|
||||
m_sustain_level = sustain / 1000.0;
|
||||
}
|
||||
|
@ -354,13 +354,13 @@ void Track::set_sustain(int sustain)
|
|||
|
||||
void Track::set_release(int release)
|
||||
{
|
||||
ASSERT(release >= 0);
|
||||
VERIFY(release >= 0);
|
||||
m_release = release;
|
||||
}
|
||||
|
||||
void Track::set_delay(int delay)
|
||||
{
|
||||
ASSERT(delay >= 0);
|
||||
VERIFY(delay >= 0);
|
||||
m_delay = delay;
|
||||
m_delay_samples = m_delay == 0 ? 0 : (sample_rate / (beats_per_minute / 60)) / m_delay;
|
||||
m_delay_buffer.resize(m_delay_samples);
|
||||
|
|
|
@ -55,7 +55,7 @@ static float color_distance_squared(const Gfx::Color& lhs, const Gfx::Color& rhs
|
|||
|
||||
static void flood_fill(Gfx::Bitmap& bitmap, const Gfx::IntPoint& start_position, Color target_color, Color fill_color, int threshold)
|
||||
{
|
||||
ASSERT(bitmap.bpp() == 32);
|
||||
VERIFY(bitmap.bpp() == 32);
|
||||
|
||||
if (target_color == fill_color)
|
||||
return;
|
||||
|
|
|
@ -50,7 +50,7 @@ void EllipseTool::draw_using(GUI::Painter& painter, const Gfx::IntRect& ellipse_
|
|||
painter.draw_ellipse_intersecting(ellipse_intersecting_rect, m_editor->color_for(m_drawing_button), m_thickness);
|
||||
break;
|
||||
default:
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ void Image::export_png(const String& file_path)
|
|||
void Image::add_layer(NonnullRefPtr<Layer> layer)
|
||||
{
|
||||
for (auto& existing_layer : m_layers) {
|
||||
ASSERT(&existing_layer != layer.ptr());
|
||||
VERIFY(&existing_layer != layer.ptr());
|
||||
}
|
||||
m_layers.append(move(layer));
|
||||
|
||||
|
@ -206,7 +206,7 @@ size_t Image::index_of(const Layer& layer) const
|
|||
if (&m_layers.at(i) == &layer)
|
||||
return i;
|
||||
}
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
void Image::move_layer_to_back(Layer& layer)
|
||||
|
@ -255,8 +255,8 @@ void Image::move_layer_up(Layer& layer)
|
|||
|
||||
void Image::change_layer_index(size_t old_index, size_t new_index)
|
||||
{
|
||||
ASSERT(old_index < m_layers.size());
|
||||
ASSERT(new_index < m_layers.size());
|
||||
VERIFY(old_index < m_layers.size());
|
||||
VERIFY(new_index < m_layers.size());
|
||||
auto layer = m_layers.take(old_index);
|
||||
m_layers.insert(new_index, move(layer));
|
||||
did_modify_layer_stack();
|
||||
|
@ -290,13 +290,13 @@ void Image::select_layer(Layer* layer)
|
|||
|
||||
void Image::add_client(ImageClient& client)
|
||||
{
|
||||
ASSERT(!m_clients.contains(&client));
|
||||
VERIFY(!m_clients.contains(&client));
|
||||
m_clients.set(&client);
|
||||
}
|
||||
|
||||
void Image::remove_client(ImageClient& client)
|
||||
{
|
||||
ASSERT(m_clients.contains(&client));
|
||||
VERIFY(m_clients.contains(&client));
|
||||
m_clients.remove(&client);
|
||||
}
|
||||
|
||||
|
|
|
@ -341,7 +341,7 @@ Color ImageEditor::color_for(GUI::MouseButton button) const
|
|||
return m_primary_color;
|
||||
if (button == GUI::MouseButton::Right)
|
||||
return m_secondary_color;
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
Color ImageEditor::color_for(const GUI::MouseEvent& event) const
|
||||
|
@ -350,7 +350,7 @@ Color ImageEditor::color_for(const GUI::MouseEvent& event) const
|
|||
return m_primary_color;
|
||||
if (event.buttons() & GUI::MouseButton::Right)
|
||||
return m_secondary_color;
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
void ImageEditor::set_primary_color(Color color)
|
||||
|
|
|
@ -161,7 +161,7 @@ void LayerListWidget::mousemove_event(GUI::MouseEvent& event)
|
|||
|
||||
auto delta = event.position() - m_moving_event_origin;
|
||||
auto& gadget = m_gadgets[m_moving_gadget_index.value()];
|
||||
ASSERT(gadget.is_moving);
|
||||
VERIFY(gadget.is_moving);
|
||||
gadget.movement_delta = delta;
|
||||
relayout_gadgets();
|
||||
}
|
||||
|
@ -221,7 +221,7 @@ static constexpr int vertical_step = gadget_height + gadget_spacing;
|
|||
|
||||
size_t LayerListWidget::hole_index_during_move() const
|
||||
{
|
||||
ASSERT(is_moving_gadget());
|
||||
VERIFY(is_moving_gadget());
|
||||
auto& moving_gadget = m_gadgets[m_moving_gadget_index.value()];
|
||||
int center_y_of_moving_gadget = moving_gadget.rect.translated(0, moving_gadget.movement_delta.y()).center().y();
|
||||
return center_y_of_moving_gadget / vertical_step;
|
||||
|
|
|
@ -56,7 +56,7 @@ void RectangleTool::draw_using(GUI::Painter& painter, const Gfx::IntRect& rect)
|
|||
painter.fill_rect_with_gradient(rect, m_editor->primary_color(), m_editor->secondary_color());
|
||||
break;
|
||||
default:
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ void SprayTool::paint_it()
|
|||
|
||||
auto& bitmap = layer->bitmap();
|
||||
GUI::Painter painter(bitmap);
|
||||
ASSERT(bitmap.bpp() == 32);
|
||||
VERIFY(bitmap.bpp() == 32);
|
||||
m_editor->update();
|
||||
const double minimal_radius = 2;
|
||||
const double base_radius = minimal_radius * m_thickness;
|
||||
|
|
|
@ -201,7 +201,7 @@ int main(int argc, char** argv)
|
|||
|
||||
auto& edit_menu = menubar->add_menu("Edit");
|
||||
auto paste_action = GUI::CommonActions::make_paste_action([&](auto&) {
|
||||
ASSERT(image_editor.image());
|
||||
VERIFY(image_editor.image());
|
||||
auto bitmap = GUI::Clipboard::the().bitmap();
|
||||
if (!bitmap)
|
||||
return;
|
||||
|
@ -217,13 +217,13 @@ int main(int argc, char** argv)
|
|||
edit_menu.add_action(paste_action);
|
||||
|
||||
auto undo_action = GUI::CommonActions::make_undo_action([&](auto&) {
|
||||
ASSERT(image_editor.image());
|
||||
VERIFY(image_editor.image());
|
||||
image_editor.undo();
|
||||
});
|
||||
edit_menu.add_action(undo_action);
|
||||
|
||||
auto redo_action = GUI::CommonActions::make_redo_action([&](auto&) {
|
||||
ASSERT(image_editor.image());
|
||||
VERIFY(image_editor.image());
|
||||
image_editor.redo();
|
||||
});
|
||||
edit_menu.add_action(redo_action);
|
||||
|
|
|
@ -99,7 +99,7 @@ static void fill_mounts(Vector<MountInfo>& output)
|
|||
|
||||
auto content = df->read_all();
|
||||
auto json = JsonValue::from_string(content);
|
||||
ASSERT(json.has_value());
|
||||
VERIFY(json.has_value());
|
||||
|
||||
json.value().as_array().for_each([&output](auto& value) {
|
||||
auto filesystem_object = value.as_object();
|
||||
|
@ -150,7 +150,7 @@ struct QueueEntry {
|
|||
|
||||
static void populate_filesize_tree(TreeNode& root, Vector<MountInfo>& mounts, HashMap<int, int>& error_accumulator)
|
||||
{
|
||||
ASSERT(!root.m_name.ends_with("/"));
|
||||
VERIFY(!root.m_name.ends_with("/"));
|
||||
|
||||
Queue<QueueEntry> queue;
|
||||
queue.enqueue(QueueEntry(root.m_name, &root));
|
||||
|
@ -247,7 +247,7 @@ static void analyze(RefPtr<Tree> tree, SpaceAnalyzer::TreeMapWidget& treemapwidg
|
|||
|
||||
static bool is_removable(const String& absolute_path)
|
||||
{
|
||||
ASSERT(!absolute_path.is_empty());
|
||||
VERIFY(!absolute_path.is_empty());
|
||||
int access_result = access(absolute_path.characters(), W_OK);
|
||||
if (access_result != 0 && errno != EACCES)
|
||||
perror("access");
|
||||
|
@ -353,7 +353,7 @@ int main(int argc, char* argv[])
|
|||
|
||||
// Configure event handlers.
|
||||
breadcrumbbar.on_segment_click = [&](size_t index) {
|
||||
ASSERT(index < treemapwidget.path_size());
|
||||
VERIFY(index < treemapwidget.path_size());
|
||||
treemapwidget.set_viewpoint(index);
|
||||
};
|
||||
treemapwidget.on_path_change = [&]() {
|
||||
|
|
|
@ -73,7 +73,7 @@ void Cell::set_type(const StringView& name)
|
|||
return set_type(cell_type);
|
||||
}
|
||||
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
void Cell::set_type_metadata(CellTypeMetadata&& metadata)
|
||||
|
|
|
@ -56,7 +56,7 @@ Vector<StringView> CellType::names()
|
|||
CellType::CellType(const StringView& name)
|
||||
: m_name(name)
|
||||
{
|
||||
ASSERT(!s_cell_types.contains(name));
|
||||
VERIFY(!s_cell_types.contains(name));
|
||||
s_cell_types.set(name, this);
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ namespace Spreadsheet {
|
|||
CellTypeDialog::CellTypeDialog(const Vector<Position>& positions, Sheet& sheet, GUI::Window* parent)
|
||||
: GUI::Dialog(parent)
|
||||
{
|
||||
ASSERT(!positions.is_empty());
|
||||
VERIFY(!positions.is_empty());
|
||||
|
||||
StringBuilder builder;
|
||||
|
||||
|
@ -239,7 +239,7 @@ void CellTypeDialog::setup_tabs(GUI::TabWidget& tabs, const Vector<Position>& po
|
|||
m_horizontal_alignment = HorizontalAlignment::Right;
|
||||
break;
|
||||
default:
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -271,7 +271,7 @@ void CellTypeDialog::setup_tabs(GUI::TabWidget& tabs, const Vector<Position>& po
|
|||
m_vertical_alignment = VerticalAlignment::Bottom;
|
||||
break;
|
||||
default:
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -444,7 +444,7 @@ ConditionsView::ConditionsView()
|
|||
|
||||
void ConditionsView::set_formats(Vector<ConditionalFormat>* formats)
|
||||
{
|
||||
ASSERT(!m_formats);
|
||||
VERIFY(!m_formats);
|
||||
|
||||
m_formats = formats;
|
||||
|
||||
|
@ -454,7 +454,7 @@ void ConditionsView::set_formats(Vector<ConditionalFormat>* formats)
|
|||
|
||||
void ConditionsView::add_format()
|
||||
{
|
||||
ASSERT(m_formats);
|
||||
VERIFY(m_formats);
|
||||
|
||||
m_formats->empend();
|
||||
auto& last = m_formats->last();
|
||||
|
@ -466,7 +466,7 @@ void ConditionsView::add_format()
|
|||
|
||||
void ConditionsView::remove_top()
|
||||
{
|
||||
ASSERT(m_formats);
|
||||
VERIFY(m_formats);
|
||||
|
||||
if (m_formats->is_empty())
|
||||
return;
|
||||
|
|
|
@ -100,7 +100,7 @@ HelpWindow::HelpWindow(GUI::Window* parent)
|
|||
|
||||
m_webview = splitter.add<Web::OutOfProcessWebView>();
|
||||
m_webview->on_link_click = [this](auto& url, auto&, auto&&) {
|
||||
ASSERT(url.protocol() == "spreadsheet");
|
||||
VERIFY(url.protocol() == "spreadsheet");
|
||||
if (url.host() == "example") {
|
||||
auto entry = LexicalPath(url.path()).basename();
|
||||
auto doc_option = m_docs.get(entry);
|
||||
|
@ -159,19 +159,19 @@ HelpWindow::HelpWindow(GUI::Window* parent)
|
|||
String HelpWindow::render(const StringView& key)
|
||||
{
|
||||
auto doc_option = m_docs.get(key);
|
||||
ASSERT(doc_option.is_object());
|
||||
VERIFY(doc_option.is_object());
|
||||
|
||||
auto& doc = doc_option.as_object();
|
||||
|
||||
auto name = doc.get("name").to_string();
|
||||
auto argc = doc.get("argc").to_u32(0);
|
||||
auto argnames_value = doc.get("argnames");
|
||||
ASSERT(argnames_value.is_array());
|
||||
VERIFY(argnames_value.is_array());
|
||||
auto& argnames = argnames_value.as_array();
|
||||
|
||||
auto docstring = doc.get("doc").to_string();
|
||||
auto examples_value = doc.get_or("examples", JsonObject {});
|
||||
ASSERT(examples_value.is_object());
|
||||
VERIFY(examples_value.is_object());
|
||||
auto& examples = examples_value.as_object();
|
||||
|
||||
StringBuilder markdown_builder;
|
||||
|
|
|
@ -243,9 +243,9 @@ XSV::Field XSV::read_one_unquoted_field()
|
|||
|
||||
StringView XSV::Row::operator[](StringView name) const
|
||||
{
|
||||
ASSERT(!m_xsv.m_names.is_empty());
|
||||
VERIFY(!m_xsv.m_names.is_empty());
|
||||
auto it = m_xsv.m_names.find_if([&](const auto& entry) { return name == entry; });
|
||||
ASSERT(!it.is_end());
|
||||
VERIFY(!it.is_end());
|
||||
|
||||
return (*this)[it.index()];
|
||||
}
|
||||
|
@ -265,7 +265,7 @@ const XSV::Row XSV::operator[](size_t index) const
|
|||
|
||||
XSV::Row XSV::operator[](size_t index)
|
||||
{
|
||||
ASSERT(m_rows.size() > index);
|
||||
VERIFY(m_rows.size() > index);
|
||||
return Row { *this, index };
|
||||
}
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ public:
|
|||
ENUMERATE_READ_ERRORS();
|
||||
#undef E
|
||||
}
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
size_t size() const { return m_rows.size(); }
|
||||
|
|
|
@ -103,7 +103,7 @@ static String convert_to_string(size_t value, unsigned base = 26, StringView map
|
|||
if (map.is_null())
|
||||
map = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
|
||||
ASSERT(base >= 2 && base <= map.length());
|
||||
VERIFY(base >= 2 && base <= map.length());
|
||||
|
||||
// The '8 bits per byte' assumption may need to go?
|
||||
Array<char, round_up_to_power_of_two(sizeof(size_t) * 8 + 1, 2)> buffer;
|
||||
|
@ -130,7 +130,7 @@ static size_t convert_from_string(StringView str, unsigned base = 26, StringView
|
|||
if (map.is_null())
|
||||
map = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
|
||||
ASSERT(base >= 2 && base <= map.length());
|
||||
VERIFY(base >= 2 && base <= map.length());
|
||||
|
||||
size_t value = 0;
|
||||
for (size_t i = str.length(); i > 0; --i) {
|
||||
|
@ -295,7 +295,7 @@ Optional<Position> Sheet::position_from_url(const URL& url) const
|
|||
}
|
||||
|
||||
// FIXME: Figure out a way to do this cross-process.
|
||||
ASSERT(url.path() == String::formatted("/{}", getpid()));
|
||||
VERIFY(url.path() == String::formatted("/{}", getpid()));
|
||||
|
||||
return parse_cell_name(url.fragment());
|
||||
}
|
||||
|
|
|
@ -106,12 +106,12 @@ public:
|
|||
for (size_t i = column_count(); i < index; ++i)
|
||||
add_column();
|
||||
|
||||
ASSERT(column_count() > index);
|
||||
VERIFY(column_count() > index);
|
||||
return m_columns[index];
|
||||
}
|
||||
const String& column(size_t index) const
|
||||
{
|
||||
ASSERT(column_count() > index);
|
||||
VERIFY(column_count() > index);
|
||||
return m_columns[index];
|
||||
}
|
||||
|
||||
|
|
|
@ -132,7 +132,7 @@ RefPtr<Core::MimeData> SheetModel::mime_data(const GUI::ModelSelection& selectio
|
|||
first = false;
|
||||
});
|
||||
|
||||
ASSERT(cursor);
|
||||
VERIFY(cursor);
|
||||
|
||||
Position cursor_position { m_sheet->column(cursor->column()), (size_t)cursor->row() };
|
||||
auto new_data = String::formatted("{}\n{}",
|
||||
|
|
|
@ -284,7 +284,7 @@ SpreadsheetView::SpreadsheetView(Sheet& sheet)
|
|||
|
||||
if (event.mime_data().has_text()) {
|
||||
auto* target_cell = m_sheet->at({ m_sheet->column(index.column()), (size_t)index.row() });
|
||||
ASSERT(target_cell);
|
||||
VERIFY(target_cell);
|
||||
|
||||
target_cell->set_data(event.text());
|
||||
return;
|
||||
|
|
|
@ -96,7 +96,7 @@ SpreadsheetWidget::SpreadsheetWidget(NonnullRefPtrVector<Sheet>&& sheets, bool s
|
|||
|
||||
m_tab_context_menu = GUI::Menu::construct();
|
||||
auto rename_action = GUI::Action::create("Rename...", [this](auto&) {
|
||||
ASSERT(m_tab_context_menu_sheet_view);
|
||||
VERIFY(m_tab_context_menu_sheet_view);
|
||||
|
||||
auto& sheet = m_tab_context_menu_sheet_view->sheet();
|
||||
String new_name;
|
||||
|
@ -321,7 +321,7 @@ void SpreadsheetWidget::add_sheet()
|
|||
|
||||
void SpreadsheetWidget::add_sheet(NonnullRefPtr<Sheet>&& sheet)
|
||||
{
|
||||
ASSERT(m_workbook == &sheet->workbook());
|
||||
VERIFY(m_workbook == &sheet->workbook());
|
||||
|
||||
NonnullRefPtrVector<Sheet> new_sheets;
|
||||
new_sheets.append(move(sheet));
|
||||
|
|
|
@ -109,7 +109,7 @@ public:
|
|||
ENUMERATE_WRITE_ERRORS();
|
||||
#undef E
|
||||
}
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
@ -165,7 +165,7 @@ int main(int argc, char* argv[])
|
|||
/// - currently selected cell
|
||||
/// - selected cell+
|
||||
auto& cells = spreadsheet_widget.current_worksheet().selected_cells();
|
||||
ASSERT(!cells.is_empty());
|
||||
VERIFY(!cells.is_empty());
|
||||
StringBuilder text_builder, url_builder;
|
||||
bool first = true;
|
||||
auto cursor = spreadsheet_widget.current_selection_cursor();
|
||||
|
@ -201,7 +201,7 @@ int main(int argc, char* argv[])
|
|||
ScopeGuard update_after_paste { [&] { spreadsheet_widget.update(); } };
|
||||
|
||||
auto& cells = spreadsheet_widget.current_worksheet().selected_cells();
|
||||
ASSERT(!cells.is_empty());
|
||||
VERIFY(!cells.is_empty());
|
||||
const auto& data = GUI::Clipboard::the().data_and_type();
|
||||
if (auto spreadsheet_data = data.metadata.get("text/x-spreadsheet-data"); spreadsheet_data.has_value()) {
|
||||
Vector<Spreadsheet::Position> source_positions, target_positions;
|
||||
|
|
|
@ -69,13 +69,13 @@ String DevicesModel::column_name(int column) const
|
|||
case Column::Type:
|
||||
return "Type";
|
||||
default:
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
GUI::Variant DevicesModel::data(const GUI::ModelIndex& index, GUI::ModelRole role) const
|
||||
{
|
||||
ASSERT(is_valid(index));
|
||||
VERIFY(is_valid(index));
|
||||
|
||||
if (role == GUI::ModelRole::TextAlignment) {
|
||||
switch (index.column()) {
|
||||
|
@ -107,7 +107,7 @@ GUI::Variant DevicesModel::data(const GUI::ModelIndex& index, GUI::ModelRole rol
|
|||
case Column::Type:
|
||||
return device.type;
|
||||
default:
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -129,10 +129,10 @@ GUI::Variant DevicesModel::data(const GUI::ModelIndex& index, GUI::ModelRole rol
|
|||
case DeviceInfo::Type::Character:
|
||||
return "Character";
|
||||
default:
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
default:
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -143,10 +143,10 @@ void DevicesModel::update()
|
|||
{
|
||||
auto proc_devices = Core::File::construct("/proc/devices");
|
||||
if (!proc_devices->open(Core::IODevice::OpenMode::ReadOnly))
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
|
||||
auto json = JsonValue::from_string(proc_devices->read_all());
|
||||
ASSERT(json.has_value());
|
||||
VERIFY(json.has_value());
|
||||
|
||||
m_devices.clear();
|
||||
json.value().as_array().for_each([this](auto& value) {
|
||||
|
@ -163,7 +163,7 @@ void DevicesModel::update()
|
|||
else if (type_str == "character")
|
||||
device_info.type = DeviceInfo::Type::Character;
|
||||
else
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
|
||||
m_devices.append(move(device_info));
|
||||
});
|
||||
|
@ -175,7 +175,7 @@ void DevicesModel::update()
|
|||
auto path = String::formatted("{}/{}", dir, name);
|
||||
struct stat statbuf;
|
||||
if (lstat(path.characters(), &statbuf) != 0) {
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
if (!S_ISBLK(statbuf.st_mode) && !S_ISCHR(statbuf.st_mode))
|
||||
continue;
|
||||
|
|
|
@ -88,7 +88,7 @@ void GraphWidget::paint_event(GUI::PaintEvent& event)
|
|||
Gfx::IntPoint current_point { x, inner_rect.bottom() - (int)scaled_value };
|
||||
m_calculated_points.append(current_point);
|
||||
}
|
||||
ASSERT(m_calculated_points.size() <= m_values.size());
|
||||
VERIFY(m_calculated_points.size() <= m_values.size());
|
||||
if (format.graph_color_role != ColorRole::Base) {
|
||||
// Fill the background for the area we have values for
|
||||
Gfx::Path path;
|
||||
|
@ -100,8 +100,8 @@ void GraphWidget::paint_event(GUI::PaintEvent& event)
|
|||
if (!started_path)
|
||||
return;
|
||||
if (points_in_path > 1) {
|
||||
ASSERT(current_point);
|
||||
ASSERT(first_point);
|
||||
VERIFY(current_point);
|
||||
VERIFY(first_point);
|
||||
path.line_to({ current_point->x() - 1, inner_rect.bottom() + 1 });
|
||||
path.line_to({ first_point->x() + 1, inner_rect.bottom() + 1 });
|
||||
path.close();
|
||||
|
|
|
@ -48,7 +48,7 @@ MemoryStatsWidget* MemoryStatsWidget::the()
|
|||
MemoryStatsWidget::MemoryStatsWidget(GraphWidget& graph)
|
||||
: m_graph(graph)
|
||||
{
|
||||
ASSERT(!s_the);
|
||||
VERIFY(!s_the);
|
||||
s_the = this;
|
||||
|
||||
set_fixed_height(110);
|
||||
|
@ -98,11 +98,11 @@ void MemoryStatsWidget::refresh()
|
|||
{
|
||||
auto proc_memstat = Core::File::construct("/proc/memstat");
|
||||
if (!proc_memstat->open(Core::IODevice::OpenMode::ReadOnly))
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
|
||||
auto file_contents = proc_memstat->read_all();
|
||||
auto json_result = JsonValue::from_string(file_contents);
|
||||
ASSERT(json_result.has_value());
|
||||
VERIFY(json_result.has_value());
|
||||
auto json = json_result.value().as_object();
|
||||
|
||||
[[maybe_unused]] unsigned kmalloc_eternal_allocated = json.get("kmalloc_eternal_allocated").to_u32();
|
||||
|
|
|
@ -55,7 +55,7 @@ public:
|
|||
else if (c == 'P') // Physical (a resident page)
|
||||
color = Color::Black;
|
||||
else
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
|
||||
painter.draw_line({ x, rect.top() }, { x, rect.bottom() }, color);
|
||||
}
|
||||
|
|
|
@ -35,13 +35,13 @@ static ProcessModel* s_the;
|
|||
|
||||
ProcessModel& ProcessModel::the()
|
||||
{
|
||||
ASSERT(s_the);
|
||||
VERIFY(s_the);
|
||||
return *s_the;
|
||||
}
|
||||
|
||||
ProcessModel::ProcessModel()
|
||||
{
|
||||
ASSERT(!s_the);
|
||||
VERIFY(!s_the);
|
||||
s_the = this;
|
||||
m_generic_process_icon = Gfx::Bitmap::load_from_file("/res/icons/16x16/gear.png");
|
||||
|
||||
|
@ -138,7 +138,7 @@ String ProcessModel::column_name(int column) const
|
|||
case Column::Veil:
|
||||
return "Veil";
|
||||
default:
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -149,7 +149,7 @@ static String pretty_byte_size(size_t size)
|
|||
|
||||
GUI::Variant ProcessModel::data(const GUI::ModelIndex& index, GUI::ModelRole role) const
|
||||
{
|
||||
ASSERT(is_valid(index));
|
||||
VERIFY(is_valid(index));
|
||||
|
||||
if (role == GUI::ModelRole::TextAlignment) {
|
||||
switch (index.column()) {
|
||||
|
@ -186,7 +186,7 @@ GUI::Variant ProcessModel::data(const GUI::ModelIndex& index, GUI::ModelRole rol
|
|||
case Column::IPv4SocketWriteBytes:
|
||||
return Gfx::TextAlignment::CenterRight;
|
||||
default:
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -256,7 +256,7 @@ GUI::Variant ProcessModel::data(const GUI::ModelIndex& index, GUI::ModelRole rol
|
|||
case Column::Veil:
|
||||
return thread.current_state.veil;
|
||||
}
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
if (role == GUI::ModelRole::Display) {
|
||||
|
@ -391,7 +391,7 @@ void ProcessModel::update()
|
|||
m_threads.set(thread.tid, make<Thread>());
|
||||
}
|
||||
auto pit = m_threads.find(thread.tid);
|
||||
ASSERT(pit != m_threads.end());
|
||||
VERIFY(pit != m_threads.end());
|
||||
(*pit).value->previous_state = (*pit).value->current_state;
|
||||
(*pit).value->current_state = state;
|
||||
|
||||
|
|
|
@ -171,7 +171,7 @@ static pid_t run_command(int ptm_fd, String command)
|
|||
perror("execve");
|
||||
exit(1);
|
||||
}
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
return pid;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue