1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-03 17:02:13 +01:00

Another small tz+dst parsing testcase

This commit is contained in:
cpfeiffer 2017-11-07 21:23:54 +01:00
parent 99710e7db3
commit b76e78768c

View File

@ -10,7 +10,7 @@ import static org.junit.Assert.assertTrue;
public class BLETypeConversionsTest extends TestBase {
@Test
public void testTimeParsing() {
public void testTimeParsing1() {
byte[] requested = new byte[] {
(byte) 0xe1, 0x07, 0x0a, 0x1d, 0x00, 0x1c, 0x00,0x08
};
@ -22,4 +22,18 @@ public class BLETypeConversionsTest extends TestBase {
assertTrue(calRequested.getTime().equals(calReceived.getTime()));
}
@Test
public void testTimeParsingWithDST() {
byte[] requested = new byte[] {
(byte) 0xe1,0x07,0x0a,0x09,0x11,0x23,0x00,0x08
};
byte[] received = new byte[] {
(byte) 0xe1,0x07,0x0a,0x09,0x10,0x23,0x00,0x04
};
GregorianCalendar calRequested = BLETypeConversions.rawBytesToCalendar(requested, false);
GregorianCalendar calReceived = BLETypeConversions.rawBytesToCalendar(received, false);
assertTrue(calRequested.getTime().equals(calReceived.getTime()));
}
}