Skip to content

Commit

Permalink
Fix test fail in modern systems
Browse files Browse the repository at this point in the history
by adding the missing return. Sheesh.
  • Loading branch information
royfalk committed Nov 14, 2024
1 parent 089e004 commit ed3957e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
2 changes: 2 additions & 0 deletions engine/src/components/drive_upgrade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}


24 changes: 12 additions & 12 deletions engine/src/components/tests/drive_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit ed3957e

Please sign in to comment.