The Battle for Wesnoth  1.19.5+dev
Classes | Macros | Functions | Variables
test_map_location.cpp File Reference
#include <functional>
#include <boost/test/unit_test.hpp>
#include "map/location.hpp"
Include dependency graph for test_map_location.cpp:

Go to the source code of this file.

Classes

struct  MLFixture
 

Macros

#define GETTEXT_DOMAIN   "wesnoth-test"
 

Functions

 BOOST_FIXTURE_TEST_SUITE (test_map_location, MLFixture)
 
static map_location vector_difference (const map_location &v1, const map_location &v2)
 
static void characterization_distance_direction (const std::vector< map_location > &locs, const std::vector< map_location::direction > &dir_answers, const std::vector< std::size_t > &int_answers, map_location::RELATIVE_DIR_MODE mode)
 
static std::size_t get_first (std::pair< std::size_t, std::string > arg)
 
static map_location::direction get_second (std::pair< std::size_t, std::string > arg)
 
 BOOST_AUTO_TEST_CASE (map_location_characterization_test_radial_mode)
 
static std::pair< map_location, map_locationmirror_walk (std::pair< map_location, map_location > p, map_location::direction d)
 
 BOOST_AUTO_TEST_CASE (reality_check_vector_negation)
 
static void reality_check_get_direction_helper (const map_location &loc, const map_location::direction d)
 
 BOOST_AUTO_TEST_CASE (reality_check_get_direction)
 
static map_location::direction legacy_get_opposite_dir (map_location::direction d)
 
 BOOST_AUTO_TEST_CASE (check_get_opposite_dir_refactor)
 
 BOOST_AUTO_TEST_CASE (check_rotate)
 
static void rotate_around_centers (const std::vector< map_location > &locs)
 
 BOOST_AUTO_TEST_CASE (check_rotate_around_center)
 

Variables

static std::vector< map_locationpreset_locs
 
static map_location va
 
static map_location vb
 
static map_location vc
 
static map_location vz
 
static map_location vt1
 
static map_location vt2
 
static map_location vt3
 
static map_location vs1
 
static map_location vs2
 
static map_location vs3
 
static map_location vs4
 
static map_location::direction n = map_location::direction::north
 
static map_location::direction ne = map_location::direction::north_east
 
static map_location::direction nw = map_location::direction::north_west
 
static map_location::direction s = map_location::direction::south
 
static map_location::direction se = map_location::direction::south_east
 
static map_location::direction sw = map_location::direction::south_west
 

Macro Definition Documentation

◆ GETTEXT_DOMAIN

#define GETTEXT_DOMAIN   "wesnoth-test"

Definition at line 16 of file test_map_location.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/6]

BOOST_AUTO_TEST_CASE ( check_get_opposite_dir_refactor  )

◆ BOOST_AUTO_TEST_CASE() [2/6]

BOOST_AUTO_TEST_CASE ( check_rotate  )

◆ BOOST_AUTO_TEST_CASE() [3/6]

BOOST_AUTO_TEST_CASE ( check_rotate_around_center  )

Definition at line 399 of file test_map_location.cpp.

References preset_locs, and rotate_around_centers().

◆ BOOST_AUTO_TEST_CASE() [4/6]

BOOST_AUTO_TEST_CASE ( map_location_characterization_test_radial_mode  )

◆ BOOST_AUTO_TEST_CASE() [5/6]

BOOST_AUTO_TEST_CASE ( reality_check_get_direction  )

Definition at line 305 of file test_map_location.cpp.

References b, n, ne, nw, reality_check_get_direction_helper(), s, se, and sw.

◆ BOOST_AUTO_TEST_CASE() [6/6]

BOOST_AUTO_TEST_CASE ( reality_check_vector_negation  )

Definition at line 275 of file test_map_location.cpp.

References mirror_walk(), n, ne, nw, p, s, se, sw, and vz.

◆ BOOST_FIXTURE_TEST_SUITE()

