The Battle for Wesnoth  1.19.19+dev
Macros | Functions
test_image_modifications.cpp File Reference
#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"
Include dependency graph for test_image_modifications.cpp:

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...
 

Macro Definition Documentation

◆ GETTEXT_DOMAIN

#define GETTEXT_DOMAIN   "wesnoth-test"

Definition at line 16 of file test_image_modifications.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/41]

BOOST_AUTO_TEST_CASE ( test_b_modification_decoding  )

Tests if the B modification with one argument is correctly decoded.

Definition at line 750 of file test_image_modifications.cpp.

References image::modification::decode(), image::modification_queue::size(), and image::modification_queue::top().

◆ BOOST_AUTO_TEST_CASE() [2/41]

BOOST_AUTO_TEST_CASE ( test_bg_modification_decoding_1_arg  )

Tests if the BG modification with one argument is correctly decoded.

Definition at line 789 of file test_image_modifications.cpp.

References image::modification::decode(), image::modification_queue::size(), and image::modification_queue::top().

◆ BOOST_AUTO_TEST_CASE() [3/41]

BOOST_AUTO_TEST_CASE ( test_bg_modification_decoding_2_args  )

Tests if the BG modification with two arguments is correctly decoded.

Definition at line 809 of file test_image_modifications.cpp.

References image::modification::decode(), image::modification_queue::size(), and image::modification_queue::top().

◆ BOOST_AUTO_TEST_CASE() [4/41]

BOOST_AUTO_TEST_CASE ( test_bg_modification_decoding_3_args  )

Tests if the BG modification with three arguments is correctly decoded.

Definition at line 829 of file test_image_modifications.cpp.

References image::modification::decode(), image::modification_queue::size(), and image::modification_queue::top().

◆ BOOST_AUTO_TEST_CASE() [5/41]

BOOST_AUTO_TEST_CASE ( test_bg_modification_decoding_4_args  )

Tests if the BG modification with four arguments is correctly decoded.

Definition at line 849 of file test_image_modifications.cpp.

References image::modification::decode(), image::modification_queue::size(), and image::modification_queue::top().

◆ BOOST_AUTO_TEST_CASE() [6/41]

BOOST_AUTO_TEST_CASE ( test_bg_modification_decoding_no_args  )

Tests if the BG modification without arguments is correctly decoded.

Definition at line 769 of file test_image_modifications.cpp.

References image::modification::decode(), image::modification_queue::size(), and image::modification_queue::top().

◆ BOOST_AUTO_TEST_CASE() [7/41]

BOOST_AUTO_TEST_CASE ( test_bl_modification_decoding  )

Tests if the BL modification with one argument is correctly decoded.

Definition at line 670 of file test_image_modifications.cpp.

References image::modification::decode(), image::modification_queue::size(), and image::modification_queue::top().

◆ BOOST_AUTO_TEST_CASE() [8/41]

BOOST_AUTO_TEST_CASE ( test_bl_modification_decoding_no_args  )

Tests if the BL modification without arguments is correctly decoded.

Definition at line 653 of file test_image_modifications.cpp.

References image::modification::decode(), image::modification_queue::size(), and image::modification_queue::top().

◆ BOOST_AUTO_TEST_CASE() [9/41]

BOOST_AUTO_TEST_CASE ( test_blit_modification_decoding_1_arg  )

Tests if the BLIT modification with one argument is correctly decoded.

Todo:
check if the surface is correct

Definition at line 427 of file test_image_modifications.cpp.

References image::modification::decode(), image::modification_queue::size(), and image::modification_queue::top().

◆ BOOST_AUTO_TEST_CASE() [10/41]

BOOST_AUTO_TEST_CASE ( test_blit_modification_decoding_3_args  )

Tests if the BLIT modification with three arguments is correctly decoded.

Todo:
check if the surface is correct

Definition at line 449 of file test_image_modifications.cpp.

References image::modification::decode(), image::modification_queue::size(), and image::modification_queue::top().

◆ BOOST_AUTO_TEST_CASE() [11/41]

BOOST_AUTO_TEST_CASE ( test_blit_modification_decoding_invalid_args  )

Tests if the BLIT modification with invalid arguments is ignored.

Definition at line 468 of file test_image_modifications.cpp.

References image::modification::decode(), and image::modification_queue::size().

