diff options
author | Art O Cathain <art.home@gmail.com> | 2014-07-06 15:05:20 +0100 |
---|---|---|
committer | Art O Cathain <art.home@gmail.com> | 2014-07-06 15:50:07 +0100 |
commit | 22108cf4e2ddd74be0d02e6560ac3db0cd547532 (patch) | |
tree | 9729178be563f7698114785b6eee94d2bf085422 /OpenKeychain/src/main | |
parent | 80e09bd05e69c2517fbb7a1573bdd6f515a36fc8 (diff) | |
download | open-keychain-22108cf4e2ddd74be0d02e6560ac3db0cd547532.tar.gz open-keychain-22108cf4e2ddd74be0d02e6560ac3db0cd547532.tar.bz2 open-keychain-22108cf4e2ddd74be0d02e6560ac3db0cd547532.zip |
actually canonicalize
Diffstat (limited to 'OpenKeychain/src/main')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/testsupport/UncachedKeyringTestingHelper.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/testsupport/UncachedKeyringTestingHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/testsupport/UncachedKeyringTestingHelper.java index e0580a86a..ac4955715 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/testsupport/UncachedKeyringTestingHelper.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/testsupport/UncachedKeyringTestingHelper.java @@ -14,10 +14,12 @@ import org.spongycastle.openpgp.PGPUserAttributeSubpacketVector; import org.spongycastle.openpgp.operator.bc.BcKeyFingerprintCalculator; import org.sufficientlysecure.keychain.pgp.UncachedKeyRing; import org.sufficientlysecure.keychain.pgp.UncachedPublicKey; +import org.sufficientlysecure.keychain.service.OperationResultParcel; import java.math.BigInteger; import java.util.Arrays; import java.util.Date; +import java.util.Objects; /** * Created by art on 28/06/14. @@ -25,7 +27,14 @@ import java.util.Date; public class UncachedKeyringTestingHelper { public static boolean compareRing(UncachedKeyRing keyRing1, UncachedKeyRing keyRing2) { - return TestDataUtil.iterEquals(keyRing1.getPublicKeys(), keyRing2.getPublicKeys(), new + OperationResultParcel.OperationLog operationLog = new OperationResultParcel.OperationLog(); + UncachedKeyRing canonicalized = keyRing1.canonicalize(operationLog, 0); + + if (canonicalized == null) { + throw new AssertionError("Canonicalization failed; messages: [" + operationLog.toString() + "]"); + } + + return TestDataUtil.iterEquals(canonicalized.getPublicKeys(), keyRing2.getPublicKeys(), new TestDataUtil.EqualityChecker<UncachedPublicKey>() { @Override public boolean areEquals(UncachedPublicKey lhs, UncachedPublicKey rhs) { |