mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-10-08 05:59:45 +02:00
Tiny test for parsing date,time,tz
This commit is contained in:
parent
a58e3f66ce
commit
99710e7db3
@ -0,0 +1,25 @@
|
|||||||
|
package nodomain.freeyourgadget.gadgetbridge.test;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.service.btle.BLETypeConversions;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
|
public class BLETypeConversionsTest extends TestBase {
|
||||||
|
@Test
|
||||||
|
public void testTimeParsing() {
|
||||||
|
byte[] requested = new byte[] {
|
||||||
|
(byte) 0xe1, 0x07, 0x0a, 0x1d, 0x00, 0x1c, 0x00,0x08
|
||||||
|
};
|
||||||
|
byte[] received = new byte[] {
|
||||||
|
(byte) 0xe1, 0x07, 0x0a, 0x1c, 0x17, 0x1c, 0x00, 0x04
|
||||||
|
};
|
||||||
|
GregorianCalendar calRequested = BLETypeConversions.rawBytesToCalendar(requested, false);
|
||||||
|
GregorianCalendar calReceived = BLETypeConversions.rawBytesToCalendar(received, false);
|
||||||
|
|
||||||
|
assertTrue(calRequested.getTime().equals(calReceived.getTime()));
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user