diff options
author | Andrew Chow <achow101-github@achow101.com> | 2019-08-02 18:04:02 -0400 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2019-08-16 19:34:01 -0400 |
commit | c325f619dd071b5489989f645e42cace8eb23fb4 (patch) | |
tree | 25177eef2a597ec4bdfff5abe7782c10be5daf2f /src/test/descriptor_tests.cpp | |
parent | 7a960ba775a60ebcc2e830356693e3ed702b22f1 (diff) |
Return an error from descriptor Parse that gives more information about what failed
Diffstat (limited to 'src/test/descriptor_tests.cpp')
-rw-r--r-- | src/test/descriptor_tests.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/test/descriptor_tests.cpp b/src/test/descriptor_tests.cpp index f5bda7d5e6..6296634d28 100644 --- a/src/test/descriptor_tests.cpp +++ b/src/test/descriptor_tests.cpp @@ -16,8 +16,9 @@ namespace { void CheckUnparsable(const std::string& prv, const std::string& pub) { FlatSigningProvider keys_priv, keys_pub; - auto parse_priv = Parse(prv, keys_priv); - auto parse_pub = Parse(pub, keys_pub); + std::string error; + auto parse_priv = Parse(prv, keys_priv, error); + auto parse_pub = Parse(pub, keys_pub, error); BOOST_CHECK_MESSAGE(!parse_priv, prv); BOOST_CHECK_MESSAGE(!parse_pub, pub); } @@ -62,10 +63,11 @@ void Check(const std::string& prv, const std::string& pub, int flags, const std: { FlatSigningProvider keys_priv, keys_pub; std::set<std::vector<uint32_t>> left_paths = paths; + std::string error; // Check that parsing succeeds. - auto parse_priv = Parse(MaybeUseHInsteadOfApostrophy(prv), keys_priv); - auto parse_pub = Parse(MaybeUseHInsteadOfApostrophy(pub), keys_pub); + auto parse_priv = Parse(MaybeUseHInsteadOfApostrophy(prv), keys_priv, error); + auto parse_pub = Parse(MaybeUseHInsteadOfApostrophy(pub), keys_pub, error); BOOST_CHECK(parse_priv); BOOST_CHECK(parse_pub); |