15 #include <boost/test/unit_test.hpp>
31 (
"id",
"Orcish Grunt")
32 (
"random_traits",
false)
42 orc1->set_name(
"Larry");
43 orc2->set_name(
"Moe");
45 orc1->set_id(
"larry");
49 BOOST_CHECK_EQUAL(recall_man.
size(), 0);
50 BOOST_CHECK_MESSAGE(recall_man.
begin() == recall_man.
end(),
"failed begin() == end() for an empty container");
53 BOOST_CHECK_EQUAL(recall_man.
size(), 1);
54 BOOST_CHECK_MESSAGE(recall_man[0] == orc1,
"unexpected result at index [0]");
55 BOOST_CHECK_MESSAGE(recall_man.
find_if_matches_id(
"larry") == orc1,
"found something unexpected");
56 BOOST_CHECK_MESSAGE(!recall_man.
find_if_matches_id(
"moe"),
"found something unexpected");
59 BOOST_CHECK_EQUAL(recall_man.
size(), 2);
60 BOOST_CHECK_MESSAGE(recall_man[0] == orc1,
"unexpected result at index [0]");
61 BOOST_CHECK_MESSAGE(recall_man[1] == orc2,
"unexpected result at index [1]");
62 BOOST_CHECK_MESSAGE(recall_man.
find_if_matches_id(
"larry") == orc1,
"found something unexpected");
63 BOOST_CHECK_MESSAGE(recall_man.
find_if_matches_id(
"moe") == orc2,
"found something unexpected");
66 BOOST_CHECK_EQUAL(recall_man.
size(), 1);
67 BOOST_CHECK_MESSAGE(recall_man[0] == orc2,
"unexpected result at index [0]");
68 BOOST_CHECK_MESSAGE(!recall_man.
find_if_matches_id(
"larry"),
"found something unexpected");
69 BOOST_CHECK_MESSAGE(recall_man.
find_if_matches_id(
"moe") == orc2,
"found something unexpected");
72 BOOST_CHECK_EQUAL(recall_man.
size(), 2);
73 BOOST_CHECK_MESSAGE(recall_man[0] == orc2,
"unexpected result at index [0]");
74 BOOST_CHECK_MESSAGE(recall_man[1] == orc1,
"unexpected result at index [1]");
75 BOOST_CHECK_MESSAGE(recall_man.
find_if_matches_id(
"larry") == orc1,
"found something unexpected");
76 BOOST_CHECK_MESSAGE(recall_man.
find_if_matches_id(
"moe") == orc2,
"found something unexpected");
80 BOOST_AUTO_TEST_SUITE_END()
size_t size() const
Get the number of units on the list.
unit_type_data unit_types
BOOST_AUTO_TEST_SUITE(test_map_location)
Definitions for the interface to Wesnoth Markup Language (WML).
BOOST_AUTO_TEST_CASE(test_1)
unit_ptr find_if_matches_id(const std::string &unit_id)
Find a unit by id. Null pointer if not found.
iterator begin()
begin iterator
void build_unit_type(const unit_type &ut, unit_type::BUILD_STATUS status) const
Makes sure the provided unit_type is built to the specified level.
iterator end()
end iterator
void erase_if_matches_id(const std::string &unit_id)
Erase any unit with this id.
Game configuration data as global variables.
void add(const unit_ptr &ptr)
Add a unit to the list.
A config object defines a single node in a WML file, with access to child nodes.