The Battle for Wesnoth  1.15.0-dev
Classes | Macros | Functions | Variables
test_map_location.cpp File Reference
#include "utils/functional.hpp"
#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_GLOBAL_FIXTURE (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::NORTH
 
static map_location::DIRECTION ne = map_location::NORTH_EAST
 
static map_location::DIRECTION nw = map_location::NORTH_WEST
 
static map_location::DIRECTION s = map_location::SOUTH
 
static map_location::DIRECTION se = map_location::SOUTH_EAST
 
static map_location::DIRECTION sw = map_location::SOUTH_WEST
 

Macro Definition Documentation

◆ GETTEXT_DOMAIN

#define GETTEXT_DOMAIN   "wesnoth-test"

Definition at line 15 of file test_map_location.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/6]

BOOST_AUTO_TEST_CASE ( map_location_characterization_test_radial_mode  )

◆ BOOST_AUTO_TEST_CASE() [2/6]

BOOST_AUTO_TEST_CASE ( reality_check_vector_negation  )

Definition at line 276 of file test_map_location.cpp.

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

◆ BOOST_AUTO_TEST_CASE() [3/6]

BOOST_AUTO_TEST_CASE ( reality_check_get_direction  )

Definition at line 306 of file test_map_location.cpp.

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

◆ BOOST_AUTO_TEST_CASE() [4/6]

BOOST_AUTO_TEST_CASE ( check_get_opposite_dir_refactor  )

◆ BOOST_AUTO_TEST_CASE() [5/6]

BOOST_AUTO_TEST_CASE ( check_rotate  )

◆ BOOST_AUTO_TEST_CASE() [6/6]

BOOST_AUTO_TEST_CASE ( check_rotate_around_center  )

Definition at line 400 of file test_map_location.cpp.

References rotate_around_centers().

◆ BOOST_GLOBAL_FIXTURE()

BOOST_GLOBAL_FIXTURE ( MLFixture  )

Referenced by MLFixture::~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 130 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 131 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 268 of file test_map_location.cpp.

References map_location::get_opposite_dir(), 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 383 of file test_map_location.cpp.

References a, 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 24 of file test_map_location.cpp.

