56839 Commits

Author SHA1 Message Date
Elvish_Hunter
f3012b50db wmllint GUI: used a smaller icon for the Browse button, and made the entry fill the whole frame 2014-05-21 10:43:52 +02:00
Chris Beck
7f5617f96a refactor tiles_adjacent, use jump tables instead of math abs 2014-05-20 23:10:38 -04:00
Chris Beck
91c8725338 inline get_adjacent, tiles_adjacent, distance_between (map_locations) 2014-05-20 22:34:12 -04:00
Chris Beck
d11fa92543 clean up map_locations.hpp, put inline bodies at end
Also, move vector ops to inline as well.
2014-05-20 22:28:34 -04:00
Chris Beck
e89d94d5cd travis requires all unit tests to pass. also refactor run_wml_tests.
With the change to --log-strict, it's not necessary to rerun with
strict mode off, so we can get rid of part of the old system.

Feel free to revert this is you don't want travis to require all
unit tests to pass as part of the build.
2014-05-20 16:38:18 -04:00
Chris Beck
f09d405629 cleanup previous two find and replace results
Just wanted to remove the empty strings that got created:

find . -type f -exec sed -i 's/<< "" <</<</g' '{}' \;

find . -type f -exec sed -i 's/<<"" <</<</g' '{}' \;

I also unstaged tools/schema/tags.cpp, since I don't think I changed
that.
2014-05-20 15:54:16 -04:00
Chris Beck
03a956d05c Make sure all warning logs are flushed, so travis gets the results.
This is the result of running command, in src/,

find . -type f -exec sed -i 's/\(WRN.*\)\\n\"\;/\1\" << std::endl\;/g' '{}' \;

and inspecting the results.

Also ran this subsequently:

find . -type f -exec sed -i 's/\(WARN.*\)\\n\"\;/\1\" << std::endl\;/g' '{}' \;

which only affected render.cpp
2014-05-20 15:48:36 -04:00
Chris Beck
3c9844889b Make sure all error logs flush with std::endl, so we get on travis.
This is the result of running this command in directory src/

find . -type f -exec sed -i 's/\(ERR.*\)\\n\"\;/\1\" << std::endl\;/g' '{}' \;

and carefully inspecting the results.
2014-05-20 15:37:52 -04:00
Chris Beck
f4ac89c400 Merge branch 'master' of git://github.com/wesnoth/wesnoth 2014-05-20 14:16:22 -04:00
Chris Beck
ca0d21abd9 always flush filesystem errors (so we can see on travis) 2014-05-20 14:16:06 -04:00
gfgtdf
bc110604fd #include <map.hpp> -> #include "map.hpp" 2014-05-20 20:08:54 +02:00
gfgtdf
e422aa60d3 Merge pull request #166 from gfgtdf/wml_message
add "to_chat" parameter to wml_message
2014-05-20 20:07:01 +02:00
Chris Beck
1e16b9a7e1 refactor strict logging
Don't throw an exception, just remember that we broke strict mode,
and cause the unit test to fail if that happens.
2014-05-20 13:39:25 -04:00
Chris Beck
8bffd6c5cf enable full debugging the first time travis runs scripts
Revert this once the tests start passing
2014-05-20 12:06:56 -04:00
Chris Beck
302b0a831b fixup travis (failure to find preferences is not reported as error) 2014-05-20 11:18:37 -04:00
Chris Beck
c5838b9513 inline the definition map_location::null_location
If we decided it was worth it to inline map_location ==, then
surely this is also worth it to inline null_location, as the
compiler may be able to reduce tests for == null location to
"x == ... && y == ...", without having to move to a different
compilation unit.
2014-05-20 10:42:13 -04:00
Chris Beck
c73b5945d9 add static const members ZERO, default_dirs, of map_location
Replace local constants appearing elsewhere with these.
The definitions are inlined.
2014-05-20 04:49:12 -04:00
Chris Beck
4b64eea0a6 always flush streams when logging in play_controller
Especially in check_victory, because it could throw an exception
and perhaps not get flushed. But its also good more generally in
a place like this.
2014-05-20 01:32:20 -04:00
Chris Beck
c211bc4b7e Merge branch 'master' of git://github.com/wesnoth/wesnoth 2014-05-20 01:16:00 -04:00
Chris Beck
1bd43bb6a9 refactor is_observer out of check_victory
This is a minor change to victory_when_enemies_defeated condition.

Old logic: If there are no not defeated sides which are enemies
of eachother (i.e. there is still a battle going on),
BUT victory_when_enemies_defeated = false, and either we found
a not defeated local human player, or we are a multiplayer observer
(there are no locally controlled sides), then don't end the level.

New logic: If there are no not defeated sides which are enemies,
BUT victory when enemies defeated = false, and EITHER we found a
not defeated local human player, OR there is a not defeated remote
human player AND no local human side assigned at all,
then don't end the level.

