X-Git-Url: https://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=test%2Fpair_content.c;h=35e2fc4b44bde72233652c0191d3c2fc4630dfb2;hb=1ddfa997c0965852dbdc738aa6d92c0cd0975f3b;hp=fc5926b50386096708e78e4ad639aedef847ca64;hpb=47d2fb4537d9ad5bb14f4810561a327930ca4280;p=ncurses.git diff --git a/test/pair_content.c b/test/pair_content.c index fc5926b5..35e2fc4b 100644 --- a/test/pair_content.c +++ b/test/pair_content.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2018-2019,2020 Thomas E. Dickey * + * Copyright 2018-2020,2022 Thomas E. Dickey * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: pair_content.c,v 1.14 2020/02/02 23:34:34 tom Exp $ + * $Id: pair_content.c,v 1.16 2022/05/15 15:46:28 tom Exp $ */ #define NEED_TIME_H @@ -62,13 +62,20 @@ static struct timeval initial_time; static struct timeval finish_time; #endif +static void +finish(int code) +{ + free(expected); + ExitProgram(code); +} + static void failed(const char *msg) { printw("%s", msg); getch(); endwin(); - ExitProgram(EXIT_FAILURE); + finish(EXIT_FAILURE); } #if USE_EXTENDED_COLOR @@ -115,6 +122,7 @@ random_color(void) static void setup_test(void) { + setlocale(LC_ALL, ""); initscr(); cbreak(); noecho(); @@ -230,7 +238,7 @@ usage(void) size_t n; for (n = 0; n < SIZEOF(msg); n++) fprintf(stderr, "%s\n", msg[n]); - ExitProgram(EXIT_FAILURE); + finish(EXIT_FAILURE); } int @@ -313,5 +321,5 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) finish_test(); } - ExitProgram(EXIT_SUCCESS); + finish(EXIT_SUCCESS); }