From f7ab2658925dd28fdd163449581c921fa4aef588 Mon Sep 17 00:00:00 2001 From: 0x330a <92654767+0x330a@users.noreply.github.com> Date: Wed, 14 Dec 2022 15:15:48 +1100 Subject: [PATCH] fix: byte array comparison equality tests --- .../messenger/libsession_util/InstrumentedTests.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libsession-util/src/androidTest/java/network/loki/messenger/libsession_util/InstrumentedTests.kt b/libsession-util/src/androidTest/java/network/loki/messenger/libsession_util/InstrumentedTests.kt index d0ae006f95..9557a7abaf 100644 --- a/libsession-util/src/androidTest/java/network/loki/messenger/libsession_util/InstrumentedTests.kt +++ b/libsession-util/src/androidTest/java/network/loki/messenger/libsession_util/InstrumentedTests.kt @@ -38,12 +38,12 @@ class InstrumentedTests { val kp = keyPair val curvePkBytes = Sodium.ed25519PkToCurve25519(kp.pubKey) - val edPk = Hex.toString(kp.pubKey) - val curvePk = Hex.toString(curvePkBytes) + val edPk = kp.pubKey + val curvePk = curvePkBytes - assertEquals("4cb76fdc6d32278e3f83dbf608360ecc6b65727934b85d2fb86862ff98c46ab7", edPk) - assertEquals("d2ad010eeb72d72e561d9de7bd7b6989af77dcabffa03a5111a6c859ae5c3a72", curvePk) - assertEquals(kp.secretKey.take(32), seed) + assertArrayEquals(Hex.fromStringCondensed("4cb76fdc6d32278e3f83dbf608360ecc6b65727934b85d2fb86862ff98c46ab7"), edPk) + assertArrayEquals(Hex.fromStringCondensed("d2ad010eeb72d72e561d9de7bd7b6989af77dcabffa03a5111a6c859ae5c3a72"), curvePk) + assertArrayEquals(kp.secretKey.take(32).toByteArray(), seed) } @Test