BOOST_FIXTURE_TEST_SUITE ( test_map_location  ,
MLFixture   
)

◆ characterization_distance_direction()

static void characterization_distance_direction ( const std::vector< map_location > &  locs,
const std::vector< map_location::direction > &  dir_answers,
const std::vector< std::size_t > &  int_answers,
map_location::RELATIVE_DIR_MODE  mode 
)
static

◆ get_first()

static std::size_t get_first ( std::pair< std::size_t, std::string >  arg)
static

Definition at line 129 of file test_map_location.cpp.

Referenced by BOOST_AUTO_TEST_CASE().

◆ get_second()

static map_location::direction get_second ( std::pair< std::size_t, std::string >  arg)
static

Definition at line 130 of file test_map_location.cpp.

References map_location::parse_direction().

Referenced by BOOST_AUTO_TEST_CASE().

◆ legacy_get_opposite_dir()

static map_location::direction legacy_get_opposite_dir ( map_location::direction  d)
static

◆ mirror_walk()

static std::pair<map_location , map_location> mirror_walk ( std::pair< map_location, map_location p,
map_location::direction  d 
)
static

Definition at line 267 of file test_map_location.cpp.

References d, map_location::get_opposite_direction(), and p.

Referenced by BOOST_AUTO_TEST_CASE().

◆ reality_check_get_direction_helper()

static void reality_check_get_direction_helper ( const map_location loc,
const map_location::direction  d 
)
static

◆ rotate_around_centers()

static void rotate_around_centers ( const std::vector< map_location > &  locs)
static

Definition at line 382 of file test_map_location.cpp.

References b, and map_location::rotate_right_around_center().

Referenced by BOOST_AUTO_TEST_CASE().

◆ vector_difference()

static map_location vector_difference ( const map_location v1,
const map_location v2 
)
static

Variable Documentation

◆ n

Definition at line 25 of file test_map_location.cpp.

