The Battle for Wesnoth  1.19.0+dev
Classes | Macros | Functions | Variables
test_formula_core.cpp File Reference
#include <boost/test/unit_test.hpp>
#include <array>
#include <ctime>
#include "formula/formula.hpp"
#include "formula/callable.hpp"
#include "formula/tokenizer.hpp"
Include dependency graph for test_formula_core.cpp:

Go to the source code of this file.

Classes

class  mock_char
 
class  mock_party
 

Macros

#define GETTEXT_DOMAIN   "wesnoth-test"
 

Functions

 BOOST_AUTO_TEST_CASE (test_formula_basic_arithmetic)
 
 BOOST_AUTO_TEST_CASE (test_formula_basic_logic)
 
 BOOST_AUTO_TEST_CASE (test_formula_callable)
 
 BOOST_AUTO_TEST_CASE (test_formula_where_clause)
 
 BOOST_AUTO_TEST_CASE (test_formula_strings)
 
 BOOST_AUTO_TEST_CASE (test_formula_dice)
 
 BOOST_AUTO_TEST_CASE (test_formula_containers)
 
 BOOST_AUTO_TEST_CASE (test_formula_tokenizer)
 

Variables

mock_char c
 
mock_party p
 

Macro Definition Documentation

◆ GETTEXT_DOMAIN

#define GETTEXT_DOMAIN   "wesnoth-test"

Definition at line 15 of file test_formula_core.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/8]

BOOST_AUTO_TEST_CASE ( test_formula_basic_arithmetic  )

Definition at line 71 of file test_formula_core.cpp.

References c.

◆ BOOST_AUTO_TEST_CASE() [2/8]

BOOST_AUTO_TEST_CASE ( test_formula_basic_logic  )

Definition at line 93 of file test_formula_core.cpp.

References c.

◆ BOOST_AUTO_TEST_CASE() [3/8]

BOOST_AUTO_TEST_CASE ( test_formula_callable  )

Definition at line 109 of file test_formula_core.cpp.

References p.

◆ BOOST_AUTO_TEST_CASE() [4/8]

BOOST_AUTO_TEST_CASE ( test_formula_containers  )

◆ BOOST_AUTO_TEST_CASE() [5/8]

BOOST_AUTO_TEST_CASE ( test_formula_dice  )

Definition at line 144 of file test_formula_core.cpp.

References wfl::variant::as_int(), and wfl::formula::evaluate().

◆ BOOST_AUTO_TEST_CASE() [6/8]

BOOST_AUTO_TEST_CASE ( test_formula_strings  )

Definition at line 128 of file test_formula_core.cpp.

References c.

◆ BOOST_AUTO_TEST_CASE() [7/8]

BOOST_AUTO_TEST_CASE ( test_formula_tokenizer  )

◆ BOOST_AUTO_TEST_CASE() [8/8]

BOOST_AUTO_TEST_CASE ( test_formula_where_clause  )

Definition at line 119 of file test_formula_core.cpp.

References p.

Variable Documentation

◆ c

Definition at line 68 of file test_formula_core.cpp.

