mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-09-02 20:45:23 +02:00
Improved testcase #234
This commit is contained in:
parent
e59c012553
commit
b3410dcebe
@ -46,9 +46,15 @@ public class Mi1SFirmwareInfo extends AbstractMi1SFirmwareInfo {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
return fw1Info.isGenerallySupportedFirmware() && fw2Info.isGenerallySupportedFirmware();
|
return fw1Info.isGenerallySupportedFirmware()
|
||||||
|
&& fw2Info.isGenerallySupportedFirmware()
|
||||||
|
&& fw1Info.getFirmwareBytes().length > 0
|
||||||
|
&& fw2Info.getFirmwareBytes().length > 0;
|
||||||
} catch (IndexOutOfBoundsException ex) {
|
} catch (IndexOutOfBoundsException ex) {
|
||||||
return false;
|
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();
|
int calculatedVersion = info.getFirmwareVersion();
|
||||||
String version = MiBandFWHelper.formatFirmwareVersion(calculatedVersion);
|
String version = MiBandFWHelper.formatFirmwareVersion(calculatedVersion);
|
||||||
Assert.assertTrue(version.startsWith("1."));
|
Assert.assertTrue(version.startsWith("1."));
|
||||||
|
Assert.assertArrayEquals(wholeFw, info.getFirmwareBytes());
|
||||||
// Assert.assertEquals("Unexpected firmware version: " + calculatedVersion, MI_FW_VERSION, calculatedVersion);
|
// Assert.assertEquals("Unexpected firmware version: " + calculatedVersion, MI_FW_VERSION, calculatedVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,6 +46,7 @@ public class FirmwareTest {
|
|||||||
int calculatedVersion = info.getFirmwareVersion();
|
int calculatedVersion = info.getFirmwareVersion();
|
||||||
String version = MiBandFWHelper.formatFirmwareVersion(calculatedVersion);
|
String version = MiBandFWHelper.formatFirmwareVersion(calculatedVersion);
|
||||||
Assert.assertTrue(version.startsWith("5."));
|
Assert.assertTrue(version.startsWith("5."));
|
||||||
|
Assert.assertArrayEquals(wholeFw, info.getFirmwareBytes());
|
||||||
// Assert.assertEquals("Unexpected firmware version: " + calculatedVersion, MI1A_FW_VERSION, calculatedVersion);
|
// Assert.assertEquals("Unexpected firmware version: " + calculatedVersion, MI1A_FW_VERSION, calculatedVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user