Referenced by _n(), pathfind::a_star_search(), wesnothd::server::adminmsg_handler(), events::cmd_arg_parser::advance_to_arg(), BOOST_AUTO_TEST_CASE(), gui2::policy::placement::table::calculate_best_size(), gui2::dialogs::campaign_selection::campaign_selected(), simple_wml::node::check_ordered_children(), replay::command(), simple_wml::node::copy_into(), vconfig::count_children(), count_leading_ones(), count_leading_zeros(), events::mouse_handler::current_unit_attacks_from(), default_map_generator_job::default_generate_map(), wfl::builtins::DEFINE_WFL_FUNCTION(), wfl::gamestate::DEFINE_WFL_FUNCTION(), prefs::do_commit_editor_mru(), translation::dsngettext(), encode_binary(), sound::enumerate_drivers(), video::enumerate_drivers(), wfl::variant_list::equals(), wfl::formula_function_expression::execute(), wfl::variant::execute_variant(), schema_validation::extra_tag_error(), find_child_by_index(), pathfind::find_routes(), ai::default_ai_context_impl::find_targets(), find_widget_impl(), fixed_point_to_int(), float_to_color(), ai::ai_default_rca::move_to_targets_phase::form_group(), wfl::formula_function_expression::formula_function_expression(), metrics::games(), lua_object_traits< schedule_tag >::get(), lua_object_traits< team >::get(), lua_object_traits< unit_type >::get(), events::cmd_arg_parser::get_arg(), events::cmd_arg_parser::get_data(), events::console_handler::get_data(), map_location::get_direction(), display_direction::get_direction(), gui2::dialogs::file_dialog::get_filelist_selection(), get_filename(), get_non_transparent_portion(), get_tile_ring(), get_tiles_in_radius(), lua_callable::get_value(), mock_party::get_value(), ai::attack_analysis::get_value(), impl_unit_attacks_next(), impl_version_get(), ai::manager::internal_evaluate_command(), lua_map_location::intf_get_direction(), game_lua_kernel::intf_get_label(), lua_wml::intf_load_wml(), intf_music_next(), lua_mathx::intf_round(), team::is_enemy(), wfl::variant_list::less_than(), gui2::dialogs::unit_create::list_item_clicked(), game_config_manager::load_addons_cfg(), lua_check(), lua_check_impl::lua_check(), lua_check_impl::lua_push(), lua_check_impl::lua_to_or_default(), lua_to_or_default(), luaW_checkvariable(), luaW_checkwidget(), luaW_checkwidget_ptr(), luaW_getmetafield(), luaW_pushsimdata(), luaW_toboolean(), luaW_tocubeloc(), config::mandatory_child(), schema_validation::wml_type_list::matches(), schema_validation::missing_tag_error(), MLFixture::MLFixture(), modulo(), ai::ai_default_rca::move_to_targets_phase::move_group(), simple_wml::node_to_string(), unit::upkeep_parser_visitor::operator()(), spirit_po::default_plural_forms::function_object::operator()(), config::all_children_iterator::operator+=(), config::const_all_children_iterator::operator+=(), config::child_iterator::operator+=(), config::const_child_iterator::operator+=(), config::all_children_iterator::operator-=(), config::const_all_children_iterator::operator-=(), config::child_iterator::operator-=(), config::const_child_iterator::operator-=(), simple_wml::string_span::operator<(), wesnothd::operator<<(), config::all_children_iterator::operator[](), config::const_all_children_iterator::operator[](), config::child_iterator::operator[](), config::const_child_iterator::operator[](), wfl::variant::operator[](), campaignd::control_line::operator[](), wfl::operator_precedence(), config::optional_child(), terrain_builder::parse_config(), markup::parse_entity(), wfl::parse_expression(), wesnothd::player::player(), metrics::requests(), scale_surface(), simple_wml::node::set_dirty(), ai::formula_ai::shortest_path_calculator(), gui2::dialogs::variable_mode_controller::show_array(), gui2::dialogs::unit_mode_controller::show_array(), gui2::dialogs::team_mode_controller::show_array(), gui2::dialogs::event_mode_controller::show_event(), lua_gui2::show_message_dialog(), translation::sngettext(), gamemap_base::starting_position(), gamemap_base::starting_positions(), ai::lua_object< T >::store(), gui2::dialogs::tally(), utils::to_sql_wildcards(), ai::lua_object< T >::to_type(), unencode_binary(), ai::unit_advancements_aspect::unit_advancements_aspect(), unit_race::unit_race(), game_events::builtin_conditions::variable_matches(), and statistics_record::write_str_int_map().

◆ ne

◆ nw

◆ preset_locs

std::vector<map_location> preset_locs
static

Definition at line 23 of file test_map_location.cpp.

Referenced by BOOST_AUTO_TEST_CASE(), and MLFixture::MLFixture().

◆ s

Definition at line 28 of file test_map_location.cpp.

