diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2015-05-28 16:37:15 +0200 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2015-05-28 16:37:15 +0200 |
commit | 40703fe961eef8d884800b70d9af57da9fce2769 (patch) | |
tree | 243575bae2a32a872c2b5f902cb259bd383d15a7 /OpenKeychain-Test/src/test/java/org/sufficientlysecure | |
parent | 4ecd4389b3f09ad7b8ee30cc072f64da3f2b4f51 (diff) | |
parent | ee02e110e7f1a90d2a91c4fc09834b8c073cbba7 (diff) | |
download | open-keychain-40703fe961eef8d884800b70d9af57da9fce2769.tar.gz open-keychain-40703fe961eef8d884800b70d9af57da9fce2769.tar.bz2 open-keychain-40703fe961eef8d884800b70d9af57da9fce2769.zip |
Merge branch 'master' into development
Conflicts:
OpenKeychain/src/main/res/values/strings.xml
Diffstat (limited to 'OpenKeychain-Test/src/test/java/org/sufficientlysecure')
-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 18210d91a..312875229 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 @@ -100,6 +100,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); @@ -232,6 +240,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()); |