mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-29 01:42:37 +00:00

Turn the 4 side setup of the firststrike_and_laststrike test into a macro called `COMMON_KEEP_A_B_C_D`for reuse in other tests. The comment for `GENERIC_UNIT_TEST` gets a couple of extra paragraphs. All the files get wmlindent run on them, which reindents `FAIL_IF_NOT`. The main reason for having these is separate files is Git's fuzzy-patch matching when merging and rebasing. Having large blocks of identical text in `wml_unit_test_macros.cfg` can mean the wrong section gets patched.
78 lines
1.7 KiB
INI
78 lines
1.7 KiB
INI
#textdomain wesnoth-test
|
|
#define RETURN X
|
|
[if]
|
|
[variable]
|
|
name=ended
|
|
boolean_not_equals=yes
|
|
[/variable]
|
|
[then]
|
|
[if]
|
|
{X}
|
|
[then]
|
|
{VARIABLE ended yes}
|
|
[endlevel]
|
|
test_result=pass
|
|
linger_mode = yes
|
|
[/endlevel]
|
|
[/then]
|
|
[else]
|
|
[test_condition]
|
|
result=no
|
|
{X}
|
|
[/test_condition]
|
|
{VARIABLE ended yes}
|
|
[endlevel]
|
|
test_result=fail
|
|
linger_mode = yes
|
|
[/endlevel]
|
|
[/else]
|
|
[/if]
|
|
[/then]
|
|
[/if]
|
|
#enddef
|
|
|
|
#define ASSERT X
|
|
[if]
|
|
[variable]
|
|
name=ended
|
|
boolean_not_equals=yes
|
|
[/variable]
|
|
[then]
|
|
[if]
|
|
{X}
|
|
[else]
|
|
[test_condition]
|
|
result=no
|
|
{X}
|
|
[/test_condition]
|
|
{VARIABLE ended yes}
|
|
[endlevel]
|
|
test_result=fail
|
|
linger_mode = yes
|
|
[/endlevel]
|
|
[/else]
|
|
[/if]
|
|
[/then]
|
|
[/if]
|
|
#enddef
|
|
|
|
#define FAIL
|
|
{RETURN ([false][/false])}
|
|
#enddef
|
|
|
|
#define SUCCEED
|
|
{RETURN ([true][/true])}
|
|
#enddef
|
|
|
|
#define FAIL_IF_NOT FLAG NOT_EQUALS
|
|
[if]
|
|
[variable]
|
|
name={FLAG}
|
|
not_equals={NOT_EQUALS}
|
|
[/variable]
|
|
[then]
|
|
{FAIL}
|
|
[/then]
|
|
[/if]
|
|
#enddef
|