fix: add legacy-compatible Android phone link
This commit is contained in:
@@ -4,12 +4,28 @@ import org.junit.Assert.*
|
||||
import org.junit.Test
|
||||
import java.nio.ByteBuffer
|
||||
import java.nio.ByteOrder
|
||||
import java.io.ByteArrayInputStream
|
||||
import java.util.concurrent.Callable
|
||||
import java.util.concurrent.ExecutorCompletionService
|
||||
import java.util.concurrent.Executors
|
||||
import java.util.zip.CRC32
|
||||
|
||||
class ProtocolTest {
|
||||
@Test
|
||||
fun phoneShareHashRequiresTheAdvertisedExactSize() {
|
||||
val bytes = "phone-share-stable-snapshot".toByteArray()
|
||||
assertEquals(
|
||||
"83511688f11a9cb98da9339966f6a0b97e48913102aaad39ae395d2e88f3f65f",
|
||||
phoneShareSha256Exact(ByteArrayInputStream(bytes), bytes.size.toLong()),
|
||||
)
|
||||
assertThrows(IllegalArgumentException::class.java) {
|
||||
phoneShareSha256Exact(ByteArrayInputStream(bytes), bytes.size.toLong() + 1L)
|
||||
}
|
||||
assertThrows(IllegalArgumentException::class.java) {
|
||||
phoneShareSha256Exact(ByteArrayInputStream(bytes), bytes.size.toLong() - 1L)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun directDiscoveryCarriesTheAndroidDeviceName() {
|
||||
val request = directDiscoveryRequest(
|
||||
|
||||
Reference in New Issue
Block a user