Referenced by gui2::dialogs::campaign_selection::add_campaign_to_tree(), ai::component_manager::add_component(), terrain_builder::add_constraints(), ai::typesafe_known_aspect< T >::add_facet(), ai::composite_aspect< T >::add_facet(), replay::add_log_data(), theme::add_object(), add_prefixes(), ai::lua_goal::add_targets(), attack_type::alternative_damage_types(), unit::apply_builtin_effect(), image::apply_light(), color_t::blend_add(), color_t::blend_lighten(), BOOST_AUTO_TEST_CASE(), gui2::builder_grid::builder_grid(), gui2::implementation::builder_panel::builder_panel(), gui2::implementation::builder_toggle_panel::builder_toggle_panel(), cave_map_generator::cave_map_generator_job::cave_map_generator_job(), ai::config_value_translator< terrain_filter >::cfg_to_value(), ai::component_manager::change_component(), ng::depcheck::manager::change_modifications(), tokenizer::char_type(), characterization_distance_direction(), unit_type::check_id(), gui2::dialogs::editor_edit_unit::check_id(), draw::circle(), ai::composite_aspect< T >::composite_aspect(), default_map_generator::config_name(), context_free_grammar_generator::context_free_grammar_generator(), editor::map_context::convert_scenario(), help::convert_to_wml(), unit_filter_impl::unit_filter_compound::create_child(), ai::composite_aspect< T >::create_facet(), gui2::create_widget_builder(), default_map_generator_job::default_generate_map(), ai::component_manager::delete_component(), draw::disc(), events::map_command_handler< Worker >::dispatch(), do_interpolation(), gui::scrollbar::draw_contents(), gui::textbox::draw_contents(), gui::menu::style::draw_row_bg(), prefs::escape(), font::escape_text(), gui2::dialogs::game_load::evaluate_summary_string(), display::fade_to(), draw::fill(), unit_filter_impl::unit_filter_compound::fill(), gui2::window::finalize(), ai::find_component(), find_ref(), fix_rename_command(), color_t::from_argb_bytes(), font::from_cairo_format(), color_t::from_hex_string(), color_t::from_rgb_string(), color_t::from_rgba_bytes(), color_t::from_rgba_string(), unit::generate_traits(), buffered_istream::get(), lua_kernel_base::get_attribute_names(), get_checksum(), preprocessor_data::get_chunk(), texture::get_color_mod(), events::console_handler::get_command_flags_description(), events::chat_command_handler::get_command_flags_description(), gui2::dialogs::gamestate_inspector::controller::get_controller(), config::get_diff(), wfl::map_callable::get_inputs(), replay::get_last_real_command(), get_noise(), wfl::variant_string::get_serialized_string(), team::get_side_color_id_from_config(), gui2::rich_label::get_split_location(), replay::get_unsent_commands(), wfl::string_callable::get_value(), gui2::event::sdl_event_handler::handle_event(), gui::textbox::handle_key_down(), config::hash(), events::map_command_handler< Worker >::help_command(), ai::impl_ai_list(), impl_color_collect(), impl_color_get(), impl_color_tostring(), in_ranges(), config::inherit_from(), unit::init(), intf_debug_ai(), intf_set_dialog_callback(), intf_set_dialog_canvas(), lua_wml::intf_wml_merge(), tokenizer::is_alnum(), wesnothd::ban_manager::is_digit(), events::console_handler::is_enabled(), events::chat_command_handler::is_enabled(), wesnothd::is_invalid_filename_char(), filesystem::is_legal_user_file_name(), tokenizer::is_num(), filesystem::is_path_sep(), is_positive_integer(), tokenizer::is_space(), campaignd::is_text_markup_char(), utils::is_username_char(), editor::is_valid_terrain(), utils::is_wildcard_char(), is_wml_separator(), utils::is_word_boundary(), IsCR(), utils::isnewline(), events::sdl_handler::join(), draw::line(), prefs::load_preferences(), ai_testing::log_turn(), markov_generate_name(), unit_animation::matches(), config::merge_with(), theme::modify(), gui2::dialogs::mp_options_helper::mp_options_helper(), needs_escaping(), gui2::dialogs::mp_join_game::network_handler(), utils::notspace(), color_t::operator!=(), std::hash< color_t >::operator()(), spirit_po::default_plural_forms::evaluator::operator()(), operator<<(), color_t::operator==(), wesnothd::server::connection_log::operator==(), gui2::implementation::parse_list_data(), help::parse_text(), cave_map_generator::cave_map_generator_job::place_chamber(), utils::portable_isspace(), gui2::dialogs::formula_debugger::pre_show(), ai::print_component(), ai::component_manager::print_component_tree(), lg::print_precise_timestamp(), mp::lobby_info::process_gamelist(), mp::lobby_info::process_gamelist_diff_impl(), mp::lobby_info::process_userlist(), events::pump(), push_component(), preprocessor_data::put(), utils::quoted_split(), rank_castle_location(), statistics_record::stats_t::read(), actions::undo_action::read_event_vector(), preprocessor_data::read_line(), preprocessor_data::read_rest_of_line(), preprocessor_data::read_word(), draw::rect(), events::map_command_handler< Worker >::register_command(), gui2::tree_view::remove_node(), gui2::toggle_button_definition::resolution::resolution(), gui2::toggle_panel_definition::resolution::resolution(), select_alternative_type(), select_replacement_type(), font::semi_escape_text(), gui2::chatbox::send_chat_message(), campaignd::server::serve_requests(), ai::typesafe_known_aspect< T >::set(), draw::set_color(), texture::set_color_mod(), display::set_fade(), team::set_objectives_changed(), gui2::progress_bar::set_percentage(), editor::editor_map::set_starting_position_labels(), cave_map_generator::cave_map_generator_job::set_terrain(), events::menu_handler::show_chat_log(), controller_base::show_menu(), editor::editor_controller::show_menu(), lua_gui2::show_message_box(), preprocessor_data::skip_eol(), preprocessor_data::skip_spaces(), color_t::smooth_blend(), game_launcher::start_wesnothd(), sound::stop_bell(), sound::stop_sound(), sound::stop_UI_sound(), t_translation::string_to_layer_(), t_string_base::t_string_base(), carryover_info::to_config(), mp_game_settings::to_config(), attack_type::to_config(), wesnothd::ban_manager::to_digit(), tokenizer::tokenizer(), replay::undo_cut(), unencode_binary(), prefs::unescape(), unit_moves(), unit_weapons(), gui2::multimenu_button::update_config_from_toggle_states(), utils::urlencode(), config::valid_tag(), campaignd::server::validate_addon(), ai::variant_value_translator< terrain_filter >::variant_to_value(), gui2::builder_window::window_resolution::window_resolution(), game_events::WML_HANDLER_FUNCTION(), mp_game_settings::addon_version_info::write(), and ucs4_convert_impl::utf8_impl::write().

