From c325f619dd071b5489989f645e42cace8eb23fb4 Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Fri, 2 Aug 2019 18:04:02 -0400 Subject: Return an error from descriptor Parse that gives more information about what failed --- src/test/descriptor_tests.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/test') 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> 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); -- cgit v1.2.3