OSDN Git Service

Restore GATT unit test
authorAjay Panicker <apanicke@google.com>
Tue, 25 Oct 2016 22:48:27 +0000 (15:48 -0700)
committerAjay Panicker <apanicke@google.com>
Tue, 25 Oct 2016 23:05:38 +0000 (16:05 -0700)
Bug: 32414937
Test: Test compiles and runs
Change-Id: I4d2a575a49da64f878c2d1d110e0d4fb5931c06a

tests/src/com/android/bluetooth/gatt/GattServiceTest.java [new file with mode: 0644]

diff --git a/tests/src/com/android/bluetooth/gatt/GattServiceTest.java b/tests/src/com/android/bluetooth/gatt/GattServiceTest.java
new file mode 100644 (file)
index 0000000..28c5a10
--- /dev/null
@@ -0,0 +1,22 @@
+
+package com.android.bluetooth.gatt;
+
+import android.test.AndroidTestCase;
+import android.test.suitebuilder.annotation.SmallTest;
+
+import com.android.bluetooth.gatt.GattService;
+
+/**
+ * Test cases for {@link GattService}.
+ */
+public class GattServiceTest extends AndroidTestCase {
+
+    @SmallTest
+    public void testParseBatchTimestamp() {
+        GattService service = new GattService();
+        long timestampNanos = service.parseTimestampNanos(new byte[] {
+                -54, 7 });
+        assertEquals(99700000000L, timestampNanos);
+    }
+
+}