Referenced by attack_type::accuracy_parry_description(), game_config::add_color_info(), theme::add_object(), help::section::add_section(), add_status(), gui::textbox::add_text_line(), gui2::dialogs::add_unit_entry(), statistics_t::advance_unit(), unit::advancement_icons(), BOOST_AUTO_TEST_CASE(), calculate_fps(), ng::depcheck::manager::change_modifications(), gui2::dialogs::chat_log::model::chat_message_list_to_clipboard(), gui2::canvas::clear_shapes(), game_config::color_info(), server_base::coro_send_doc(), prefs::countdown_action_bonus(), prefs::countdown_init_time(), prefs::countdown_reservoir_time(), prefs::countdown_turn_bonus(), wesnothd::game::debug_sides_info(), gui2::dialogs::describe_status_verbose(), wfl::attack_type_callable::do_compare(), ai::attack_result::do_describe(), ai::move_result::do_describe(), ai::recall_result::do_describe(), ai::recruit_result::do_describe(), ai::stopunit_result::do_describe(), ai::synced_command_result::do_describe(), ai::synced_command_result::do_execute(), ng::depcheck::manager::does_conflict(), display::draw_hex(), combatant::fight(), unit_filter_impl::unit_filter_compound::fill(), display::fill_images_list(), pathfind::find_routes(), help::find_section(), help::find_topic(), flush(), gui2::dialogs::mp_lobby::game_filter_init(), mp::game_info::game_info(), help::generate_contents_links(), unit::generate_traits(), help::generate_weapon_special_topics(), ai::holder::get_ai_overview(), gui2::dialogs::lua_interpreter::lua_model::get_attribute_names(), preprocessor_data::get_chunk(), display_direction::get_direction(), get_filename(), help::get_first_word(), unit::get_modification_advances(), unit_frame::get_overlaped_hex(), game_display::get_reachmap_images(), image::get_size(), wfl::tokenizer::get_token(), wfl::string_callable::get_value(), filesystem::get_version_path_suffix(), wesnothd::server::handle_graceful_timeout(), network_asio::connection::handle_handshake(), wesnothd_connection::handle_handshake(), gui::textbox::handle_key_down(), wesnothd::server::handle_player(), wesnothd::server::handle_player_in_game(), gui::textbox::handle_text_input(), lua_common::impl_gettext_tostr(), impl_unit_status_dir(), pathfind::paths::dest_vect::insert(), ai::default_recruitment::recruitment::integrate_recruitment_pattern_in_recruitment_instructions(), game_lua_kernel::intf_add_event(), game_lua_kernel::intf_find_cost_map(), game_lua_kernel::intf_find_reach(), intf_get_image_size(), game_lua_kernel::intf_get_recall_units(), intf_mg_get_locations(), intf_mg_get_tiles_radius(), is_handled_file_tag(), is_installed_addon_status(), wesnothd::server::is_login_allowed(), filesystem::is_path_sep(), hotkey::is_scope_active(), filesystem::istream_file(), utils::join(), LATTR_GETTER(), wesnothd::server::load_config(), team_builder::log_step(), utf8::lowercase(), lua_map_generator::lua_map_generator(), luaW_getglobal(), main(), mapgen_gamemap::mapgen_gamemap(), MLFixture::MLFixture(), simple_wml::node::node(), help::has_id::operator()(), ai::lua_aspect_visitor::operator()(), config_attribute_value::string_visitor::operator()(), wfl::fai_variant_visitor::operator()(), unit::upkeep_parser_visitor::operator()(), ai::leader_aspects_visitor::operator()(), point::operator*(), rect::operator*(), point::operator*=(), rect::operator*=(), point::operator/(), rect::operator/(), point::operator/=(), rect::operator/=(), simple_wml::operator<<(), wb::operator<<(), operator<<(), ai::operator<<(), utils::operator<<(), image::operator<<(), t_translation::operator<<(), surface::operator=(), font::pango_line_size(), markup::parse_attribute(), markup::parse_entity(), markup::parse_name(), markup::parse_text_until(), commandline_options::parse_to_uint_string_string_tuples_(), commandline_options::parse_to_uint_string_tuples_(), php_crypt_blowfish_rn(), display::pixel_position_to_hex(), playsingle_controller::play_scenario_init(), ai::ai_composite::play_turn(), gui2::dialogs::chat_log::model::populate_chat_message_list(), gui2::dialogs::generator_settings::pre_show(), gui2::dialogs::faction_select::pre_show(), image::prep_minimap_for_rendering(), preprocessor_data::preprocessor_data(), schema_validation::wml_key::print(), dummy_action::print(), wb::attack::print(), wb::move::print(), wb::recall::print(), wb::recruit::print(), wb::suppose_dead::print(), wb::action::print(), help::print_behavior_description(), ai::print_component(), ai::component_manager::print_component_tree(), schema_validation::wml_tag::printl(), ng::connect_engine::process_network_data(), wesnothd::game::process_turn(), preprocessor_data::push_token(), preprocessor_data::put(), ai::lua_aspect_visitor::quote_string(), statistics_record::campaign_stats_t::read(), video::read_pixels(), video::read_pixels_low_res(), terrain_builder::tile::rebuild_cache(), statistics_t::recall_unit(), ai::default_recruitment::recruitment::recruit_matches_type(), statistics_t::recruit_unit(), unit_drawer::redraw_unit(), theme::remove_object(), wesnothd::server::remove_player(), terrain_builder::replace_rotate_tokens(), REPORT_GENERATOR(), metrics::requests(), statistics_t::reset_turn_stats(), wesnothd::server::restart_handler(), terrain_builder::rule_matches(), scale_surface(), randomness::mt_rng::seed_random(), wfl::location_callable::serialize_to_string(), gui2::dialogs::simple_item_selector::set_cancel_label(), gui2::listbox::set_content_size(), prefs::set_countdown_action_bonus(), prefs::set_countdown_init_time(), prefs::set_countdown_reservoir_time(), prefs::set_countdown_turn_bonus(), lg::set_log_domain_severity(), schema_validation::wml_tag::set_max(), schema_validation::wml_tag::set_min(), gui2::dialogs::simple_item_selector::set_ok_label(), schema_validation::wml_tag::set_super(), gui2::dialogs::team_mode_controller::show_units(), wesnothd::server::shut_down_handler(), utils::split(), utils::split_foreach(), utils::split_foreach_impl(), gui2::rich_label::split_in_width(), utils::split_set(), utils::split_view(), simple_wml::document::stats(), wfl::list_expression::str(), wfl::map_expression::str(), wfl::unary_operator_expression::str(), wfl::dot_expression::str(), wfl::square_bracket_expression::str(), wfl::operator_expression::str(), wfl::where_expression::str(), wfl::integer_expression::str(), wfl::decimal_expression::str(), wfl::function_expression::str(), version_info::str(), gui2::dialogs::chat_log::model::stream_log(), storyscreen::part::string_tblock_loc(), surface::surface(), game_config::tc_info(), ai::ai_composite::to_config(), map_location::to_cubic(), ai::default_recruitment::data::to_string(), ai::lua_object< T >::to_type(), utils::trim(), statistics_t::un_recall_unit(), statistics_t::un_recruit_unit(), ng::flg_manager::update_available_leaders(), gui2::canvas::update_blur(), display::update_fps_count(), verify(), version_info::version_info(), wesnothd_connection::wait_for_handshake(), draw_manager::wait_for_vsync(), wesnoth_global_fixture::wesnoth_global_fixture(), WIDGET_GETTER(), and metrics::~metrics().

