Commit Graph

39 Commits

Author SHA1 Message Date
Aaron van Geffen
9e206d5528 Remove dependency on StringIds.h from Localisation.h (#22011)
* Remove dependency on StringIds.h from Localisation.h

* Include Language.h in UTF8.cpp for function declarations

* Rename tests/Localisation.cpp to tests/LocalisationTest.cpp
2024-05-10 19:14:05 +00:00
Matthias Moninger
9e4099fcdf Fix VS debug builds not finding gtestd.lib (#19798) 2023-04-02 09:20:47 +02:00
Matthias Moninger
62b0a5edfe Build with link time code generation only on the develop branch 2023-03-26 16:50:18 +02:00
Josh Trzebiatowski
3b82774df1 Rename snake_case methods/classes under tests (#19205)
* Remove snake_case method names in sawyercoding_test.cpp

* Rename sawyercoding_test.cpp to SawyerCodingTest.cpp

* Rename sawyercoding_test.cpp to SawyerCodingTest.cpp
2023-01-18 06:06:54 +00:00
Micha Janiszewski
dfd5b4e775 Update MSVC project to use correct Google Test library 2022-05-08 22:22:36 +02:00
Michał Janiszewski
3bc5c6c563 Introduce MSVC ARM64 platform 2022-05-07 23:48:27 +02:00
ζeh Matt
ae61d7956a Add tests for BitSet 2021-12-12 23:47:20 +02:00
ZehMatt
cd43cab999 Add tests for EnumMap 2021-07-29 17:07:49 +03:00
ζeh Matt
6186766a05 Introduce TileElementsView (#13975)
* Simplify TileElement type conversation

* Introduce TileElementsView

* Move TileElementsView code into TileElementsView.h

* Cleanup code and move into OpenRCT2 namespace

* Use reference instead of pointer

* Fix include

* Make GCC happy

* Move the cast functions into base

* Use the cast function instead of reinterpret_cast

* Add TileElementsView tests

* Fix iterating on TileElementBase, return pointer not reference
2021-02-04 18:58:45 +02:00
csunday95
51faec5c50 Close #13637: Refactor sprite compiler for filesystem efficiency
- sprite building would save a file with just the sprite file header
   and then immediately open it again at the beginning of compilation
 - sprite file generation is now entirely in memory until the final
   output file is saved on success
 - added validation of no file activity in the failed build test case;
   failed builds will not generate a file or edit an existing one
2020-12-29 13:12:55 +01:00
Ted John
14377be487 Create new templated format string 2020-11-27 18:54:55 +00:00
Breno Rodrigues Guimarães
ab53ddf59f Avoid fast-forwarding peep into the ride
The code being removed in the patch tries to fast forward a peep into the ride when it is the second peep for a vehicle that is used in pairs. Problem is that funds checking does not happen, so it happens that a peep may pay against its will.
Lets say a rich peep enters in line and a poor peep enters in line right after.
If the price of the ride is such that the rich peep can pay and the poor peep can't, it will be dragged into the ride because funds checking only happened for the first.
The second part of the patch just adjusts we consider the vehicle a full car if the second position is filled.

Add test to verify that a peep is not dragged into a ride it can't pay

This test puts two peeps in a Ferris Wheel. The first peep is rich and the second peep is poor. When they are both in line, the ride price is raised so that the poor peep can't pay.
Make sure the poor peep turns back and leaves the ride.

During development, a mistake in the logic would have broken all rides other than ferris wheels in a way that multiple guests could enter the same car.
Also add a test to make sure that is never broken.
2020-04-25 18:27:33 -03:00
Matt
6177255991 Add S6 Import/Export test and remove old NetworkLoadSave test 2019-10-20 13:49:35 +02:00
Richard Fine
0e04dbeea1 Allow SwapBE to swap non-uint types
If we want to have more semantically meaningful types (like Direction), it's useful to be able to support those in the DataSerializer too. Swapping bytes for entire structures is probably never going to make sense, but for types that are pure wrappers around integer types, we want to be able to swap them as if they were the integer they wrap.
2019-09-01 18:40:11 +01:00
Matt
15838861cd Add load and save test. 2019-03-02 13:11:08 +01:00
Matt
49a6ae7894 Add CircularBuffer test. 2019-02-07 18:50:58 +01:00
Richard Fine
8fb81a2d89 Initial data-driven tests for pathfinder behaviour
Introduce some basic scenario-style tests for the pathfinding AI. There
are two tests:

* Test that a peep can get from a given start position to a given end
  position, and that it takes them an expected number of ticks to do so.
  Also test that they did not walk on any 'forbidden' tiles in the process,
  e.g. tiles that are completely the wrong direction from the goal etc.

* Test that a peep can *not* get from a given start position to a given
  end position after a given number of ticks.

Each test is parametric, and instantiated for multiple different
start/end positions within the provided test park. If we find a new
situation that needs a test, it should just be a matter of building
that situation in the saved game and then adding a line to the code to
set it up.

Indicating 'forbidden' tiles is done using terrain surface type IDs:
tiles that the pathfinder should never send the peep into should be
painted with the red neon surface type (index 8). This means we have
no way to forbid some path elements on a tile while allowing others,
but we don't need that right now.

Similarly, to help ensure that the test data and code are kept in
sync, the tests also require that peep start tiles are painted with
the green neon surface type (index 11) and that goal tiles are
painted with the yellow neon surface type (index 9).
2019-01-02 14:12:08 +00:00
Matt
017f190a52 Add basic regression tests via the replay system. 2018-12-29 19:23:27 +01:00
Ted John
865bfb7b1b Refactor implementations to different files 2018-06-01 21:27:33 +01:00
Ted John
b149c1c4ca Add unit tests for SHA1 hashing 2018-06-01 21:27:33 +01:00
Ted John
44764874a3 Add test for ImageImporter 2018-05-13 01:11:56 +01:00
Ted John
e7fb20c283 Add tests for rct2 <-> utf8 conversions 2018-04-18 13:16:20 +02:00
Hielke Morsink
f661d48d90 Add tests for tile_element_wants_path_connection_towards 2018-04-17 20:43:49 +02:00
Ted John
58306e8055 Set tests output directory to bin
This is the easiest way to allow the tests to use the OpenRCT2 data for msbuild.
2018-04-10 18:00:02 +01:00
Michał Janiszewski
6aa4722c22 Add MultiLaunch test 2017-06-24 09:56:51 +02:00