-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ride ratings test #5047
Add ride ratings test #5047
Conversation
test/tests/RideRatings.cpp
Outdated
class RideRatings : public testing::Test | ||
{ | ||
protected: | ||
static const char * ExpectedRideRatings[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
char
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume you are suggesting I make it utf8? There is nothing other than ascii in this file.
test/tests/RideRatings.cpp
Outdated
|
||
void CalculateRatingsForAllRides() | ||
{ | ||
for (int rideId = 0; rideId < MAX_RIDES; rideId++) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int
I'm not sure what' the ultimate idea with regard to the |
I should be using |
What is the status of this? |
It needs an SV6 that has a reasonable amount of content in it, e.g. water, scenery the whole works with an instance of every single ride type in the park. Perhaps we can ask for one to be created on the forums? |
b40b3e6
to
1a8a998
Compare
dfb4ca6
to
fdce84a
Compare
fdce84a
to
79eef1d
Compare
src/openrct2/common.h
Outdated
#define UNUSED(x) ((void)(x)) | ||
|
||
// Macro for turning symbol names into strings | ||
#define SZ(x) #x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's wrong with nameof
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing, just didn't know we had it.
src/openrct2/core/Path.hpp
Outdated
@@ -23,6 +23,7 @@ namespace Path | |||
{ | |||
utf8 * Append(utf8 * buffer, size_t bufferSize, const utf8 * src); | |||
std::string Combine(const std::string &a, const std::string &b); | |||
std::string Combine(const std::string &a, const std::string &b, const std::string &c); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need two Combine
s? Isn't it synonymous with Combine(a, Combine(b, c))
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would you want to write Combine(a, Combine(b, c))
over Combine(a, b, c)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the same reason you would only have int add(int a, int b)
and no int add(int a, int b, int c)
, int add(int a, int b, int c, int d)
and so on…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't agree - the code clarity is better with an overload that takes three parameters. I would use vargs if possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use variadic templates then? I'd rather see that than explicit implementation for n arguments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how they work. Can you provide an example or online example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks
@@ -27,4 +28,5 @@ namespace File | |||
bool Move(const std::string &srcPath, const std::string &dstPath); | |||
void * ReadAllBytes(const std::string &path, size_t * length); | |||
void WriteAllBytes(const std::string &path, const void * buffer, size_t length); | |||
std::vector<std::string> ReadAllLines(const std::string &path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it File.h
and not File.hpp
? I recall you provided a reason at some point, but I don't remember it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hpp
contains implementation code.
test/tests/RideRatings.cpp
Outdated
} | ||
|
||
using namespace OpenRCT2; | ||
using namespace OpenRCT2::Audio; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Audio?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was originally needed, I can remove it now.
test/tests/CMakeLists.txt
Outdated
if (NOT "z$ENV{CI}" STREQUAL "z") | ||
message("Detected CI environment. Disabling ride rating test.") | ||
else () | ||
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "${CMAKE_CURRENT_LIST_DIR}/testdata/parks" "${CMAKE_CURRENT_BINARY_DIR}/parks") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be done at the top? Other tests may need testdata in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fails because you are symlinking parks rather than testdata.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but it still fails because I forgot I run all these tests in docker which has no CI
env variable set…
- Feature: [#1399 (partial), #5177] Add window that displays any missing/corrupt objects when loading a park - Feature: [#5056] Add cheat to own all land. - Feature: [#5133] Add option to display guest expenditure (as seen in RCTC). - Feature: [#5196] Add cheat to disable ride ageing. - Feature: [#5504] Group vehicles into ride groups - Feature: [#5576] Add a persistent 'display real names of guests' setting. - Feature: [#5611] Add support for Android - Feature: [#5706] Add support for OpenBSD - Feature: OpenRCT2 now starts up on the display it was last shown on. - Feature: Park entrance fee can now be set to amounts up to £200. - Improved: Construction rights can now be placed on park entrances. - Improved: Mouse can now be dragged to select scenery when saving track designs - Fix: [#259] Money making glitch involving swamps (original bug) - Fix: [#441] Construction rights over entrance path erased (original bug) - Fix: [#578] Ride ghosts show up in ride list during construction (original bug) - Fix: [#597] 'Finish 5 roller coasters' goal not properly checked (original bug) - Fix: [#667] Incorrect banner limit calculation (original bug) - Fix: [#739] Crocodile Ride (Log Flume) never allows more than five boats (original bug) - Fix: [#837] Can't move windows on title screen to where the toolbar would be (original bug) - Fix: [#1705] Time Twister's Medieval entrance has incorrect scrolling (original bug) - Fix: [#3178, #5456] Paths with non-ASCII characters not handled properly on macOS. - Fix: [#3346] Crash when extra long train breaks down at the back - Fix: [#3479] Building in pause mode creates too many floating numbers, crashing the game - Fix: [#3565] Multiplayer server crash - Fix: [#3681] Steel Twister rollercoaster always shows all track designs - Fix: [#3846, #5749] Crash when testing coaster with a diagonal lift in block brake mode - Fix: [#4054] Sorting rides by track type: Misleading research messages - Fix: [#4055] Sort rides by track type: Sorting rule is not really clear (inconsistent?) - Fix: [#4512] Invisible map edge tiles corrupted - Fix: [#5009] Ride rating calculations can overflow - Fix: [#5253] RCT1 park value conversion factor too high - Fix: [#5400] New Ride window does not focus properly on newly invented ride. - Fix: [#5489] Sprite index crash for car view on car ride. - Fix: [#5730] Unable to uncheck 'No money' in the Scenario Editor. - Fix: [#5750] Game freezes when ride queue linked list is corrupted. - Fix: [#5819] Vertical multi-dimension coaster tunnels drawn incorrectly - Fix: Non-invented vehicles can be used via track designs in select-by-track-type mode. - Fix: Track components added by OpenRCT2 are now usable in older scenarios. - Technical: [#5047] Add ride ratings tests - Technical: [#5458] Begin offering headless build with reduced compile- and run-time dependencies - Technical: [#5755] Title sequence wait periods use milliseconds - Technical: Fix many desync sources
So we know if we have changed the calculation logic unintentionally.