Skip to content

Commit c3881a4

Browse files
committed
Replace println statements with logger.log
1 parent a7b9dc9 commit c3881a4

File tree

1 file changed

+10
-10
lines changed
  • cryptography-providers-tests/src/commonMain/kotlin/default

1 file changed

+10
-10
lines changed

cryptography-providers-tests/src/commonMain/kotlin/default/EcdsaTest.kt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,22 +56,22 @@ abstract class EcdsaTest(provider: CryptographyProvider) : AlgorithmTest<ECDSA>(
5656

5757
).forEach { (curve, rawSignatureSize, derSignatureSizes, publicKeySize, privateKeySizes) ->
5858
if (!supportsCurve(curve)) {
59-
println("Skipping size test for unsupported curve: ${curve.name}")
59+
logger.log { "Skipping size test for unsupported curve: ${curve.name}" }
6060
return@forEach
6161
}
6262

63-
println("\nRunning size test for curve: ${curve.name}")
63+
logger.log { "\nRunning size test for curve: ${curve.name}" }
6464
val keyPair = algorithm.keyPairGenerator(curve).generateKey()
6565

6666
val actualPublicKeySize = keyPair.publicKey.encodeToByteString(EC.PublicKey.Format.DER).size
67-
println("Got ${curve.name} public key size: $actualPublicKeySize (expected $publicKeySize)")
67+
logger.log { "Got ${curve.name} public key size: $actualPublicKeySize (expected $publicKeySize)" }
6868
assertEquals(
6969
publicKeySize,
7070
actualPublicKeySize,
7171
"Public key size mismatch for ${curve.name}, expected: $publicKeySize, but got $actualPublicKeySize"
7272
)
7373
val actualPrivateKeySize = keyPair.privateKey.encodeToByteString(EC.PrivateKey.Format.DER).size
74-
println("Got ${curve.name} private key size: $actualPrivateKeySize (allowed $privateKeySizes)")
74+
logger.log { "Got ${curve.name} private key size: $actualPrivateKeySize (allowed $privateKeySizes)" }
7575
assertContains(
7676
privateKeySizes,
7777
actualPrivateKeySize,
@@ -80,7 +80,7 @@ abstract class EcdsaTest(provider: CryptographyProvider) : AlgorithmTest<ECDSA>(
8080

8181
generateDigests { digest, _ ->
8282
if (!supportsDigest(digest)) {
83-
println("Skipping digest $digest for curve ${curve.name}")
83+
logger.log { "Skipping digest $digest for curve ${curve.name}" }
8484
return@generateDigests
8585
}
8686

@@ -150,7 +150,7 @@ abstract class EcdsaTest(provider: CryptographyProvider) : AlgorithmTest<ECDSA>(
150150
@Test
151151
fun testFunctions() = testWithAlgorithm {
152152
if (!supportsFunctions()) {
153-
println("Skipping function test because functions are not supported by provider")
153+
logger.log { "Skipping function test because functions are not supported by provider" }
154154
return@testWithAlgorithm
155155
}
156156

@@ -164,21 +164,21 @@ abstract class EcdsaTest(provider: CryptographyProvider) : AlgorithmTest<ECDSA>(
164164
EC.Curve.brainpoolP512r1,
165165
).forEach { curve ->
166166
if (!supportsCurve(curve)) {
167-
println("Skipping function test for unsupported curve: ${curve.name}")
167+
logger.log { "Skipping function test for unsupported curve: ${curve.name}" }
168168
return@forEach
169169
}
170-
println("Running function test for curve: ${curve.name}")
170+
logger.log { "Running function test for curve: ${curve.name}" }
171171

172172
val keyPair = algorithm.keyPairGenerator(curve).generateKey()
173173

174174
generateDigests { digest, _ ->
175175
if (!supportsDigest(digest)) {
176-
println("Skipping digest $digest for curve ${curve.name}")
176+
logger.log { "Skipping digest $digest for curve ${curve.name}" }
177177
return@generateDigests
178178
}
179179

180180
ECDSA.SignatureFormat.entries.forEach { format ->
181-
println("Testing format $format for ${curve.name} / ${digest.name}")
181+
logger.log { "Testing format $format for ${curve.name} / ${digest.name}" }
182182
val signatureGenerator = keyPair.privateKey.signatureGenerator(digest, format)
183183
val signatureVerifier = keyPair.publicKey.signatureVerifier(digest, format)
184184

0 commit comments

Comments
 (0)