Referenced by pathfind::a_star_search(), add_value(), addliteral(), wesnothd::server::adminmsg_handler(), aux_lines(), auxsort(), auxupvalue(), b_str2int(), BOOST_AUTO_TEST_CASE(), breaklabel(), cave_map_generator::cave_map_generator_job::build_chamber(), byteoffset(), gui2::policy::placement::table::calculate_best_size(), ai::readonly_context_impl::calculate_moves(), simple_wml::node::check_ordered_children(), game_board::check_victory(), checkrepeated(), checktab(), config::child(), battle_context::choose_defender_weapon(), clearkeys(), clearvalues(), codepoint(), wfl::attack_map_callable::collect_possible_attacks(), constfolding(), vconfig::count_children(), ai::default_ai_context_impl::count_free_hexes_in_castle(), count_ones(), events::mouse_handler::current_unit_attacks_from(), animated< unit_frame >::cycles(), db_upvalueid(), default_map_generator_job::default_generate_map(), wfl::gamestate::DEFINE_WFL_FUNCTION(), wfl::builtins::DEFINE_WFL_FUNCTION(), DumpConstants(), DumpDebug(), DumpProtos(), DumpUpvalues(), encode_binary(), ai::ai_default_rca::move_to_targets_phase::enemies_along_path(), wfl::variant_list::equals(), wfl::formula_function_expression::execute(), wfl::variant::execute_variant(), explist(), utils::basic_string_view< charT, traits >::find(), utils::basic_string_view< charT, traits >::find_first_not_of(), utils::basic_string_view< charT, traits >::find_first_of(), utils::basic_string_view< charT, traits >::find_last_not_of(), utils::basic_string_view< charT, traits >::find_last_of(), pathfind::find_routes(), ai::default_ai_context_impl::find_targets(), ai::ai_default_rca::get_villages_phase::find_villages(), find_widget(), findgotos(), findindex(), findvararg(), finishCcall(), flood_name(), forlimit(), ai::ai_default_rca::move_to_targets_phase::form_group(), wfl::formula_function_expression::formula_function_expression(), g_read(), metrics::games(), ai::keeps_cache::get(), events::cmd_arg_parser::get_arg(), events::console_handler::get_data(), get_direction(), gui2::dialogs::file_dialog::get_filelist_selection(), get_filename(), ai::formula_ai::get_keeps(), hotkey::command_executor::get_menu_image(), get_non_transparent_portion(), get_tile_ring(), get_tiles_in_radius(), mock_party::get_value(), lua_callable::get_value(), ai::attack_analysis::get_value(), getgeneric(), events::menu_handler::has_friends(), impl_unit_attacks_next(), ai::manager::internal_evaluate_command(), lua_map_location::intf_get_direction(), intf_music_next(), game_lua_kernel::intf_scroll(), lua_gui2::intf_set_dialog_callback(), lua_gui2::intf_set_dialog_value(), io_readline(), iter_aux(), l_hashfloat(), wfl::variant_list::less_than(), game_config::library_versions_report(), ll_require(), game_config_manager::load_addons_cfg(), LoadCode(), LoadConstants(), LoadDebug(), LoadProtos(), LoadUpvalues(), lua_check_impl::lua_check(), lua_check(), lua_checkstack(), lua_isnumber(), lua_pushcclosure(), lua_rotate(), lua_tonumberx(), lua_xmove(), luaB_print(), luaB_select(), luaB_tonumber(), luaB_xpcall(), luaD_precall(), luaF_newLclosure(), luaH_getint(), luaH_getshortstr(), luaK_checkstack(), luaK_reserveregs(), luaL_prepbuffsize(), luaO_pushvfstring(), luaO_str2num(), luaO_utf8esc(), luaV_concat(), luaV_div(), luaV_execute(), luaV_mod(), luaV_tointeger(), luaW_getglobal(), luaW_getmetafield(), luaW_pushsimdata(), luaZ_read(), math_abs(), math_max(), math_min(), math_modf(), math_toint(), MLFixture::MLFixture(), modulo(), ai::ai_default_rca::move_to_targets_phase::move_group(), movegotosout(), newlabelentry(), simple_wml::node_to_string(), null_handler(), numusehash(), 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-=(), config::all_children_iterator::operator-=(), config::const_all_children_iterator::operator-=(), simple_wml::string_span::operator<(), wfl::variant::operator[](), config::child_iterator::operator[](), config::const_child_iterator::operator[](), wfl::operator_precedence(), pack(), terrain_builder::parse_config(), wfl::parse_expression(), cave_map_generator::cave_map_generator_job::place_castle(), place_village(), pushnumint(), utils::basic_string_view< charT, traits >::remove_prefix(), utils::basic_string_view< charT, traits >::remove_suffix(), metrics::requests(), resume(), utils::basic_string_view< charT, traits >::rfind(), scale_surface(), simple_wml::node::set_dirty(), preferences::editor::set_draw_num_of_bitmaps(), setnodevector(), ai::formula_ai::shortest_path_calculator(), gui2::dialogs::variable_mode_controller::show_array(), gui2::dialogs::event_mode_controller::show_event(), lua_gui2::show_message_dialog(), singlestep(), sort(), str_byte(), str_char(), str_format(), str_gsub(), str_pack(), str_rep(), str_unpack(), utils::basic_string_view< charT, traits >::substr(), tmove(), ai::lua_object< T >::to_type(), traverseephemeron(), traversestrongtable(), traverseweakvalue(), unencode_binary(), display_context::unit_can_move(), unpack(), addons_client::upload_addon(), utf8esc(), utfchar(), utflen(), map_location::vector_difference_assign(), write_str_int_map(), and ai::lua_object_base::~lua_object_base().

◆ ne

◆ nw

◆ preset_locs

std::vector<map_location> preset_locs
static

Definition at line 22 of file test_map_location.cpp.

◆ s

Definition at line 27 of file test_map_location.cpp.

Referenced by attack_type::accuracy_parry_description(), game_config::add_color_info(), theme::add_object(), add_status(), gui2::dialogs::add_unit_entry(), addliteral(), statistics::advance_unit(), unit::advancement_icons(), async_send_doc(), b_str2int(), BOOST_AUTO_TEST_CASE(), byteoffset(), gui2::dialogs::chat_log::model::chat_message_list_to_clipboard(), battle_context::choose_defender_weapon(), gui2::canvas::clear_shapes(), codepoint(), game_config::color_info(), ng::connect_engine::connect_engine(), create_compatible_surface(), ng::connect_engine::current_config(), wesnothd::game::debug_sides_info(), gui2::dialogs::describe_status_verbose(), 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(), combatant::fight(), unit_filter_impl::unit_filter_compound::fill(), display::fill_images_list(), sdl::fill_surface_rect(), utils::basic_string_view< charT, traits >::find(), utils::basic_string_view< charT, traits >::find_first_not_of(), utils::basic_string_view< charT, traits >::find_first_of(), utils::basic_string_view< charT, traits >::find_last_not_of(), utils::basic_string_view< charT, traits >::find_last_of(), utils::basic_string_view< charT, traits >::find_not_of(), pathfind::find_routes(), help::section::find_section(), help::section::find_topic(), unit_filter::first_match_on_map(), spirit_po::default_plural_forms::function_object::function_object(), g_write(), gui2::dialogs::mp_lobby::game_filter_reload(), mp::game_info::game_info(), help::generate_terrain_sections(), help::generate_weapon_special_topics(), ai::holder::get_ai_overview(), storyscreen::part::get_background_layers(), preprocessor_data::get_chunk(), get_filename(), unit::get_modification_advances(), ai::register_candidate_action_factory< CANDIDATE_ACTION >::get_new_instance(), wb::suppose_dead::get_source_hex(), wfl::tokenizer::get_token(), wfl::string_callable::get_value(), filesystem::get_version_path_suffix(), gmatch(), wesnothd::server::handle_player_in_game(), unit::has_ability_type(), vconfig::has_child(), pathfind::paths::dest_vect::insert(), ai::default_recruitment::recruitment::integrate_recruitment_pattern_in_recruitment_instructions(), game_lua_kernel::intf_find_cost_map(), game_lua_kernel::intf_find_reach(), intf_get_image_size(), game_lua_kernel::intf_get_recall_units(), filesystem::is_path_sep(), hotkey::is_scope_active(), isneg(), filesystem::istream_file(), iter_aux(), utils::join(), l_str2d(), l_str2int(), game_config::load_config(), gui2::dialogs::loading_screen::loading_screen(), utf8::lowercase(), lua_pushstring(), luaB_load(), luaB_print(), luaB_tonumber(), luaL_addvalue(), luaL_checklstring(), luaO_pushvfstring(), luaS_newudata(), luaW_getglobal(), luaW_pushtstring(), luaX_token2str(), main(), match(), MLFixture::MLFixture(), simple_wml::node::node(), spirit_po::default_plural_forms::evaluator::operator()(), config_attribute_value::string_visitor::operator()(), font::operator<<(), ai::operator<<(), t_translation::operator<<(), operator<<(), surface::operator=(), os_date(), 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(), 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(), gui2::dialogs::preferences_dialog::pre_show(), preprocessor_data::preprocessor_data(), prepstate(), dummy_action::print(), wb::attack::print(), wb::recall::print(), wb::action::print(), wb::recruit::print(), wb::move::print(), wb::suppose_dead::print(), schema_validation::class_key::print(), ai::component_manager::print_component_tree(), help::section::print_table_of_contents(), schema_validation::class_tag::printl(), ng::connect_engine::process_network_data(), wesnothd::game::process_turn(), push_captures(), preprocessor_data::push_token(), preprocessor_data::put(), statistics::read_stats(), terrain_builder::tile::rebuild_cache(), statistics::recall_unit(), ai::default_recruitment::recruitment::recruit_matches_type(), statistics::recruit_unit(), theme::remove_object(), metrics::requests(), statistics::reset_turn_stats(), utils::basic_string_view< charT, traits >::rfind(), terrain_builder::rule_matches(), editor::context_manager::save_all_maps(), scale_surface(), randomness::mt_rng::seed_random(), wfl::location_callable::serialize_to_string(), hotkey::set_active_scopes(), gui2::dialogs::simple_item_selector::set_cancel_label(), gui2::listbox::set_content_size(), lg::set_log_domain_severity(), gui2::dialogs::simple_item_selector::set_ok_label(), hotkey::set_scope_active(), schema_validation::class_tag::set_super(), gui2::dialogs::team_mode_controller::show_units(), skip_sep(), start_capture(), simple_wml::document::stats(), version_info::str(), wfl::function_expression::str(), 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(), str_byte(), str_find_aux(), str_format(), str_lower(), str_pack(), str_rep(), str_reverse(), str_sub(), str_upper(), surface::surface(), utils::basic_string_view< charT, traits >::swap(), game_config::tc_info(), config_attribute_value::to_bool(), ai::ai_composite::to_config(), ai::default_recruitment::data::to_string(), ai::lua_object< T >::to_type(), statistics::un_recall_unit(), statistics::un_recruit_unit(), ng::flg_manager::update_available_leaders(), upvalname(), utf8_decode(), utflen(), and version_info::version_info().

◆ se

◆ sw

◆ va

map_location va
static

Definition at line 23 of file test_map_location.cpp.

◆ vb

map_location vb
static

Definition at line 23 of file test_map_location.cpp.

◆ vc

map_location vc
static

Definition at line 23 of file test_map_location.cpp.

◆ vs1

map_location vs1
static

Definition at line 23 of file test_map_location.cpp.

◆ vs2

map_location vs2
static

Definition at line 23 of file test_map_location.cpp.

◆ vs3

map_location vs3
static

Definition at line 23 of file test_map_location.cpp.

◆ vs4

map_location vs4
static

Definition at line 23 of file test_map_location.cpp.

◆ vt1

map_location vt1
static

Definition at line 23 of file test_map_location.cpp.

◆ vt2

map_location vt2
static

Definition at line 23 of file test_map_location.cpp.

◆ vt3

map_location vt3
static

Definition at line 23 of file test_map_location.cpp.

◆ vz

map_location vz
static

Definition at line 23 of file test_map_location.cpp.