◆ se

◆ sw

◆ va

map_location va
static

Definition at line 24 of file test_map_location.cpp.

Referenced by MLFixture::MLFixture().

◆ vb

map_location vb
static

Definition at line 24 of file test_map_location.cpp.

Referenced by MLFixture::MLFixture().

◆ vc

map_location vc
static

Definition at line 24 of file test_map_location.cpp.

Referenced by MLFixture::MLFixture().

◆ vs1

map_location vs1
static

Definition at line 24 of file test_map_location.cpp.

Referenced by MLFixture::MLFixture().

◆ vs2

map_location vs2
static

Definition at line 24 of file test_map_location.cpp.

Referenced by MLFixture::MLFixture().

◆ vs3

map_location vs3
static

Definition at line 24 of file test_map_location.cpp.

Referenced by MLFixture::MLFixture().

◆ vs4

map_location vs4
static

Definition at line 24 of file test_map_location.cpp.

Referenced by MLFixture::MLFixture().

◆ vt1

map_location vt1
static

Definition at line 24 of file test_map_location.cpp.

Referenced by MLFixture::MLFixture().

◆ vt2

map_location vt2
static

Definition at line 24 of file test_map_location.cpp.

Referenced by MLFixture::MLFixture().

◆ vt3

map_location vt3
static

Definition at line 24 of file test_map_location.cpp.

Referenced by MLFixture::MLFixture().

◆ vz

map_location vz
static