palette256: fix up unit tests

pull/265/head
nick black 5 years ago
parent 004f5ca1ea
commit ec5e857a6c
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -155,7 +155,7 @@ pulser(struct notcurses* nc, struct ncplane* ncp __attribute__ ((unused)), void*
struct timespec* start = curry;
struct timespec now;
clock_gettime(CLOCK_MONOTONIC, &now);
if(timespec_to_ns(&now) - timespec_to_ns(start) >= timespec_to_ns(&demodelay) * 4 / 3){
if(timespec_to_ns(&now) - timespec_to_ns(start) >= timespec_to_ns(&demodelay) * 10 / 3){
return 1;
}
return demo_render(nc);

@ -26569,7 +26569,7 @@ show_copyright(struct notcurses* nc){
if(ncplane_set_fg(n, 0xffffff) < 0){
return NULL;
}
if(ncplane_putstr_aligned(n, 0, NCALIGN_RIGHT, "Image copyright Mark Ferrari. Used with permission.") < 0){
if(ncplane_putstr_aligned(n, 0, NCALIGN_RIGHT, "Image copyright Mark Ferrari/Living Worlds. Used with permission.") < 0){
return NULL;
}
}

@ -352,8 +352,7 @@ int ncvisual_render(const ncvisual* ncv, int begy, int begx, int leny, int lenx)
int bpp = av_get_bits_per_pixel(av_pix_fmt_desc_get(f->format));
const unsigned char* rgbbase_up = data + (linesize * visy) + (visx * bpp / CHAR_BIT);
const unsigned char* rgbbase_down = data + (linesize * (visy + 1)) + (visx * bpp / CHAR_BIT);
/*fprintf(stderr, "[%04d/%04d] bpp: %d lsize: %d %02x %02x %02x %02x\n",
y, x, bpp, linesize, rgbbase_up[0], rgbbase_up[1], rgbbase_up[2], rgbbase_up[3]);*/
//fprintf(stderr, "[%04d/%04d] bpp: %d lsize: %d %02x %02x %02x %02x\n", y, x, bpp, linesize, rgbbase_up[0], rgbbase_up[1], rgbbase_up[2], rgbbase_up[3]);
cell* c = ncplane_cell_ref_yx(ncv->ncp, y, x);
// use the default for the background, as that's the only way it's
// effective in that case anyway

@ -73,12 +73,13 @@ TEST_CASE("Palette256") {
// write it to an ncplane, and verify attributes via reflection
SUBCASE("PutCAttrs") {
cell c = CELL_TRIVIAL_INITIALIZER;
cell_load_simple(n_, &c, 'X');
CHECK(0 == cell_set_fg_palindex(&c, 0x20));
CHECK(0 == cell_set_bg_palindex(&c, 0x40));
CHECK(0 < ncplane_putc_yx(n_, 0, 0, &c));
cell_release(n_, &c);
cell r = CELL_TRIVIAL_INITIALIZER;
CHECK(0 == ncplane_at_yx(n_, 0, 0, &r));
CHECK(0 < ncplane_at_yx(n_, 0, 0, &r));
CHECK(cell_fg_palindex_p(&r));
CHECK(cell_bg_palindex_p(&r));
CHECK(CELL_ALPHA_OPAQUE == cell_fg_alpha(&r));
@ -90,8 +91,11 @@ TEST_CASE("Palette256") {
SUBCASE("RenderCAttrs") {
cell c = CELL_TRIVIAL_INITIALIZER;
cell_load_simple(n_, &c, 'X');
CHECK(0 == cell_set_fg_palindex(&c, 0x20));
CHECK(0 == cell_set_bg_palindex(&c, 0x40));
CHECK(0 == ncplane_set_fg_palindex(n_, 0x20));
CHECK(0 == ncplane_set_bg_palindex(n_, 0x40));
CHECK(0 < ncplane_putc_yx(n_, 0, 0, &c));
cell_release(n_, &c);
CHECK(0 == notcurses_render(nc_));

Loading…
Cancel
Save