16 #define GETTEXT_DOMAIN "wesnoth-test"
18 #include <boost/test/unit_test.hpp>
28 BOOST_CHECK( empty.
str() ==
"0.0.0" );
33 BOOST_CHECK( dots1 == empty);
34 BOOST_CHECK( dots2.
str() ==
"0.0.0hullo" );
42 BOOST_CHECK( canonical_suffixed > canonical );
43 BOOST_CHECK( canonical < canonical_suffixed );
49 version_info non_canonical_suffixed(
"1.2.3.4.5.7.8.9+dev");
51 BOOST_CHECK( non_canonical_suffixed > non_canonical );
52 BOOST_CHECK( non_canonical < non_canonical_suffixed );
57 BOOST_CHECK( right_zero == no_right_zero );
62 BOOST_CHECK( left_zero != no_left_zero );
64 const std::string bad_version_info_string_1 =
"Viva la revoluciĆ³n!";
65 const std::string bad_version_info_string_2 =
"To infinity and beyond!";
67 const version_info bad_version_info1( bad_version_info_string_1 );
68 const version_info bad_version_info2( bad_version_info_string_2 );
70 BOOST_CHECK( bad_version_info1.
str() == (
"0.0.0"+bad_version_info_string_1) );
71 BOOST_CHECK( bad_version_info2.
str() == (
"0.0.0"+bad_version_info_string_2) );
77 BOOST_AUTO_TEST_SUITE_END()
Represents version numbers.
std::string str() const
Serializes the version number into string form.
unsigned int revision_level() const
Retrieves the revision level (x3 in "x1.x2.x3").
char special_version_separator() const
Retrieves the special version separator (e.g.
const std::string & special_version() const
Retrieves the special version suffix (e.g.
unsigned int minor_version() const
Retrieves the minor version number (x2 in "x1.x2.x3").
unsigned int major_version() const
Retrieves the major version number (x1 in "x1.x2.x3").
bool is_canonical() const
Whether the version number is considered canonical for mainline Wesnoth.
Interfaces for manipulating version numbers of engine, add-ons, etc.
BOOST_AUTO_TEST_SUITE(filesystem)
BOOST_AUTO_TEST_CASE(test_version_info)