Author: silene
Date: Sun May 17 22:30:50 2009
New Revision: 35716
URL: http://svn.gna.org/viewcvs/wesnoth?rev=35716&view=rev
Log:
Used fast checks.
Modified:
trunk/src/tests/test_formula_ai.cpp
trunk/src/tests/utils/play_scenario.cpp
trunk/src/tests/utils/play_scenario.hpp
Modified: trunk/src/tests/test_formula_ai.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/tests/test_formula_ai.cpp?rev=35716&r1=35715&r2=35716&view=diff
==============================================================================
--- trunk/src/tests/test_formula_ai.cpp (original)
+++ trunk/src/tests/test_formula_ai.cpp Sun May 17 22:30:50 2009
@@ -32,7 +32,7 @@
scenario.play();
// Remember that map_location() handles automaticaly transition to 1
based from 0 based locations
- BOOST_CHECK_EQUAL(scenario.find_unit_loc("side_1_leader"),
map_location(14,4));
+ BOOST_CHECK_EQUAL(scenario.get_unit_id(map_location(14, 4)),
"side_1_leader");
}
Modified: trunk/src/tests/utils/play_scenario.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/tests/utils/play_scenario.cpp?rev=35716&r1=35715&r2=35716&view=diff
==============================================================================
--- trunk/src/tests/utils/play_scenario.cpp (original)
+++ trunk/src/tests/utils/play_scenario.cpp Sun May 17 22:30:50 2009
@@ -116,14 +116,17 @@
play_game(get_fake_display(), state, game_config_, no_upload);
}
- map_location play_scenario::find_unit_loc(const std::string& id)
+ std::string play_scenario::get_unit_id(const map_location &loc)
{
if (!end_pos_)
- return map_location(-133,-133);
+ return std::string();
end_position_collector* end =
static_cast<end_position_collector*>(end_pos_.get());
- return end->get_units().find(id)->first;
+ unit_map::iterator it = end->get_units().find(loc);
+ if (it == end->get_units().end())
+ return std::string();
+ return it->second.id();
}
}
Modified: trunk/src/tests/utils/play_scenario.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/tests/utils/play_scenario.hpp?rev=35716&r1=35715&r2=35716&view=diff
==============================================================================
--- trunk/src/tests/utils/play_scenario.hpp (original)
+++ trunk/src/tests/utils/play_scenario.hpp Sun May 17 22:30:50 2009
@@ -88,7 +88,7 @@
void add_formula_command(const std::string& command);
- map_location find_unit_loc(const std::string& id);
+ std::string get_unit_id(const map_location &loc);
};
}
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits