15 #define GETTEXT_DOMAIN "wesnoth-test"
17 #include <boost/test/unit_test.hpp>
34 BOOST_CHECK(
addon_name_legal(
"-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz") );
62 const char bin_escape =
'\x01';
64 const std::string raw =
"ABC \x01 DEF \x0D\x0A JKL \xFE MNO";
79 for(
const char c : raw)
81 if(
c == bin_escape || bin_special.find(
c) != std::string::npos) {
82 encoded += bin_escape;
99 const unsigned recursive_steps = 16;
102 for(
unsigned n = 0;
n < recursive_steps; ++
n) {
106 BOOST_CHECK( recursive_encoded != raw );
108 for(
unsigned n = 0;
n < recursive_steps; ++
n) {
112 BOOST_CHECK( recursive_encoded == raw );
115 BOOST_AUTO_TEST_SUITE_END()
std::string encode_binary(const std::string &str)
std::string unencode_binary(const std::string &str)
BOOST_AUTO_TEST_SUITE(test_map_location)
BOOST_AUTO_TEST_CASE(validation)
bool addon_name_legal(const std::string &name)
Checks whether an add-on id/name is legal or not.
GLsizei const GLcharARB ** string
bool addon_filename_legal(const std::string &name)
Checks whether an add-on file name is legal or not.