mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-16 00:13:00 +00:00
26 lines
581 B
C++
26 lines
581 B
C++
#define NCPP_EXCEPTIONS_PLEASE
|
|
#include "main.h"
|
|
|
|
using namespace ncpp;
|
|
|
|
TEST_CASE("Exceptions") {
|
|
|
|
SUBCASE("GetInstance") {
|
|
CHECK_THROWS_AS(NotCurses::get_instance(), invalid_state_error);
|
|
}
|
|
|
|
SUBCASE("ResetStats") {
|
|
NotCurses nc;
|
|
CHECK_THROWS_AS(nc.reset_stats(nullptr), invalid_argument);
|
|
}
|
|
|
|
// ncpp only allows one notcurses object at a time (why?)
|
|
SUBCASE("OnlyOneNotCurses") {
|
|
NotCurses nc;
|
|
std::unique_ptr<NotCurses> nc2;
|
|
// FIXME attempts to match ::init_error have failed thus far :/
|
|
CHECK_THROWS(nc2.reset(new NotCurses()));
|
|
}
|
|
|
|
}
|