summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-03-31 17:05:59 +0200
committerJustus Winter <justus@sequoia-pgp.org>2020-03-31 18:26:02 +0200
commitd270c7b59d0abd228a37149b53ac00617de6b858 (patch)
tree1d0da99503a6a9c69df6d6311330a686c82f2119
parent33b4f8fe59bbed90d5a95c5596003812f4d3ea0a (diff)
openpgp: Implement Arbitrary for RevocationKey.
-rw-r--r--openpgp/src/types/revocation_key.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/openpgp/src/types/revocation_key.rs b/openpgp/src/types/revocation_key.rs
index 9ffa7a85..b342640b 100644
--- a/openpgp/src/types/revocation_key.rs
+++ b/openpgp/src/types/revocation_key.rs
@@ -1,3 +1,5 @@
+use quickcheck::{Arbitrary, Gen};
+
use crate::{
Error,
Fingerprint,
@@ -96,3 +98,14 @@ const REVOCATION_KEY_FLAG_SENSITIVE: u8 = 0x40;
/// Mask covering the unknown bits.
const REVOCATION_KEY_MASK_UNKNOWN: u8 = ! (REVOCATION_KEY_FLAG_MUST_BE_SET
| REVOCATION_KEY_FLAG_SENSITIVE);
+
+impl Arbitrary for RevocationKey {
+ fn arbitrary<G: Gen>(g: &mut G) -> Self {
+ RevocationKey {
+ pk_algo: Arbitrary::arbitrary(g),
+ fp: Arbitrary::arbitrary(g),
+ sensitive: Arbitrary::arbitrary(g),
+ unknown: Arbitrary::arbitrary(g),
+ }
+ }
+}