Improved testcase #234
This commit is contained in:
parent
e59c012553
commit
b3410dcebe
|
@ -46,9 +46,15 @@ public class Mi1SFirmwareInfo extends AbstractMi1SFirmwareInfo {
|
|||
return false;
|
||||
}
|
||||
try {
|
||||
return fw1Info.isGenerallySupportedFirmware() && fw2Info.isGenerallySupportedFirmware();
|
||||
return fw1Info.isGenerallySupportedFirmware()
|
||||
&& fw2Info.isGenerallySupportedFirmware()
|
||||
&& fw1Info.getFirmwareBytes().length > 0
|
||||
&& fw2Info.getFirmwareBytes().length > 0;
|
||||
} catch (IndexOutOfBoundsException ex) {
|
||||
return false;
|
||||
} catch (IllegalArgumentException ex) {
|
||||
LOG.warn("not supported 1S firmware: ", ex);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ public class FirmwareTest {
|
|||
int calculatedVersion = info.getFirmwareVersion();
|
||||
String version = MiBandFWHelper.formatFirmwareVersion(calculatedVersion);
|
||||
Assert.assertTrue(version.startsWith("1."));
|
||||
Assert.assertArrayEquals(wholeFw, info.getFirmwareBytes());
|
||||
// Assert.assertEquals("Unexpected firmware version: " + calculatedVersion, MI_FW_VERSION, calculatedVersion);
|
||||
}
|
||||
|
||||
|
@ -45,6 +46,7 @@ public class FirmwareTest {
|
|||
int calculatedVersion = info.getFirmwareVersion();
|
||||
String version = MiBandFWHelper.formatFirmwareVersion(calculatedVersion);
|
||||
Assert.assertTrue(version.startsWith("5."));
|
||||
Assert.assertArrayEquals(wholeFw, info.getFirmwareBytes());
|
||||
// Assert.assertEquals("Unexpected firmware version: " + calculatedVersion, MI1A_FW_VERSION, calculatedVersion);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue