notcurses_cursor_enable: remove terribly broken test #1812

pull/1815/head
nick black 3 years ago
parent f50df3240a
commit 491862b60b
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -1508,10 +1508,6 @@ int notcurses_cursor_enable(notcurses* nc, int y, int x){
logerror("Illegal cursor placement: %d, %d\n", y, x);
return -1;
}
if(y >= nc->margin_t || x >= nc->margin_l){
logerror("Illegal cursor placement: %d, %d\n", y, x);
return -1;
}
// if we're already at the demanded location, we must already be visible, and
// we needn't move the cursor -- return success immediately.
if(nc->cursory == y && nc->cursorx == x){

@ -1,5 +1,17 @@
#include <notcurses/direct.h>
static int
rendered_cursor(void){
struct notcurses* nc = notcurses_init(NULL, NULL);
notcurses_cursor_enable(nc, 10, 10);
sleep(1);
notcurses_render(nc);
sleep(1);
notcurses_stop(nc);
return 0;
}
int main(void){
struct ncdirect* n = ncdirect_core_init(NULL, stdout, 0);
if(n == NULL){
@ -13,6 +25,9 @@ int main(void){
int dimy = ncdirect_dim_y(n);
printf("Cursor: column %d/%d row %d/%d\n", x, dimx, y, dimy);
ncdirect_stop(n);
if(rendered_cursor()){
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
err:

Loading…
Cancel
Save