diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2015-05-21 10:32:15 +0200 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2015-05-21 10:32:15 +0200 |
commit | 7e55ba1b366936c7e1f91f44c9eb281c6b094350 (patch) | |
tree | ab4b78fdbe16bbcc40c9bac3979cad83ee744b55 /OpenKeychain-Test/src | |
parent | 6b6ca4c18ef96517829fcea954b3d46ff776a881 (diff) | |
parent | f30900d085f38034708f62f94e46a38f222d4cb7 (diff) | |
download | open-keychain-7e55ba1b366936c7e1f91f44c9eb281c6b094350.tar.gz open-keychain-7e55ba1b366936c7e1f91f44c9eb281c6b094350.tar.bz2 open-keychain-7e55ba1b366936c7e1f91f44c9eb281c6b094350.zip |
Merge branch 'master' of github.com:open-keychain/open-keychain
Diffstat (limited to 'OpenKeychain-Test/src')
-rw-r--r-- | OpenKeychain-Test/src/test/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperationTest.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/OpenKeychain-Test/src/test/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperationTest.java b/OpenKeychain-Test/src/test/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperationTest.java index 54ccccc3d..056165e01 100644 --- a/OpenKeychain-Test/src/test/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperationTest.java +++ b/OpenKeychain-Test/src/test/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperationTest.java @@ -99,6 +99,14 @@ public class PgpKeyOperationTest { parcel.mAddUserIds.add("twi"); parcel.mAddUserIds.add("pink"); + + { + int type = 42; + byte[] data = new byte[] { 0, 1, 2, 3, 4 }; + WrappedUserAttribute uat = WrappedUserAttribute.fromSubpacket(type, data); + parcel.mAddUserAttribute.add(uat); + } + parcel.mNewUnlock = new ChangeUnlockParcel(passphrase); PgpKeyOperation op = new PgpKeyOperation(null); @@ -231,6 +239,17 @@ public class PgpKeyOperationTest { Assert.assertEquals("number of user ids must be two", 2, ring.getPublicKey().getUnorderedUserIds().size()); + ArrayList<WrappedUserAttribute> attributes = + ring.getPublicKey().getUnorderedUserAttributes(); + Assert.assertEquals("number of user attributes must be one", + 1, attributes.size()); + Assert.assertEquals("user attribute must be correct type", + 42, attributes.get(0).getType()); + Assert.assertEquals("user attribute must have one subpacket", + 1, attributes.get(0).getSubpackets().length); + Assert.assertArrayEquals("user attribute must have correct data", + new byte[] { 0, 1, 2, 3, 4 }, attributes.get(0).getSubpackets()[0]); + List<UncachedPublicKey> subkeys = KeyringTestingHelper.itToList(ring.getPublicKeys()); Assert.assertEquals("number of subkeys must be three", 3, subkeys.size()); |