Exceptions tests: use flags + loglevel

pull/821/head
nick black 4 years ago committed by Nick Black
parent bae1cedd6b
commit 8ee7b3652c

@ -5,18 +5,23 @@ using namespace ncpp;
TEST_CASE("Exceptions") {
notcurses_options nopts{};
nopts.flags = NCOPTION_SUPPRESS_BANNERS |
NCOPTION_INHIBIT_SETLOCALE;
nopts.loglevel = NCLOGLEVEL_VERBOSE;
SUBCASE("GetInstance") {
CHECK_THROWS_AS(NotCurses::get_instance(), invalid_state_error);
}
SUBCASE("ResetStats") {
NotCurses nc;
NotCurses nc{ nopts };
CHECK_THROWS_AS(nc.reset_stats(nullptr), invalid_argument);
}
// ncpp only allows one notcurses object at a time (why?)
SUBCASE("OnlyOneNotCurses") {
NotCurses nc;
NotCurses nc{ nopts };
std::unique_ptr<NotCurses> nc2;
// FIXME attempts to match ::init_error have failed thus far :/
CHECK_THROWS(nc2.reset(new NotCurses()));

@ -9,6 +9,7 @@ TEST_CASE("Ncpp"
notcurses_options nopts{};
nopts.flags = NCOPTION_SUPPRESS_BANNERS |
NCOPTION_INHIBIT_SETLOCALE;
nopts.loglevel = NCLOGLEVEL_VERBOSE;
// we ought be able to construct a NotCurses object with a nullptr FILE
// or even just no argument (decays to nullptr).

Loading…
Cancel
Save