◆ BOOST_AUTO_TEST_CASE() [12/41]

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 336 of file test_image_modifications.cpp.

References image::modification::decode(), image::modification_queue::size(), and image::modification_queue::top().

◆ BOOST_AUTO_TEST_CASE() [13/41]

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 358 of file test_image_modifications.cpp.

References image::modification::decode(), image::modification_queue::size(), and image::modification_queue::top().

◆ BOOST_AUTO_TEST_CASE() [14/41]

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 380 of file test_image_modifications.cpp.

References image::modification::decode(), image::modification_queue::size(), and image::modification_queue::top().

◆ BOOST_AUTO_TEST_CASE() [15/41]

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 402 of file test_image_modifications.cpp.

References image::modification::decode(), image::modification_queue::size(), and image::modification_queue::top().

◆ BOOST_AUTO_TEST_CASE() [16/41]

BOOST_AUTO_TEST_CASE ( test_crop_modification_decoding_no_args  )

Tests if the CROP modification without arguments is ignored.

Definition at line 326 of file test_image_modifications.cpp.

References image::modification::decode(), and image::modification_queue::size().

◆ BOOST_AUTO_TEST_CASE() [17/41]

BOOST_AUTO_TEST_CASE ( test_fl_modification_decoding_default  )

Tests if the FL modification is correctly decoded without arguments.

Definition at line 239 of file test_image_modifications.cpp.

References image::modification::decode(), image::modification_queue::size(), and image::modification_queue::top().

◆ BOOST_AUTO_TEST_CASE() [18/41]

BOOST_AUTO_TEST_CASE ( test_fl_modification_decoding_horiz  )

Tests if the FL modification is correctly decoded with the horiz argument.

Definition at line 257 of file test_image_modifications.cpp.

References image::modification::decode(), image::modification_queue::size(), and image::modification_queue::top().

◆ BOOST_AUTO_TEST_CASE() [19/41]

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 293 of file test_image_modifications.cpp.

References image::modification::decode(), image::modification_queue::size(), and image::modification_queue::top().

◆ BOOST_AUTO_TEST_CASE() [20/41]

BOOST_AUTO_TEST_CASE ( test_fl_modification_decoding_vert  )

Tests if the FL modification is correctly decoded with the vert argument.

Definition at line 275 of file test_image_modifications.cpp.

References image::modification::decode(), image::modification_queue::size(), and image::modification_queue::top().

◆ BOOST_AUTO_TEST_CASE() [21/41]

BOOST_AUTO_TEST_CASE ( test_g_modification_decoding  )

Tests if the G modification with one argument is correctly decoded.

Definition at line 731 of file test_image_modifications.cpp.

References image::modification::decode(), image::modification_queue::size(), and image::modification_queue::top().

◆ BOOST_AUTO_TEST_CASE() [22/41]

BOOST_AUTO_TEST_CASE ( test_gs_modification_decoding  )

Tests if the GS modification is correctly decoded.

Definition at line 311 of file test_image_modifications.cpp.

References image::modification::decode(), image::modification_queue::size(), and image::modification_queue::top().

◆ BOOST_AUTO_TEST_CASE() [23/41]

BOOST_AUTO_TEST_CASE ( test_l_modification_decoding_1_arg  )

Tests if the L modification with one argument is correctly decoded.

Todo:
check if the surface is correct

Definition at line 554 of file test_image_modifications.cpp.

References image::modification::decode(), image::modification_queue::size(), and image::modification_queue::top().

◆ BOOST_AUTO_TEST_CASE() [24/41]

BOOST_AUTO_TEST_CASE ( test_l_modification_decoding_no_args  )

Tests if the L modification without arguments is ignored.

Definition at line 541 of file test_image_modifications.cpp.

References image::modification::decode(), and image::modification_queue::size().

◆ BOOST_AUTO_TEST_CASE() [25/41]

BOOST_AUTO_TEST_CASE ( test_mask_modification_decoding_1_arg  )

Tests if the MASK modification with one argument is correctly decoded.

Todo:
check if the surface is correct

Definition at line 486 of file test_image_modifications.cpp.

References image::modification::decode(), image::modification_queue::size(), and image::modification_queue::top().

◆ BOOST_AUTO_TEST_CASE() [26/41]

BOOST_AUTO_TEST_CASE ( test_mask_modification_decoding_3_args  )