I think this more precisely the behavior we want. is_observer
doesn't belong in this function, and with the introduction of
defeat_condition, UMC will pretty much always be able to get the
behavior they want, so I'm much more comfortable to introduce this
change now than I would be otherwise.
2014-05-20 01:10:31 -04:00
Chris Beck
aa83190e07 pre-empty a division by zero
(whether or not it's actually possible based on other
considerations, this is a good idea)
2014-05-20 01:00:11 -04:00
gfgtdf
8dbeefef9a rename values of [side]defeat_condition=
most likely defeat_condition= will re renamed too defeat= too.
2014-05-20 04:01:48 +02:00
Chris Beck
987e34a3e3 fixup travis unit tests
- travis runs tests not in verbose mode,
  *but* if there is a failure,
  then it runs in very verbose mode, with strict mode off, to get
  errors reported in the travis log.
- run_wml_tests points out that if you don't run in strict mode,
  some tests may not fail as expected, so the count at the end
  may differ
2014-05-19 19:14:13 -04:00
gfgtdf
7c69fcb3be replace write_to with to_chat in [wml_message]
as shadowm suggested, because we are never in the situation that we want
this information in the chat but not in the stderr.
2014-05-20 01:08:28 +02:00
Chris Beck
3eb02d338b disable strict mode on travis, so we can see the error messages 2014-05-19 18:06:29 -04:00
Chris Beck
7046c3906e fixup map_location unit tests
update the correct test values,
and test the radial mode for characterization as well
2014-05-19 18:05:48 -04:00
gfgtdf
3dbc78f85f add "write_to" parameter to wml_message
"write_to" lets the wmldev specify to where the message should be
written. Defaults to the previous behaviour.

The intention is for example that one might want to give a summary  as a
chat message and a very detailed information in the stderr file.
2014-05-19 23:59:34 +02:00
Chris Beck
aace2c0288 turn on very verbose logging for wml unit tests on travis
So we can maybe see what's wrong.
2014-05-19 17:20:11 -04:00
aquileia
8136065f75 Fix readme files about unit test scenarios 2014-05-19 17:13:27 -04:00
aquileia
a69ee6e0c1 Update VC project for b4ea561e37 2014-05-19 17:13:20 -04:00
Chris Beck
cf19cc5516 get_relative_dir to use radial_symmetry mode, until we fix default
Revert this when we have fixed up the default mode.
2014-05-19 17:08:21 -04:00
Chris Beck
2a927871b7 fixup radial mode get_relative_dir 2014-05-19 17:05:21 -04:00
Chris Beck
ab29ba7e43 add map location rotate wml interface 2014-05-19 16:29:07 -04:00
Chris Beck
aaff4bdfee Merge branch 'master' of git://github.com/wesnoth/wesnoth 2014-05-19 14:35:42 -04:00
Chris Beck
3f5350a5ef add wml relative dir query tag, and interactive test scenario 2014-05-19 14:35:07 -04:00
gfgtdf
b258433650 Merge pull request #165 from gfgtdf/defeat_condition
replace fight_on_without_leader with defeat_condition
2014-05-19 19:58:55 +02:00
gfgtdf
87c492e0a1 don't load null hotkeys
this prevents a possible segfault because otherwise add_hotkey calls hotkey::set_scope_active(new_scope) where new_scope is SCOPE_COUNT.
2014-05-19 19:57:58 +02:00
gfgtdf
495deb0e46 Update changelog add 'defeat_condition' 2014-05-19 19:53:22 +02:00
Chris Beck
748ba751bc move default relative dir mode to .cpp file, for ease of testing 2014-05-19 12:05:18 -04:00
Chris Beck
de4caa8768 add a "radial mode" option to get relative dir. (just for kicks)
Adds a mode for get relative dir which should give radial symmetry,
using vector ops. This might be useful in some application, or to
help debug.
2014-05-19 11:43:55 -04:00
Andrius Silinskas
b4f6c6544e Minor style improvements. 2014-05-19 14:57:43 +01:00
Andrius Silinskas
d908fde2ec Always indicate that faction was chosen when placing player.
This fixes bug #21977.
2014-05-19 14:57:15 +01:00
Chris Beck
be1c1f882e fixup header to restore gcc builds 2014-05-19 01:56:37 -04:00
Chris Beck
1a1f7a5cf8 get_relative_dir may take a const & argument 2014-05-19 01:30:29 -04:00
Chris Beck
d93b01b836 Merge branch 'add_map_location_rotate' 2014-05-19 01:20:00 -04:00
Chris Beck
eba19db166 in debug mode, add team strings as well as names for hidden sides.
This brings the team names in line with the player names and other
behavior in mp_connect in debug mode. For instance there are other
lines like this:
dbf3331e9a/src/multiplayer_connect_engine.cpp (L155)

From inspecting the save files generated while testing this issue,
it's not clear if it could have actually caused a problem in game,
but it addresses an issue raised by SlowThinker on the bug tracker:

https://gna.org/bugs/index.php?21800

and does indeed fix a minor shortcoming of debug mode in mp connect
engine.
2014-05-19 01:10:00 -04:00
Chris Beck
a77ac836d3 add map_location rotate functions, and tests 2014-05-19 00:52:09 -04:00
gfgtdf
d948a04d9d rename remove_from_carryover_on_leaders_loss_
to remove_from_carryover_on_defeat_
2014-05-19 04:34:03 +02:00
gfgtdf
12d190ff9f add "always" defeat_condition 2014-05-19 04:21:52 +02:00
Alexander van Gessel
9dae74cd5d Disable some failing tests
These tests may no longer be correct. Their author is looking into them.
2014-05-19 02:33:16 +02:00