◆ p

Definition at line 69 of file test_formula_core.cpp.

Referenced by unit_map::add(), config::add_child_at_total(), theme::add_object(), plugins_manager::add_plugin(), image::apply_light(), std::begin(), blur_alpha_surface(), blur_surface(), BOOST_AUTO_TEST_CASE(), spirit_po::catalog< hashmap_type, pf_compiler >::catalog(), cave_map_generator::cave_map_generator_job::cave_map_generator_job(), std::cbegin(), std::cend(), config::child_range(), game_events::event_handlers::clean_up_expired_handlers(), filesystem::binary_paths_manager::cleanup(), config::clear_diff_track(), color_blend(), rect::contains(), wfl::formula_callable::convert_map(), std::crbegin(), std::crend(), wfl::gamestate::DEFINE_WFL_FUNCTION(), wesnothd::server::delete_game(), wfl::variant_map::deref_iterator(), filesystem::dir_size(), config_attribute_value::empty(), std::end(), ai::configuration::expand_simplified_aspects(), display::fade_to(), display::fade_tod_mask(), gui2::listbox::finalize(), theme::find_element(), ai::generate_and_push_ai_table(), cave_map_generator::cave_map_generator_job::generate_chambers(), events::map_command_handler< Worker >::get_aliases(), pathfind::full_cost_map::get_average_cost_at(), gui2::dialogs::gamestate_inspector::controller::get_controller(), preprocessor_streambuf::get_current_file(), config::get_deprecated_child_range(), unit_ability_list::get_extremum(), get_filename(), ai::typesafe_aspect< T >::get_lua(), sdl::get_mouse_location(), wfl::unit_callable::get_value(), wfl::config_callable::get_value(), image::pixel_callable::get_value(), utils::string_map_variable_set< T >::get_variable_access_read(), wesnothd::server::handle_player_in_game(), campaignd::server::handle_upload(), ai::impl_ai_get(), impl_mp_settings_get(), impl_mp_settings_len(), lua_common::impl_vconfig_ipairs_collect(), lua_common::impl_vconfig_ipairs_iter(), lua_common::impl_vconfig_pairs_collect(), lua_common::impl_vconfig_pairs_iter(), impl_warn(), unit_map::insert(), lua_fileops::intf_read_file(), lua_common::intf_textdomain(), wesnothd::ban_manager::is_ip_banned(), wesnothd::server::is_login_allowed(), filesystem::is_root(), lua_fileops::load_file(), plugins_manager::load_plugin(), luaW_checkconfig(), luaW_tounittype(), luaW_toweapon(), main(), spirit_po::catalog< hashmap_type, pf_compiler >::merge(), mirror_walk(), unit_map::move(), filesystem::nearest_extant_parent(), filesystem::normalize_path(), image::adjust_alpha_modification::operator()(), image::adjust_channels_modification::operator()(), filesystem::sdl_rwops_deleter::operator()(), point::operator*(), point::operator*=(), vconfig::attribute_iterator::operator->(), vconfig::all_children_iterator::operator->(), point::operator/(), point::operator/=(), std::operator<<(), utils::shared_reference< T >::operator=(), desktop::os_version(), video::output_area(), php_crypt_blowfish_rn(), cave_map_generator::cave_map_generator_job::place_passage(), game_state::place_sides_in_preferred_locations(), image::precache_file_existence(), std::rbegin(), game_config::config_cache::read_defines_queue(), config::recursive_clear_value(), config::remove_child(), config::remove_children(), theme::remove_object(), std::rend(), unit_map::replace(), lua_fileops::resolve_filename(), display::scaled_to_zoom(), wesnothd::server::send_server_message_to_lobby(), wesnothd::server::send_to_lobby(), texture::set_draw_size(), sdl::window::set_logical_size(), utils::shared_reference< T >::shared_reference(), color_t::smooth_blend(), utils::square_parenthetical_split(), config_attribute_value::t_str(), config_attribute_value::to_bool(), mp_game_settings::to_config(), font::pango_text::to_draw_scale(), ai::try_aspect_as(), wesnothd::ban_manager::unban_group(), actions::undo_action::undo_action(), wb::side_actions::update_recruited_unit(), game_events::WML_HANDLER_FUNCTION(), statistics_record::write_str_int_map(), and gui2::widget::~widget().