Tests if the MASK modification with three arguments is correctly decoded.

Todo:
check if the surface is correct

Definition at line 508 of file test_image_modifications.cpp.

References image::modification::decode(), image::modification_queue::size(), and image::modification_queue::top().

◆ BOOST_AUTO_TEST_CASE() [27/41]

BOOST_AUTO_TEST_CASE ( test_mask_modification_decoding_invalid_args  )

Tests if the MASK modification with invalid arguments is ignored.

Definition at line 527 of file test_image_modifications.cpp.

References image::modification::decode(), and image::modification_queue::size().

◆ BOOST_AUTO_TEST_CASE() [28/41]

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 96 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() [29/41]

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 635 of file test_image_modifications.cpp.

References image::modification::decode(), image::modification_queue::size(), and image::modification_queue::top().

◆ BOOST_AUTO_TEST_CASE() [30/41]

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 617 of file test_image_modifications.cpp.

References image::modification::decode(), image::modification_queue::size(), and image::modification_queue::top().

◆ BOOST_AUTO_TEST_CASE() [31/41]

BOOST_AUTO_TEST_CASE ( test_pal_modification_decoding  )

Tests if the PAL modification is correctly decoded.

Definition at line 200 of file test_image_modifications.cpp.

References image::modification::decode(), i, image::modification_queue::size(), game_config::tc_info(), and image::modification_queue::top().

◆ BOOST_AUTO_TEST_CASE() [32/41]

BOOST_AUTO_TEST_CASE ( test_pal_modification_decoding_invalid_args  )

Tests if the PAL modification with invalid arguments is ignored.

Definition at line 228 of file test_image_modifications.cpp.

References image::modification::decode(), and image::modification_queue::size().

◆ BOOST_AUTO_TEST_CASE() [33/41]

BOOST_AUTO_TEST_CASE ( test_r_modification_decoding  )

Tests if the R modification with one argument is correctly decoded.

Definition at line 712 of file test_image_modifications.cpp.

References image::modification::decode(), image::modification_queue::size(), and image::modification_queue::top().

◆ BOOST_AUTO_TEST_CASE() [34/41]

BOOST_AUTO_TEST_CASE ( test_rc_modification_decoding  )

◆ BOOST_AUTO_TEST_CASE() [35/41]

BOOST_AUTO_TEST_CASE ( test_rc_modification_decoding_invalid_args  )

Tests if the RC modification with invalid arguments is ignored.

Definition at line 190 of file test_image_modifications.cpp.

References image::modification::decode(), and image::modification_queue::size().

◆ BOOST_AUTO_TEST_CASE() [36/41]

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 687 of file test_image_modifications.cpp.

References image::modification::decode(), i, image::modification_queue::pop(), image::modification_queue::size(), and image::modification_queue::top().

◆ BOOST_AUTO_TEST_CASE() [37/41]

BOOST_AUTO_TEST_CASE ( test_scale_modification_decoding_1_arg  )

Tests if the SCALE modification with one argument is correctly decoded.

Definition at line 581 of file test_image_modifications.cpp.

References image::modification::decode(), image::modification_queue::size(), and image::modification_queue::top().

◆ BOOST_AUTO_TEST_CASE() [38/41]

BOOST_AUTO_TEST_CASE ( test_scale_modification_decoding_2_args  )

Tests if the SCALE modification with two arguments is correctly decoded.

Definition at line 599 of file test_image_modifications.cpp.

References image::modification::decode(), image::modification_queue::size(), and image::modification_queue::top().

◆ BOOST_AUTO_TEST_CASE() [39/41]

BOOST_AUTO_TEST_CASE ( test_scale_modification_decoding_no_args  )

Tests if the SCALE modification without arguments is ignored.

Definition at line 571 of file test_image_modifications.cpp.

References image::modification::decode(), and image::modification_queue::size().

◆ BOOST_AUTO_TEST_CASE() [40/41]

BOOST_AUTO_TEST_CASE ( test_tc_modification_decoding  )

◆ BOOST_AUTO_TEST_CASE() [41/41]

BOOST_AUTO_TEST_CASE ( test_tc_modification_decoding_invalid_args  )

Tests if the TC modification with invalid arguments is ignored.

Definition at line 159 of file test_image_modifications.cpp.

References image::modification::decode(), and image::modification_queue::size().