#include <boost/test/unit_test.hpp>
#include <sstream>
#include "game_config.hpp"
#include "game_config_view.hpp"
#include "config_cache.hpp"
#include "config.hpp"
#include "color_range.hpp"
#include "picture.hpp"
#include "image_modifications.hpp"
#include "log.hpp"
#include "filesystem.hpp"
Go to the source code of this file.
Macros | |
#define | GETTEXT_DOMAIN "wesnoth-test" |
Functions | |
BOOST_AUTO_TEST_CASE (test_modificaiton_queue_order) | |
Tests if modifications with a higher priority are placed before the others. More... | |
BOOST_AUTO_TEST_CASE (test_tc_modification_decoding) | |
Tests if the TC modification is correctly decoded. More... | |
BOOST_AUTO_TEST_CASE (test_tc_modification_decoding_invalid_args) | |
Tests if the TC modification with invalid arguments is ignored. More... | |
BOOST_AUTO_TEST_CASE (test_rc_modification_decoding) | |
Tests if the RC modification is correctly decoded. More... | |
BOOST_AUTO_TEST_CASE (test_rc_modification_decoding_invalid_args) | |
Tests if the RC modification with invalid arguments is ignored. More... | |
BOOST_AUTO_TEST_CASE (test_pal_modification_decoding) | |
Tests if the PAL modification is correctly decoded. More... | |
BOOST_AUTO_TEST_CASE (test_pal_modification_decoding_invalid_args) | |
Tests if the PAL modification with invalid arguments is ignored. More... | |
BOOST_AUTO_TEST_CASE (test_fl_modification_decoding_default) | |
Tests if the FL modification is correctly decoded without arguments. More... | |
BOOST_AUTO_TEST_CASE (test_fl_modification_decoding_horiz) | |
Tests if the FL modification is correctly decoded with the horiz argument. More... | |
BOOST_AUTO_TEST_CASE (test_fl_modification_decoding_vert) | |
Tests if the FL modification is correctly decoded with the vert argument. More... | |
BOOST_AUTO_TEST_CASE (test_fl_modification_decoding_horiz_and_vert) | |
Tests if the FL modification is correctly decoded with both horiz and vert. More... | |
BOOST_AUTO_TEST_CASE (test_gs_modification_decoding) | |
Tests if the GS modification is correctly decoded. More... | |
BOOST_AUTO_TEST_CASE (test_crop_modification_decoding_no_args) | |
Tests if the CROP modification without arguments is ignored. More... | |
BOOST_AUTO_TEST_CASE (test_crop_modification_decoding_1_arg) | |
Tests if the CROP modification is correctly decoded when given one argument. More... | |
BOOST_AUTO_TEST_CASE (test_crop_modification_decoding_2_args) | |
Tests if the CROP modification is correctly decoded when given two args. More... | |
BOOST_AUTO_TEST_CASE (test_crop_modification_decoding_3_args) | |
Tests if the CROP modification is correctly decoded when given three args. More... | |
BOOST_AUTO_TEST_CASE (test_crop_modification_decoding_4_args) | |
Tests if the CROP modification is correctly decoded when given four args. More... | |
BOOST_AUTO_TEST_CASE (test_blit_modification_decoding_1_arg) | |
Tests if the BLIT modification with one argument is correctly decoded. More... | |
BOOST_AUTO_TEST_CASE (test_blit_modification_decoding_3_args) | |
Tests if the BLIT modification with three arguments is correctly decoded. More... | |
BOOST_AUTO_TEST_CASE (test_blit_modification_decoding_invalid_args) | |
Tests if the BLIT modification with invalid arguments is ignored. More... | |
BOOST_AUTO_TEST_CASE (test_mask_modification_decoding_1_arg) | |
Tests if the MASK modification with one argument is correctly decoded. More... | |
BOOST_AUTO_TEST_CASE (test_mask_modification_decoding_3_args) | |
Tests if the MASK modification with three arguments is correctly decoded. More... | |
BOOST_AUTO_TEST_CASE (test_mask_modification_decoding_invalid_args) | |
Tests if the MASK modification with invalid arguments is ignored. More... | |
BOOST_AUTO_TEST_CASE (test_l_modification_decoding_no_args) | |
Tests if the L modification without arguments is ignored. More... | |
BOOST_AUTO_TEST_CASE (test_l_modification_decoding_1_arg) | |
Tests if the L modification with one argument is correctly decoded. More... | |
BOOST_AUTO_TEST_CASE (test_scale_modification_decoding_no_args) | |
Tests if the SCALE modification without arguments is ignored. More... | |
BOOST_AUTO_TEST_CASE (test_scale_modification_decoding_1_arg) | |
Tests if the SCALE modification with one argument is correctly decoded. More... | |
BOOST_AUTO_TEST_CASE (test_scale_modification_decoding_2_args) | |
Tests if the SCALE modification with two arguments is correctly decoded. More... | |
BOOST_AUTO_TEST_CASE (test_o_modification_decoding_percent_args) | |
Tests if the O modification with a percent argument is correctly decoded. More... | |
BOOST_AUTO_TEST_CASE (test_o_modification_decoding_fraction_args) | |
Tests if the O modification with a fraction argument is correctly decoded. More... | |
BOOST_AUTO_TEST_CASE (test_bl_modification_decoding_no_args) | |
Tests if the BL modification without arguments is correctly decoded. More... | |
BOOST_AUTO_TEST_CASE (test_bl_modification_decoding) | |
Tests if the BL modification with one argument is correctly decoded. More... | |
BOOST_AUTO_TEST_CASE (test_rgb_modification_decoding_no_args) | |
Tests if the R, G and B modifications without args are correctly decoded. More... | |
BOOST_AUTO_TEST_CASE (test_r_modification_decoding) | |
Tests if the R modification with one argument is correctly decoded. More... | |
BOOST_AUTO_TEST_CASE (test_g_modification_decoding) | |
Tests if the G modification with one argument is correctly decoded. More... | |
BOOST_AUTO_TEST_CASE (test_b_modification_decoding) | |
Tests if the B modification with one argument is correctly decoded. More... | |
BOOST_AUTO_TEST_CASE (test_bg_modification_decoding_no_args) | |
Tests if the BG modification without arguments is correctly decoded. More... | |
BOOST_AUTO_TEST_CASE (test_bg_modification_decoding_1_arg) | |
Tests if the BG modification with one argument is correctly decoded. More... | |
BOOST_AUTO_TEST_CASE (test_bg_modification_decoding_2_args) | |
Tests if the BG modification with two arguments is correctly decoded. More... | |
BOOST_AUTO_TEST_CASE (test_bg_modification_decoding_3_args) | |
Tests if the BG modification with three arguments is correctly decoded. More... | |
BOOST_AUTO_TEST_CASE (test_bg_modification_decoding_4_args) | |
Tests if the BG modification with four arguments is correctly decoded. More... | |
#define GETTEXT_DOMAIN "wesnoth-test" |
Definition at line 16 of file test_image_modifications.cpp.
BOOST_AUTO_TEST_CASE | ( | test_b_modification_decoding | ) |
Tests if the B modification with one argument is correctly decoded.
Definition at line 774 of file test_image_modifications.cpp.
References image::modification::decode(), image::cs_modification::get_b(), image::cs_modification::get_g(), image::cs_modification::get_r(), image::modification_queue::size(), and image::modification_queue::top().
BOOST_AUTO_TEST_CASE | ( | test_bg_modification_decoding_1_arg | ) |
Tests if the BG modification with one argument is correctly decoded.
Definition at line 813 of file test_image_modifications.cpp.
References image::modification::decode(), image::background_modification::get_color(), image::modification_queue::size(), and image::modification_queue::top().
BOOST_AUTO_TEST_CASE | ( | test_bg_modification_decoding_2_args | ) |
Tests if the BG modification with two arguments is correctly decoded.
Definition at line 833 of file test_image_modifications.cpp.
References image::modification::decode(), image::background_modification::get_color(), image::modification_queue::size(), and image::modification_queue::top().
BOOST_AUTO_TEST_CASE | ( | test_bg_modification_decoding_3_args | ) |
Tests if the BG modification with three arguments is correctly decoded.
Definition at line 853 of file test_image_modifications.cpp.
References image::modification::decode(), image::background_modification::get_color(), image::modification_queue::size(), and image::modification_queue::top().
BOOST_AUTO_TEST_CASE | ( | test_bg_modification_decoding_4_args | ) |
Tests if the BG modification with four arguments is correctly decoded.
Definition at line 873 of file test_image_modifications.cpp.
References image::modification::decode(), image::background_modification::get_color(), image::modification_queue::size(), and image::modification_queue::top().
BOOST_AUTO_TEST_CASE | ( | test_bg_modification_decoding_no_args | ) |
Tests if the BG modification without arguments is correctly decoded.
Definition at line 793 of file test_image_modifications.cpp.
References image::modification::decode(), image::background_modification::get_color(), image::modification_queue::size(), and image::modification_queue::top().
BOOST_AUTO_TEST_CASE | ( | test_bl_modification_decoding | ) |
Tests if the BL modification with one argument is correctly decoded.
Definition at line 694 of file test_image_modifications.cpp.
References image::modification::decode(), image::bl_modification::get_depth(), image::modification_queue::size(), and image::modification_queue::top().
BOOST_AUTO_TEST_CASE | ( | test_bl_modification_decoding_no_args | ) |
Tests if the BL modification without arguments is correctly decoded.
Definition at line 677 of file test_image_modifications.cpp.
References image::modification::decode(), image::bl_modification::get_depth(), image::modification_queue::size(), and image::modification_queue::top().
BOOST_AUTO_TEST_CASE | ( | test_blit_modification_decoding_1_arg | ) |
Tests if the BLIT modification with one argument is correctly decoded.
Definition at line 451 of file test_image_modifications.cpp.
References image::modification::decode(), image::blit_modification::get_surface(), image::blit_modification::get_x(), image::blit_modification::get_y(), image::modification_queue::size(), and image::modification_queue::top().
BOOST_AUTO_TEST_CASE | ( | test_blit_modification_decoding_3_args | ) |
Tests if the BLIT modification with three arguments is correctly decoded.
Definition at line 473 of file test_image_modifications.cpp.
References image::modification::decode(), image::blit_modification::get_surface(), image::blit_modification::get_x(), image::blit_modification::get_y(), image::modification_queue::size(), and image::modification_queue::top().
BOOST_AUTO_TEST_CASE | ( | test_blit_modification_decoding_invalid_args | ) |
Tests if the BLIT modification with invalid arguments is ignored.
Definition at line 492 of file test_image_modifications.cpp.
References image::modification::decode(), and image::modification_queue::size().
BOOST_AUTO_TEST_CASE | ( | test_crop_modification_decoding_1_arg | ) |
Tests if the CROP modification is correctly decoded when given one argument.
Definition at line 360 of file test_image_modifications.cpp.
References image::modification::decode(), image::crop_modification::get_slice(), image::modification_queue::size(), and image::modification_queue::top().
BOOST_AUTO_TEST_CASE | ( | test_crop_modification_decoding_2_args | ) |
Tests if the CROP modification is correctly decoded when given two args.
Definition at line 382 of file test_image_modifications.cpp.
References image::modification::decode(), image::crop_modification::get_slice(), image::modification_queue::size(), and image::modification_queue::top().
BOOST_AUTO_TEST_CASE | ( | test_crop_modification_decoding_3_args | ) |
Tests if the CROP modification is correctly decoded when given three args.
Definition at line 404 of file test_image_modifications.cpp.
References image::modification::decode(), image::crop_modification::get_slice(), image::modification_queue::size(), and image::modification_queue::top().
BOOST_AUTO_TEST_CASE | ( | test_crop_modification_decoding_4_args | ) |
Tests if the CROP modification is correctly decoded when given four args.
Definition at line 426 of file test_image_modifications.cpp.
References image::modification::decode(), image::crop_modification::get_slice(), image::modification_queue::size(), and image::modification_queue::top().
BOOST_AUTO_TEST_CASE | ( | test_crop_modification_decoding_no_args | ) |
Tests if the CROP modification without arguments is ignored.
Definition at line 350 of file test_image_modifications.cpp.
References image::modification::decode(), and image::modification_queue::size().
BOOST_AUTO_TEST_CASE | ( | test_fl_modification_decoding_default | ) |
Tests if the FL modification is correctly decoded without arguments.
Definition at line 263 of file test_image_modifications.cpp.
References image::modification::decode(), image::fl_modification::get_horiz(), image::fl_modification::get_vert(), image::modification_queue::size(), and image::modification_queue::top().
BOOST_AUTO_TEST_CASE | ( | test_fl_modification_decoding_horiz | ) |
Tests if the FL modification is correctly decoded with the horiz argument.
Definition at line 281 of file test_image_modifications.cpp.
References image::modification::decode(), image::fl_modification::get_horiz(), image::fl_modification::get_vert(), image::modification_queue::size(), and image::modification_queue::top().
BOOST_AUTO_TEST_CASE | ( | test_fl_modification_decoding_horiz_and_vert | ) |
Tests if the FL modification is correctly decoded with both horiz and vert.
Definition at line 317 of file test_image_modifications.cpp.
References image::modification::decode(), image::fl_modification::get_horiz(), image::fl_modification::get_vert(), image::modification_queue::size(), and image::modification_queue::top().
BOOST_AUTO_TEST_CASE | ( | test_fl_modification_decoding_vert | ) |
Tests if the FL modification is correctly decoded with the vert argument.
Definition at line 299 of file test_image_modifications.cpp.
References image::modification::decode(), image::fl_modification::get_horiz(), image::fl_modification::get_vert(), image::modification_queue::size(), and image::modification_queue::top().
BOOST_AUTO_TEST_CASE | ( | test_g_modification_decoding | ) |
Tests if the G modification with one argument is correctly decoded.
Definition at line 755 of file test_image_modifications.cpp.
References image::modification::decode(), image::cs_modification::get_b(), image::cs_modification::get_g(), image::cs_modification::get_r(), image::modification_queue::size(), and image::modification_queue::top().
BOOST_AUTO_TEST_CASE | ( | test_gs_modification_decoding | ) |
Tests if the GS modification is correctly decoded.
Definition at line 335 of file test_image_modifications.cpp.
References image::modification::decode(), image::modification_queue::size(), and image::modification_queue::top().
BOOST_AUTO_TEST_CASE | ( | test_l_modification_decoding_1_arg | ) |
Tests if the L modification with one argument is correctly decoded.
Definition at line 578 of file test_image_modifications.cpp.
References image::modification::decode(), image::light_modification::get_surface(), image::modification_queue::size(), and image::modification_queue::top().
BOOST_AUTO_TEST_CASE | ( | test_l_modification_decoding_no_args | ) |
Tests if the L modification without arguments is ignored.
Definition at line 565 of file test_image_modifications.cpp.
References image::modification::decode(), and image::modification_queue::size().
BOOST_AUTO_TEST_CASE | ( | test_mask_modification_decoding_1_arg | ) |
Tests if the MASK modification with one argument is correctly decoded.
Definition at line 510 of file test_image_modifications.cpp.
References image::modification::decode(), image::mask_modification::get_mask(), image::mask_modification::get_x(), image::mask_modification::get_y(), image::modification_queue::size(), and image::modification_queue::top().
BOOST_AUTO_TEST_CASE | ( | test_mask_modification_decoding_3_args | ) |
Tests if the MASK modification with three arguments is correctly decoded.
Definition at line 532 of file test_image_modifications.cpp.
References image::modification::decode(), image::mask_modification::get_mask(), image::mask_modification::get_x(), image::mask_modification::get_y(), image::modification_queue::size(), and image::modification_queue::top().
BOOST_AUTO_TEST_CASE | ( | test_mask_modification_decoding_invalid_args | ) |
Tests if the MASK modification with invalid arguments is ignored.
Definition at line 551 of file test_image_modifications.cpp.
References image::modification::decode(), and image::modification_queue::size().
BOOST_AUTO_TEST_CASE | ( | test_modificaiton_queue_order | ) |
Tests if modifications with a higher priority are placed before the others.
The RC modification has a higher priority than other modifications and has to be applied before all the others. This test checks if that order is taken care of by the queue.
Definition at line 120 of file test_image_modifications.cpp.
References image::modification_queue::pop(), image::modification_queue::push(), image::modification_queue::size(), and image::modification_queue::top().
BOOST_AUTO_TEST_CASE | ( | test_o_modification_decoding_fraction_args | ) |
Tests if the O modification with a fraction argument is correctly decoded.
Definition at line 659 of file test_image_modifications.cpp.
References image::modification::decode(), image::o_modification::get_opacity(), image::modification_queue::size(), and image::modification_queue::top().
BOOST_AUTO_TEST_CASE | ( | test_o_modification_decoding_percent_args | ) |
Tests if the O modification with a percent argument is correctly decoded.
Definition at line 641 of file test_image_modifications.cpp.
References image::modification::decode(), image::o_modification::get_opacity(), image::modification_queue::size(), and image::modification_queue::top().
BOOST_AUTO_TEST_CASE | ( | test_pal_modification_decoding | ) |
Tests if the PAL modification is correctly decoded.
Definition at line 224 of file test_image_modifications.cpp.
References image::modification::decode(), i, image::rc_modification::map(), image::modification_queue::size(), game_config::tc_info(), and image::modification_queue::top().
BOOST_AUTO_TEST_CASE | ( | test_pal_modification_decoding_invalid_args | ) |
Tests if the PAL modification with invalid arguments is ignored.
Definition at line 252 of file test_image_modifications.cpp.
References image::modification::decode(), and image::modification_queue::size().
BOOST_AUTO_TEST_CASE | ( | test_r_modification_decoding | ) |
Tests if the R modification with one argument is correctly decoded.
Definition at line 736 of file test_image_modifications.cpp.
References image::modification::decode(), image::cs_modification::get_b(), image::cs_modification::get_g(), image::cs_modification::get_r(), image::modification_queue::size(), and image::modification_queue::top().
BOOST_AUTO_TEST_CASE | ( | test_rc_modification_decoding | ) |
Tests if the RC modification is correctly decoded.
Definition at line 193 of file test_image_modifications.cpp.
References game_config::color_info(), image::modification::decode(), image::rc_modification::map(), recolor_range(), image::modification_queue::size(), game_config::tc_info(), and image::modification_queue::top().
BOOST_AUTO_TEST_CASE | ( | test_rc_modification_decoding_invalid_args | ) |
Tests if the RC modification with invalid arguments is ignored.
Definition at line 214 of file test_image_modifications.cpp.
References image::modification::decode(), and image::modification_queue::size().
BOOST_AUTO_TEST_CASE | ( | test_rgb_modification_decoding_no_args | ) |
Tests if the R, G and B modifications without args are correctly decoded.
Definition at line 711 of file test_image_modifications.cpp.
References image::modification::decode(), image::cs_modification::get_b(), image::cs_modification::get_g(), image::cs_modification::get_r(), i, image::modification_queue::pop(), image::modification_queue::size(), and image::modification_queue::top().
BOOST_AUTO_TEST_CASE | ( | test_scale_modification_decoding_1_arg | ) |
Tests if the SCALE modification with one argument is correctly decoded.
Definition at line 605 of file test_image_modifications.cpp.
References image::modification::decode(), image::scale_modification::get_h(), image::scale_modification::get_w(), image::modification_queue::size(), and image::modification_queue::top().
BOOST_AUTO_TEST_CASE | ( | test_scale_modification_decoding_2_args | ) |
Tests if the SCALE modification with two arguments is correctly decoded.
Definition at line 623 of file test_image_modifications.cpp.
References image::modification::decode(), image::scale_modification::get_h(), image::scale_modification::get_w(), image::modification_queue::size(), and image::modification_queue::top().
BOOST_AUTO_TEST_CASE | ( | test_scale_modification_decoding_no_args | ) |
Tests if the SCALE modification without arguments is ignored.
Definition at line 595 of file test_image_modifications.cpp.
References image::modification::decode(), and image::modification_queue::size().
BOOST_AUTO_TEST_CASE | ( | test_tc_modification_decoding | ) |
Tests if the TC modification is correctly decoded.
Definition at line 161 of file test_image_modifications.cpp.
References game_config::color_info(), image::modification::decode(), image::rc_modification::map(), recolor_range(), image::modification_queue::size(), game_config::tc_info(), and image::modification_queue::top().
BOOST_AUTO_TEST_CASE | ( | test_tc_modification_decoding_invalid_args | ) |
Tests if the TC modification with invalid arguments is ignored.
Definition at line 183 of file test_image_modifications.cpp.
References image::modification::decode(), and image::modification_queue::size().