Fixed AddressTest.

This commit is contained in:
Felix Ableitner 2015-08-26 00:25:11 +02:00
parent 5189a459ba
commit 61b13da957
2 changed files with 10 additions and 3 deletions

View File

@ -14,14 +14,14 @@ object AddressTest {
val a4 = new Address("4444459893F8810C4024CFC951374AABA1F4DE6347A3D7D8E44918AD1FF2BA36") val a4 = new Address("4444459893F8810C4024CFC951374AABA1F4DE6347A3D7D8E44918AD1FF2BA36")
val a1Dashed =
new Address("A51B7447-5EE622C3-C924DB14-7668F85E-024CA0B4-4CA146B5-E3D3C31A-54B34C1E")
val Addresses = Set(a1, a1Dashed, a2, a3, a4, Address.Broadcast, Address.Null) val Addresses = Set(a1, a1Dashed, a2, a3, a4, Address.Broadcast, Address.Null)
val a1Binary: Array[Byte] = Array(-91, 27, 116, 71, 94, -26, 34, -61, -55, 36, -37, 20, 118, 104, val a1Binary: Array[Byte] = Array(-91, 27, 116, 71, 94, -26, 34, -61, -55, 36, -37, 20, 118, 104,
-8, 94, 2, 76, -96, -76, 76, -95, 70, -75, -29, -45, -61, 26, 84, -77, 76, 30).map(_.toByte) -8, 94, 2, 76, -96, -76, 76, -95, 70, -75, -29, -45, -61, 26, 84, -77, 76, 30).map(_.toByte)
val a1Dashed =
new Address("A51B7447-5EE622C3-C924DB14-7668F85E-024CA0B4-4CA146B5-E3D3C31A-54B34C1E")
} }
class AddressTest extends AndroidTestCase { class AddressTest extends AndroidTestCase {

View File

@ -45,6 +45,13 @@ class TransferThread(device: Device, socket: BluetoothSocket, handler: Bluetooth
send(crypto.sign(new Message(new MessageHeader(ConnectionInfo.Type, send(crypto.sign(new Message(new MessageHeader(ConnectionInfo.Type,
Address.Null, Address.Null, 0), new ConnectionInfo(crypto.getLocalPublicKey)))) Address.Null, Address.Null, 0), new ConnectionInfo(crypto.getLocalPublicKey))))
// TODO: on disconnect (disable bluetooth):
// connection is never closed
// - no exception thrown
// - isConnected returning true
// -> step through, find alternative method/callback etc
// -> check source
// -> otherwise, need timeout?
while (socket.isConnected) { while (socket.isConnected) {
try { try {
if (inStream.available() > 0) { if (inStream.available() > 0) {