diff options
author | Jack Lloyd <[email protected]> | 2018-02-19 16:06:09 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-02-19 16:06:09 -0500 |
commit | ee036d3bb011fe7a45bec3fca6ef405b2340c5d7 (patch) | |
tree | 6827ab87e226336d92045d0ffefdfabce25479e7 /src/tests | |
parent | 67c6704457f49da06f97464f145bf9a9f1367055 (diff) | |
parent | b300eb0515b2a392793d887435b8ca44a1de7898 (diff) |
Merge GH #1454 Used shared_ptr repr for DL_Group
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/test_dl_group.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/tests/test_dl_group.cpp b/src/tests/test_dl_group.cpp index d402931c5..70aa526ef 100644 --- a/src/tests/test_dl_group.cpp +++ b/src/tests/test_dl_group.cpp @@ -43,25 +43,23 @@ class DL_Group_Tests final : public Test const std::string pem2 = orig.PEM_encode(Botan::DL_Group::ANSI_X9_57); const std::string pem3 = orig.PEM_encode(Botan::DL_Group::PKCS_3); - Botan::DL_Group group; + Botan::DL_Group group1(pem1); - group.PEM_decode(pem1); + result.test_eq("Same p in X9.42 decoding", group1.get_p(), orig.get_p()); + result.test_eq("Same q in X9.42 decoding", group1.get_q(), orig.get_q()); + result.test_eq("Same g in X9.42 decoding", group1.get_g(), orig.get_g()); - result.test_eq("Same p in X9.42 decoding", group.get_p(), orig.get_p()); - result.test_eq("Same q in X9.42 decoding", group.get_q(), orig.get_q()); - result.test_eq("Same g in X9.42 decoding", group.get_g(), orig.get_g()); + Botan::DL_Group group2(pem2); - group.PEM_decode(pem2); + result.test_eq("Same p in X9.57 decoding", group2.get_p(), orig.get_p()); + result.test_eq("Same q in X9.57 decoding", group2.get_q(), orig.get_q()); + result.test_eq("Same g in X9.57 decoding", group2.get_g(), orig.get_g()); - result.test_eq("Same p in X9.57 decoding", group.get_p(), orig.get_p()); - result.test_eq("Same q in X9.57 decoding", group.get_q(), orig.get_q()); - result.test_eq("Same g in X9.57 decoding", group.get_g(), orig.get_g()); + Botan::DL_Group group3(pem3); - group.PEM_decode(pem3); - - result.test_eq("Same p in X9.57 decoding", group.get_p(), orig.get_p()); + result.test_eq("Same p in X9.57 decoding", group3.get_p(), orig.get_p()); // no q in PKCS #3 format - result.test_eq("Same g in X9.57 decoding", group.get_g(), orig.get_g()); + result.test_eq("Same g in X9.57 decoding", group3.get_g(), orig.get_g()); return result; } |