Merge branch 'master' into jgrpp

# Conflicts:
#	src/autoreplace_cmd.cpp
#	src/company_base.h
#	src/company_gui.cpp
#	src/cpu.cpp
#	src/debug.h
#	src/group.h
#	src/group_cmd.cpp
#	src/house.h
#	src/industry.h
#	src/newgrf_house.cpp
#	src/news_type.h
#	src/openttd.cpp
#	src/saveload/company_sl.cpp
#	src/settings_type.h
#	src/sl/oldloader_sl.cpp
#	src/story.cpp
#	src/table/town_land.h
#	src/viewport.cpp
This commit is contained in:
Jonathan G Rennison
2024-02-09 18:11:42 +00:00
51 changed files with 553 additions and 839 deletions

View File

@@ -13,41 +13,6 @@
#include "../core/math_func.hpp"
TEST_CASE("LeastCommonMultipleTest - Zero")
{
CHECK(0 == LeastCommonMultiple(0, 0));
CHECK(0 == LeastCommonMultiple(0, 600));
CHECK(0 == LeastCommonMultiple(600, 0));
}
TEST_CASE("LeastCommonMultipleTest - FindLCM")
{
CHECK(25 == LeastCommonMultiple(5, 25));
CHECK(25 == LeastCommonMultiple(25, 5));
CHECK(130 == LeastCommonMultiple(5, 26));
CHECK(130 == LeastCommonMultiple(26, 5));
}
TEST_CASE("GreatestCommonDivisorTest - Negative")
{
CHECK(4 == GreatestCommonDivisor(4, -52));
// CHECK(3 == GreatestCommonDivisor(-27, 6)); // error - returns -3
}
TEST_CASE("GreatestCommonDivisorTest - Zero")
{
CHECK(27 == GreatestCommonDivisor(0, 27));
CHECK(27 == GreatestCommonDivisor(27, 0));
}
TEST_CASE("GreatestCommonDivisorTest - FindGCD")
{
CHECK(5 == GreatestCommonDivisor(5, 25));
CHECK(5 == GreatestCommonDivisor(25, 5));
CHECK(1 == GreatestCommonDivisor(7, 27));
CHECK(1 == GreatestCommonDivisor(27, 7));
}
TEST_CASE("DivideApproxTest - Negative")
{
CHECK(-2 == DivideApprox(-5, 2));