run sgr-full and sgr-direct in test suite #1138

pull/1145/head
nick black 4 years ago
parent f82ad10667
commit b7ea4e2359
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -538,6 +538,14 @@ add_test(
NAME ncpp_build_exceptions
COMMAND ncpp_build_exceptions
)
add_test(
NAME sgr-full
COMMAND sgr-full
)
add_test(
NAME sgr-direct
COMMAND sgr-direct
)
add_test(
NAME rgb
COMMAND rgb

@ -1696,7 +1696,7 @@ int cell_duplicate(struct ncplane* n, cell* targ, const cell* c);
// Release resources held by the cell 'c'.
void cell_release(struct ncplane* n, cell* c);
#define NCSTYLE_MASK 0xfffful
#define NCSTYLE_MASK 0x03fful
#define NCSTYLE_STANDOUT 0x0080ul
#define NCSTYLE_UNDERLINE 0x0040ul
#define NCSTYLE_REVERSE 0x0020ul

@ -605,7 +605,7 @@ API int cell_duplicate(struct ncplane* n, cell* targ, const cell* c);
// Release resources held by the cell 'c'.
API void cell_release(struct ncplane* n, cell* c);
#define NCSTYLE_MASK 0xffffu
#define NCSTYLE_MASK 0x03ffu
#define NCSTYLE_STANDOUT 0x0080u
#define NCSTYLE_UNDERLINE 0x0040u
#define NCSTYLE_REVERSE 0x0020u

@ -3,13 +3,17 @@
#include <notcurses/notcurses.h>
int main(void){
struct notcurses* nc = notcurses_init(NULL, NULL);
struct notcurses_options nopts = {
.flags = NCOPTION_NO_ALTERNATE_SCREEN,
};
struct notcurses* nc = notcurses_init(&nopts, NULL);
if(nc == NULL){
return EXIT_FAILURE;
}
int dimy, dimx;
struct ncplane* n = notcurses_stddim_yx(nc, &dimy, &dimx);
int y = 0;
// FIXME do full permutations?
ncplane_set_styles(n, NCSTYLE_NONE);
ncplane_putstr_yx(n, y++, 0, "a ═ none");
ncplane_set_styles(n, NCSTYLE_ITALIC);
@ -23,7 +27,7 @@ int main(void){
ncplane_set_styles(n, NCSTYLE_BLINK);
ncplane_putstr_yx(n, y++, 0, "a ═ blink");
ncplane_set_styles(n, NCSTYLE_STRUCK);
ncplane_putstr_yx(n, y++, 0, "a ═ strikethrough");
ncplane_putstr_yx(n, y++, 0, "a ═ struck");
ncplane_set_styles(n, NCSTYLE_ITALIC | NCSTYLE_BOLD);
ncplane_putstr_yx(n, y++, 0, "a ═ italic bold");
ncplane_set_styles(n, NCSTYLE_ITALIC | NCSTYLE_REVERSE);
@ -48,11 +52,14 @@ int main(void){
ncplane_putstr_yx(n, y++, 0, "a ═ bold underline");
ncplane_set_styles(n, NCSTYLE_BOLD | NCSTYLE_BLINK);
ncplane_putstr_yx(n, y++, 0, "a ═ bold blink");
ncplane_putstr_yx(n, y++, 0, "sleeping for 15s...");
ncplane_set_styles(n, NCSTYLE_BOLD | NCSTYLE_REVERSE | NCSTYLE_UNDERLINE |
NCSTYLE_BLINK | NCSTYLE_ITALIC | NCSTYLE_STRUCK);
ncplane_putstr_yx(n, y++, 0, "a ═ whoomp! there it is");
ncplane_set_styles(n, NCSTYLE_NONE);
if(notcurses_render(nc)){
goto err;
}
sleep(15);
if(notcurses_stop(nc)){
return EXIT_FAILURE;
}

Loading…
Cancel
Save