#define BOOST_TEST_MODULE TestDepend #include #include #include #include using namespace Gentoo::Utils::Git; BOOST_AUTO_TEST_CASE( gitErrorMessage ) { xmlInitParser(); try { gitSafeGet(git_repository_open_ext, git_repository_free, "/", 0, nullptr); } catch (const Gentoo::GitError & ge) { BOOST_TEST_CONTEXT(ge.what()) { BOOST_REQUIRE_EQUAL(ge.errorCode, 1); BOOST_REQUIRE_EQUAL(ge.errorClass, 6); BOOST_REQUIRE(ge.operation.find("git_repository_open_ext") + 1); BOOST_REQUIRE(ge.message.find("repository") + 1); } } xmlCleanupParser(); git_libgit2_shutdown(); }