Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelbraginskiy committed Sep 24, 2024
1 parent ce80e92 commit c9f257a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions megamek/src/megamek/common/Entity.java
Original file line number Diff line number Diff line change
Expand Up @@ -4834,6 +4834,8 @@ public int getHeatCapacity() {
* @return The formatted heat capacity
*/
public String formatHeat() {
// This method might make sense as an abstract method with overrides in Mek and Aero,
// But since the implementation would be the same in both classes, this way avoids code duplication.
int sinks;
if (this instanceof Mek m) {
sinks = m.getActiveSinks();
Expand Down
2 changes: 1 addition & 1 deletion megamek/unittests/megamek/common/EntityTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ void testFormatHeat() {
f = new File("testresources/megamek/common/units/Sagittaire SGT-14D.mtf");
mfp = new MekFileParser(f);
e = mfp.getEntity();
expectedHeat = "28 [42]";
expectedHeat = "28, 42 with RHS";
computedHeat = e.formatHeat();
assertEquals(expectedHeat, computedHeat);
} catch (Exception ex) {
Expand Down

0 comments on commit c9f257a

Please sign in to comment.