notcurses/tests/Exceptions.cpp

24 lines
500 B
C++
Raw Normal View History

#define NCPP_EXCEPTIONS_PLEASE
#include "main.h"
2020-10-03 22:54:34 +00:00
#include <memory>
2020-05-21 21:22:12 +00:00
using namespace ncpp;
TEST_CASE("Exceptions") {
2020-05-21 21:22:12 +00:00
2020-07-23 05:56:42 +00:00
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") {
2020-07-23 05:56:42 +00:00
NotCurses nc{ nopts };
CHECK_THROWS_AS(nc.reset_stats(nullptr), invalid_argument);
}
}