From cb9d3c701b1d194449af6169bacbfd7cf58808ec Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Fri, 2 Feb 2024 10:23:28 -0300 Subject: [PATCH] Fix flaky metadata decoding test --- .../seedvault/metadata/MetadataWriterDecoderTest.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/test/java/com/stevesoltys/seedvault/metadata/MetadataWriterDecoderTest.kt b/app/src/test/java/com/stevesoltys/seedvault/metadata/MetadataWriterDecoderTest.kt index 88a54d2d..32d3224c 100644 --- a/app/src/test/java/com/stevesoltys/seedvault/metadata/MetadataWriterDecoderTest.kt +++ b/app/src/test/java/com/stevesoltys/seedvault/metadata/MetadataWriterDecoderTest.kt @@ -26,7 +26,10 @@ internal class MetadataWriterDecoderTest { @Test fun `encoded metadata matches decoded metadata (no packages)`() { - val metadata = getMetadata() + val metadata = getMetadata().let { + if (it.version == 0.toByte()) it.copy(salt = "") // no salt in version 0 + else it + } assertEquals( metadata, decoder.decode(encoder.encode(metadata), metadata.version, metadata.token)