mirror of
https://github.com/corda/corda.git
synced 2025-06-18 23:28:21 +00:00
Resolve warnings for Kotlin ByteArray. (#3521)
This commit is contained in:
@ -11,7 +11,7 @@ class PrivacySaltTest {
|
||||
|
||||
@Test
|
||||
fun testValidSalt() {
|
||||
PrivacySalt(ByteArray(SALT_SIZE, { 0x14 }))
|
||||
PrivacySalt(ByteArray(SALT_SIZE) { 0x14 })
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -22,13 +22,13 @@ class PrivacySaltTest {
|
||||
|
||||
@Test
|
||||
fun testTooShortPrivacySalt() {
|
||||
val ex = assertFailsWith<IllegalArgumentException> { PrivacySalt(ByteArray(SALT_SIZE - 1, { 0x7f })) }
|
||||
val ex = assertFailsWith<IllegalArgumentException> { PrivacySalt(ByteArray(SALT_SIZE - 1) { 0x7f }) }
|
||||
assertEquals("Privacy salt should be 32 bytes.", ex.message)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testTooLongPrivacySalt() {
|
||||
val ex = assertFailsWith<IllegalArgumentException> { PrivacySalt(ByteArray(SALT_SIZE + 1, { 0x7f })) }
|
||||
val ex = assertFailsWith<IllegalArgumentException> { PrivacySalt(ByteArray(SALT_SIZE + 1) { 0x7f }) }
|
||||
assertEquals("Privacy salt should be 32 bytes.", ex.message)
|
||||
}
|
||||
}
|
@ -33,7 +33,7 @@ class SecureHashTest {
|
||||
@Test
|
||||
fun testConstants() {
|
||||
assertArrayEquals(SecureHash.zeroHash.bytes, ByteArray(32))
|
||||
assertArrayEquals(SecureHash.allOnesHash.bytes, ByteArray(32, { 0xFF.toByte() }))
|
||||
assertArrayEquals(SecureHash.allOnesHash.bytes, ByteArray(32) { 0xFF.toByte() })
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user