"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Mark Jamsek <mark@jamsek.com>
Subject:
Re: tog test harness
To:
Game of Trees <gameoftrees@openbsd.org>
Date:
Fri, 14 Apr 2023 23:08:54 +1000

Download raw body.

Thread
On 23-04-14 03:02PM, Stefan Sperling wrote:
> On Fri, Apr 14, 2023 at 10:49:01PM +1000, Mark Jamsek wrote:
> > Very nice, ok. I was actually working on a similar diff with minor
> > changes but I like this better; I was also calling init_curses() from
> > main. I've added a patch below with one of the differences though, which
> > applies on top of yours. It just consolidates all the tog_io_close()
> > calls at the end of main().
> 
> Sure. I have put my diff in just now. Ok for your diff as well.

Great, thanks!

> > @@ -9821,6 +9793,11 @@ main(int argc, char *argv[])
> >  			error = cmd->cmd_main(argc, cmd_argv ? cmd_argv : argv);
> >  	}
> >  
> > +	if (using_mock_io) {
> > +		io_err = tog_io_close();
> > +		if (error == NULL)
> > +			error = io_err;
> > +	}
> >  	endwin();
> 
> I wonder if we should be calling endwin() if we never called initscr()?

Yes, even though we don't call initscr() in tog regress, we need to call
endwin() because we call newterm() in init_mock_term().

-- 
Mark Jamsek <fnc.bsdbox.org|got.bsdbox.org>
GPG: F2FF 13DE 6A06 C471 CA80  E6E2 2930 DC66 86EE CF68