X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Fpair_content.c;h=c0e0e71d62e15b3b999bc1b67430cc797aff85bd;hp=2b39a7bc0ef190c11148ef81a197c47eb1d55c79;hb=66dce3ce75bac445bd106da5322f1ec3fb1e56e4;hpb=efa78d11c3ea7f51c7078b64a34c98b44ecb0e1a diff --git a/test/pair_content.c b/test/pair_content.c index 2b39a7bc..c0e0e71d 100644 --- a/test/pair_content.c +++ b/test/pair_content.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2018,2019 Free Software Foundation, Inc. * + * 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.13 2019/08/24 23:02:49 tom Exp $ + * $Id: pair_content.c,v 1.17 2022/05/28 20:15:06 tom Exp $ */ #define NEED_TIME_H @@ -62,13 +62,20 @@ static struct timeval initial_time; static struct timeval finish_time; #endif +static GCC_NORETURN 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); }