From ed3957e5ca52a3efa9c7f9895a06139d2a55ad26 Mon Sep 17 00:00:00 2001 From: Roy Falk Date: Thu, 14 Nov 2024 18:50:09 +0200 Subject: [PATCH] Fix test fail in modern systems by adding the missing return. Sheesh. --- engine/src/components/drive_upgrade.cpp | 2 ++ engine/src/components/tests/drive_tests.cpp | 24 ++++++++++----------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/engine/src/components/drive_upgrade.cpp b/engine/src/components/drive_upgrade.cpp index 63d17f57d..7500b3f46 100644 --- a/engine/src/components/drive_upgrade.cpp +++ b/engine/src/components/drive_upgrade.cpp @@ -162,6 +162,8 @@ bool DriveUpgrade::Upgrade(const std::string upgrade_name) { drive->max_roll_right.SetMaxValue(drive->max_roll_right.MaxValue() * max_roll_right); drive->SetConsumption(drive->GetConsumption() * fuel_consumption); + + return true; } diff --git a/engine/src/components/tests/drive_tests.cpp b/engine/src/components/tests/drive_tests.cpp index 8499dbdb9..b76305c04 100644 --- a/engine/src/components/tests/drive_tests.cpp +++ b/engine/src/components/tests/drive_tests.cpp @@ -200,22 +200,22 @@ TEST(Drive, UpgradeDowngrade) { EXPECT_EQ(upgrade.fuel_consumption, 1.5); // Downgrade - // std::cout << "Downgrade\n---------\n"; - // // Drive - // upgrade.Downgrade(); + std::cout << "Downgrade\n---------\n"; + // Drive + upgrade.Downgrade(); - // EXPECT_EQ(drive.GetUpgradeName(), ""); - // EXPECT_EQ(drive.GetMass(), 0.0); + EXPECT_EQ(drive.GetUpgradeName(), ""); + EXPECT_EQ(drive.GetMass(), 0.0); - // DriveExpectEq(drive, 10.0); + DriveExpectEq(drive, 10.0); - // EXPECT_EQ(drive.GetConsumption(), 1.0); + EXPECT_EQ(drive.GetConsumption(), 1.0); - // // Upgrade - // EXPECT_EQ(upgrade.GetUpgradeName(), ""); - // EXPECT_EQ(upgrade.GetMass(), 0.0); + // Upgrade + EXPECT_EQ(upgrade.GetUpgradeName(), ""); + EXPECT_EQ(upgrade.GetMass(), 0.0); - // DriveUpgradeExpectEq(upgrade, 1.0); + DriveUpgradeExpectEq(upgrade, 1.0); - // EXPECT_EQ(upgrade.fuel_consumption, 1.0); + EXPECT_EQ(upgrade.fuel_consumption, 1.0); } \ No newline at end of file