Commit 1e6e5dcc authored by jds2's avatar jds2

Added VC8 build files; upgraded source based on splint analysis, changed...

Added VC8 build files; upgraded source based on splint analysis, changed defaults & added variables to configure.in (needs testing).


git-svn-id: http://svn.code.sf.net/p/cunit/code/trunk@92 f00e6729-6848-4c17-8bfb-678c97c00071
parent 4503936b
Anil Kumar
Anil Kumar (AK)
Email : anilsaharan@users.sourceforge.net
Jerry St.Clair
Jerry St.Clair (JDS)
Email : jds2@users.sourceforge.net
-----------------------------------------------------------
......
/*
* CUnit - A Unit testing framework library for C.
* Copyright (C) 2001 Anil Kumar
* Copyright (C) 2004, 2005 Anil Kumar, Jerry St.Clair
* Copyright (C) 2001 Anil Kumar
* Copyright (C) 2004,2005,2006 Anil Kumar, Jerry St.Clair
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......@@ -19,16 +19,13 @@
*/
/*
* Contains Interface for Automated Run tests which generates HTML Report Files.
* Automated Interface (generates HTML Report Files).
*
* Created By : Anil Kumar on ...(in month of Feb 2002)
* Last Modified : 13/Feb/2002
* Comment : Single interface to automated_run_tests
* EMail : aksaharan@yahoo.com
* Feb 2002 Initial implementation (AK)
*
* Modified : 20-Jul-2004 (JDS)
* Comment : New interface, doxygen comments.
* EMail : jds2@users.sourceforge.net
* 13/Feb/2002 Single interface to automated_run_tests. (AK)
*
* 20-Jul-2004 New interface, doxygen comments. (JDS)
*/
/** @file
......@@ -37,9 +34,9 @@
/** @addtogroup Automated
* @{
*/
#ifndef _CUNIT_AUTOMATED_H
#define _CUNIT_AUTOMATED_H
#ifndef CUNIT_AUTOMATED_H_SEEN
#define CUNIT_AUTOMATED_H_SEEN
#include "CUnit.h"
#include "TestDB.h"
......@@ -62,5 +59,5 @@ CU_EXPORT void CU_set_output_filename(const char* szFilenameRoot);
#ifdef __cplusplus
}
#endif
#endif /* _CUNIT_AUTOMATED_H_ */
#endif /* CUNIT_AUTOMATED_H_SEEN */
/** @} */
/*
* CUnit - A Unit testing framework library for C.
* Copyright (C) 2004, 2005 Jerry St.Clair
* Copyright (C) 2004,2005,2006 Jerry St.Clair
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......@@ -20,10 +20,7 @@
/*
* Interface for simple test runner.
*
* Created By : Jerry St.Clair (11-Aug-2004)
* Comment : Initial implementation of basic test runner interface
* EMail : jds2@users.sourceforge.net
*
* 11-Aug-2004 Initial implementation of basic test runner interface. (JDS)
*/
/** @file
......@@ -33,8 +30,8 @@
* @{
*/
#ifndef _CUNIT_BASIC_H
#define _CUNIT_BASIC_H
#ifndef CUNIT_BASIC_H_SEEN
#define CUNIT_BASIC_H_SEEN
#include "CUnit.h"
#include "TestDB.h"
......@@ -60,5 +57,5 @@ CU_EXPORT void CU_basic_show_failures(CU_pFailureRecord pFailure);
#ifdef __cplusplus
}
#endif
#endif /* _CUNIT_BASIC_H */
#endif /* CUNIT_BASIC_H_SEEN */
/** @} */
/*
* CUnit - A Unit testing framework library for C.
* Copyright (C) 2001 Anil Kumar
* Copyright (C) 2004, 2005 Anil Kumar, Jerry St.Clair
* Copyright (C) 2001 Anil Kumar
* Copyright (C) 2004,2005,2006 Anil Kumar, Jerry St.Clair
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......@@ -21,20 +21,15 @@
/*
* Contains Interface for console Run tests.
*
* Created By : Anil Kumar on ...(in month of Aug 2001)
* Last Modified : 09/Aug/2001
* Comment : Single interface to Console_run_tests
* EMail : aksaharan@yahoo.com
* Aug 2001 Initial implementation. (AK)
*
* Modified : 18-Jul-2004 (JDS)
* Comment : New interface
* EMail : jds2@users.sourceforge.net
* 09/Aug/2001 Single interface to Console_run_tests. (AK)
*
* Modified : 21-Apr-2005 (JDS)
* Comment : Changed header name to avoid clash with system curses.h
* EMail : jds2@users.sourceforge.net
* 18-Jul-2004 New interface. (JDS)
*
* 21-Apr-2005 Changed header name to avoid clash with system curses.h. (JDS)
*/
/** @file
* Curses testing interface with interactive output (user interface).
*/
......@@ -42,8 +37,8 @@
* @{
*/
#ifndef _CUNIT_CURSES_H
#define _CUNIT_CURSES_H
#ifndef CUNIT_CURSES_H_SEEN
#define CUNIT_CURSES_H_SEEN
#include "CUnit.h"
#include "TestDB.h"
......@@ -62,5 +57,5 @@ CU_EXPORT void CU_curses_run_tests(void);
#ifdef __cplusplus
}
#endif
#endif /* _CUNIT_CURSES_H */
#endif /* CUNIT_CURSES_H_SEEN */
/** @} */
/*
* CUnit - A Unit testing framework library for C.
* Copyright (C) 2001 Anil Kumar
* Copyright (C) 2004, 2005 Anil Kumar, Jerry St.Clair
* Copyright (C) 2001 Anil Kumar
* Copyright (C) 2004,2005,2006 Anil Kumar, Jerry St.Clair
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......@@ -21,54 +21,43 @@
/*
* Contains CUnit error codes which can be used externally.
*
* Created By : Anil Kumar on ...(in month of Aug 2001)
* Last Modified : 09/Aug/2001
* Comment : -------
* EMail : aksaharan@yahoo.com
* Aug 2001 Initial implementation. (AK)
*
* Modified : 02/Oct/2001
* Comment : Added proper Eror Codes
* EMail : aksaharan@yahoo.com
* 02/Oct/2001 Added proper Eror Codes. (AK)
*
* Modified : 13-Oct-2001
* Comment : Added Error Codes for Duplicate TestGroup and Test
* EMail : aksaharan@yahoo.com
* 13-Oct-2001 Added Error Codes for Duplicate TestGroup and Test. (AK)
*
* Modified : 3-Aug-2004 (JDS)
* Comment : Converted error code macros to an enum, doxygen comments
* moved error handing code here, changed file name from Errno.h,
* added error codes for file open errors, added error action selection
* EMail : jds2@users.sourceforge.net
* 03-Aug-2004 Converted error code macros to an enum, doxygen comments, moved
* error handing code here, changed file name from Errno.h, added
* error codes for file open errors, added error action selection. (JDS)
*
* Modified : 5-Sep-2004 (JDS)
* Comment : Added internal test interface.
* EMail : jds2@users.sourceforge.net
* 05-Sep-2004 Added internal test interface. (JDS)
*/
/** @file
* Error handling functions (user interface).
* CUnit uses a simple (and conventional) error handling strategy.
* Functions that can generate errors set (and usually return) an
* error code to indicate the run status. The error code can be
* inspected using the CU_get_error() function. A descriptive
* error message can be retrieved using CU_get_error_msg().
* Error handling functions (user interface).
* CUnit uses a simple (and conventional) error handling strategy.
* Functions that can generate errors set (and usually return) an
* error code to indicate the run status. The error code can be
* inspected using the CU_get_error() function. A descriptive
* error message can be retrieved using CU_get_error_msg().
*/
/** @addtogroup Framework
* @{
*/
#ifndef _CUNIT_CUERROR_H
#define _CUNIT_CUERROR_H
#ifndef CUNIT_CUERROR_H_SEEN
#define CUNIT_CUERROR_H_SEEN
#include <errno.h>
/*------------------------------------------------------------------------*/
/** CUnit error codes.
* If codes are added or removed, be sure to make a change to the
* error messages in CUError.c/get_error_desc().
* @see CU_set_error()
* @see CU_get_error()
* @see CU_get_error_msg()
* If codes are added or removed, be sure to make a change to the
* error messages in CUError.c/get_error_desc().
* @see CU_set_error()
* @see CU_get_error()
* @see CU_get_error_msg()
*/
typedef enum {
/* basic errors */
......@@ -101,10 +90,10 @@ typedef enum {
/*------------------------------------------------------------------------*/
/** CUnit error action codes.
* These are used to set the action desired when an error
* condition is detected in the CUnit framework.
* @see CU_set_error_action()
* @see CU_get_error_action()
* These are used to set the action desired when an error
* condition is detected in the CUnit framework.
* @see CU_set_error_action()
* @see CU_get_error_action()
*/
typedef enum CU_ErrorAction {
CUEA_IGNORE, /**< Runs should be continued when an error condition occurs (if possible). */
......@@ -141,5 +130,5 @@ void CU_set_error(CU_ErrorCode error);
#define get_error() CU_get_error_msg()
#endif /* USE_DEPRECATED_CUNIT_NAMES */
#endif /* _CUNIT_CUERROR_H */
#endif /* CUNIT_CUERROR_H_SEEN */
/** @} */
This diff is collapsed.
This diff is collapsed.
/*
* CUnit - A Unit testing framework library for C.
* Copyright (C) 2001 Anil Kumar
* Copyright (C) 2004, 2005 Anil Kumar, Jerry St.Clair
* Copyright (C) 2001 Anil Kumar
* Copyright (C) 2004,2005,2006 Anil Kumar, Jerry St.Clair
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......@@ -21,14 +21,11 @@
/*
* Contains Interface for console Run tests.
*
* Created By : Anil Kumar on ...(in month of Aug 2001)
* Last Modified : 09/Aug/2001
* Comment : Single interface to Console_run_tests
* EMail : aksaharan@yahoo.com
* Aug 2001 Initial implementation. (AK)
*
* Modified : 20-Jul-2004 (JDS)
* Comment : New interface, doxygen comments
* EMail : jds2@users.sourceforge.net
* 09/Aug/2001 Single interface to Console_run_tests. (AK)
*
* 20-Jul-2004 New interface, doxygen comments. (JDS)
*/
/** @file
......@@ -38,8 +35,8 @@
* @{
*/
#ifndef _CUNIT_CONSOLE_H
#define _CUNIT_CONSOLE_H
#ifndef CUNIT_CONSOLE_H_SEEN
#define CUNIT_CONSOLE_H_SEEN
#include "CUnit.h"
#include "TestDB.h"
......@@ -58,5 +55,5 @@ CU_EXPORT void CU_console_run_tests(void);
#ifdef __cplusplus
}
#endif
#endif /* _CUNIT_CONSOLE_H_ */
#endif /* CUNIT_CONSOLE_H_SEEN */
/** @} */
/*
* CUnit - A Unit testing framework library for C.
* Copyright (C) 2001 Anil Kumar
* Copyright (C) 2004, 2005 Anil Kumar, Jerry St.Clair
* Copyright (C) 2001 Anil Kumar
* Copyright (C) 2004,2005,2006 Anil Kumar, Jerry St.Clair
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......@@ -22,34 +22,27 @@
* Contains Memory Related Defines to use internal routines to detect Memory Leak
* in Debug Versions
*
* Created By : Anil Kumar on ...(18 June 2002)
* Last Modified : 18/Jun/2002
* Comment : Memory Debug Functions
* EMail : aksaharan@yahoo.com
* 18/Jun/2002 Memory Debug Functions. (AK)
*
* Modified : 17-Jul-2004 (JDS)
* Comment : New interface for global function names.
* EMail : jds2@users.sourceforge.net
* 17-Jul-2004 New interface for global function names. (JDS)
*
* Modified : 5-Sep-2004 (JDS)
* Comment : Added internal test interface.
* EMail : jds2@users.sourceforge.net
* 05-Sep-2004 Added internal test interface. (JDS)
*/
/** @file
* Memory management functions (user interface).
* Two versions of memory allocation/deallocation are available.
* If compiled with MEMTRACE defined, CUnit keeps track of all
* system allocations & deallocations. The memory record can
* then be reported using CU_CREATE_MEMORY_REPORT. Otherwise,
* standard system memory allocation is used without tracing.
* Memory management functions (user interface).
* Two versions of memory allocation/deallocation are available.
* If compiled with MEMTRACE defined, CUnit keeps track of all
* system allocations & deallocations. The memory record can
* then be reported using CU_CREATE_MEMORY_REPORT. Otherwise,
* standard system memory allocation is used without tracing.
*/
/** @addtogroup Framework
* @{
*/
#ifndef _CUNIT_MYMEM_H
#define _CUNIT_MYMEM_H
#ifndef CUNIT_MYMEM_H_SEEN
#define CUNIT_MYMEM_H_SEEN
#ifdef __cplusplus
extern "C" {
......@@ -74,7 +67,7 @@ extern "C" {
#define CU_CREATE_MEMORY_REPORT(x) CU_dump_memory_usage((x))
/** Generate report on tracked memory (old macro). */
#define CU_DUMP_MEMORY_USAGE(x) CU_dump_memory_usage((x))
#else
#else /* MEMTRACE */
/** Standard calloc() if MEMTRACE not defined. */
#define CU_CALLOC(x, y) calloc((x), (y))
/** Standard malloc() if MEMTRACE not defined. */
......@@ -83,11 +76,11 @@ extern "C" {
#define CU_FREE(x) free((x))
/** Standard realloc() if MEMTRACE not defined. */
#define CU_REALLOC(x, y) realloc((x), (y))
/** No-op if MEMTRACE not defined. */
/** No-op if MEMTRACE not defined. */
#define CU_CREATE_MEMORY_REPORT(x)
/** No-op if MEMTRACE not defined. */
/** No-op if MEMTRACE not defined. */
#define CU_DUMP_MEMORY_USAGE(x)
#endif
#endif /* MEMTRACE */
#ifdef CUNIT_BUILD_TESTS
/** Disable memory allocation for testing purposes. */
......@@ -102,11 +95,10 @@ unsigned int test_cunit_get_n_allocations(void* pLocation);
unsigned int test_cunit_get_n_deallocations(void* pLocation);
void test_cunit_MyMem(void);
#endif
#endif /* CUNIT_BUILD_TESTS */
#ifdef __cplusplus
}
#endif
#endif /* _CUNIT_MYMEM_H */
#endif /* CUNIT_MYMEM_H_SEEN */
/** @} */
This diff is collapsed.
/*
* CUnit - A Unit testing framework library for C.
* Copyright (C) 2001 Anil Kumar
* Copyright (C) 2004, 2005 Anil Kumar, Jerry St.Clair
* Copyright (C) 2001 Anil Kumar
* Copyright (C) 2004,2005,2006 Anil Kumar, Jerry St.Clair
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......@@ -21,47 +21,41 @@
/*
* Contains Interface to Run tests.
*
* Created By : Anil Kumar on ...(in month of Aug 2001)
* Last Modified : 09/Aug/2001
* Comment : Contains generic run tests interface which can be used
* be used for any type of frontend interface framework.
* EMail : aksaharan@yahoo.com
* Aug 2001 Initial implementation. (AK)
*
* Last Modified : 24/Nov/2001
* Comment : Added Handler for Group Initialization failure condition.
* EMail : aksaharan@yahoo.com
* 09/Aug/2001 Contains generic run tests interface which can be used
* for any type of frontend interface framework. (AK)
*
* Last Modified : 5-Aug-2004 (JDS)
* Comment : New interface. Since these should be internal functions,
* no support for deprecated version 1 names provided now,
* eliminated global variables for current test & suite,
* moved (renamed) _TestResult here from TestDB.h.
* EMail : jds2@users.sourceforge.net
* 24/Nov/2001 Added Handler for Group Initialization failure condition. (AK)
*
* Modified : 5-Sep-2004 (JDS)
* Comment : Added internal test interface.
* EMail : jds2@users.sourceforge.net
* 05-Aug-2004 New interface. Since these should be internal functions,
* no support for deprecated version 1 names provided now,
* eliminated global variables for current test & suite,
* moved (renamed) _TestResult here from TestDB.h. (JDS)
*
* 05-Sep-2004 Added internal test interface. (JDS)
*/
/** @file
* Test run management functions (user interface).
* The TestRun module implements functions supporting the running
* of tests elements (suites and tests). This includes functions for
* running suites and tests, retrieving the number of tests/suites run,
* and managing callbacks during the run process.
* <P>The callback mechanism works as follows. The CUnit runtime system
* supports the registering and calling of functions at the start and end
* of each test, when all tests are complete, and when a suite
* initialialization function returns an error. This allows clients to
* perform actions associated with these events such as output formatting
* and reporting.</P>
* Test run management functions (user interface).
* The TestRun module implements functions supporting the running
* of tests elements (suites and tests). This includes functions for
* running suites and tests, retrieving the number of tests/suites run,
* and managing callbacks during the run process.
*
* <P>The callback mechanism works as follows. The CUnit runtime system
* supports the registering and calling of functions at the start and end
* of each test, when all tests are complete, and when a suite
* initialialization function returns an error. This allows clients to
* perform actions associated with these events such as output formatting
* and reporting.</P>
*/
/** @addtogroup Framework
* @{
*/
#ifndef _CUNIT_TESTRUN_H
#define _CUNIT_TESTRUN_H
#ifndef CUNIT_TESTRUN_H_SEEN
#define CUNIT_TESTRUN_H_SEEN
#include "CUnit.h"
#include "CUError.h"
......@@ -103,38 +97,39 @@ typedef CU_RunSummary* CU_pRunSummary; /**< Pointer to CU_RunSummary. */
/* Type Definitions for Message Handlers. */
/** Message handler called at the start of a test.
* The parameters are the test and suite being run.
* The test run is considered in progress when the
* message handler is called.
* The parameters are the test and suite being run.
* The test run is considered in progress when the
* message handler is called. Neither pTest nor
* pSuite may be null.
*/
typedef void (*CU_TestStartMessageHandler)(const CU_pTest pTest, const CU_pSuite pSuite);
/** Message handler called at the completion of a test.
* The parameters are the test and suite being run, plus
* a pointer to the first failure record applicable to
* this test. If the test did not have any assertion
* failures, pFailure will be NULL.
* The test run is considered in progress when the
* message handler is called.
* The parameters are the test and suite being run, plus
* a pointer to the first failure record applicable to
* this test. If the test did not have any assertion
* failures, pFailure will be NULL.
* The test run is considered in progress when the
* message handler is called.
*/
typedef void (*CU_TestCompleteMessageHandler)(const CU_pTest pTest, const CU_pSuite pSuite,
const CU_pFailureRecord pFailure);
/** Message handler called at the completion of a test run.
* The parameter is a pointer to the linked list holding
* the failure records for the test run.
* The test run is considered completed when the
* message handler is called.
* The parameter is a pointer to the linked list holding
* the failure records for the test run.
* The test run is considered completed when the
* message handler is called.
*/
typedef void (*CU_AllTestsCompleteMessageHandler)(const CU_pFailureRecord pFailure);
/** Message handler called when a suite initializer fails.
* The test run is considered in progress when the
* message handler is called.
* The test run is considered in progress when the
* message handler is called.
*/
typedef void (*CU_SuiteInitFailureMessageHandler)(const CU_pSuite pSuite);
/** Message handler called when a suite cleanup function fails.
* The test run is considered in progress when the
* message handler is called.
* The test run is considered in progress when the
* message handler is called.
*/
typedef void (*CU_SuiteCleanupFailureMessageHandler)(const CU_pSuite pSuite);
......@@ -194,5 +189,5 @@ void test_cunit_TestRun(void);
#ifdef __cplusplus
}
#endif
#endif /* _CUNIT_TESTRUN_H */
#endif /* CUNIT_TESTRUN_H_SEEN */
/** @} */
/*
* CUnit - A Unit testing framework library for C.
* Copyright (C) 2001 Anil Kumar
* Copyright (C) 2004, 2005 Anil Kumar, Jerry St.Clair
* Copyright (C) 2001 Anil Kumar
* Copyright (C) 2004,2005,2006 Anil Kumar, Jerry St.Clair
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......@@ -22,22 +22,14 @@
* Contains Type Definitions for some generic functions used across
* CUnit project files.
*
* Created By : Anil Kumar on 13/Oct/2001
* Last Modified : 13/Oct/2001
* Comment : Moved some of the generic functions declarations
* from other files to this one so as to use the
* functions consitently. This file is not included
* in the distribution headers because it is used
* internally by CUnit.
* EMail : aksaharan@yahoo.com
* 13/Oct/2001 Moved some of the generic functions declarations from
* other files to this one so as to use the functions
* consitently. This file is not included in the distribution
* headers because it is used internally by CUnit. (AK)
*
* Last Modified : 20-Jul-2004 (JDS)
* Comment : New interface, support for deprecated version 1 names.
* EMail : jds2@users.sourceforge.net
* 20-Jul-2004 New interface, support for deprecated version 1 names. (JDS)
*
* Modified : 5-Sep-2004 (JDS)
* Comment : Added internal test interface.
* EMail : jds2@users.sourceforge.net
* 5-Sep-2004 Added internal test interface. (JDS)
*/
/** @file
......@@ -47,8 +39,8 @@
* @{
*/
#ifndef _CUNIT_UTIL_H
#define _CUNIT_UTIL_H
#ifndef CUNIT_UTIL_H_SEEN
#define CUNIT_UTIL_H_SEEN
#include "CUnit.h"
......@@ -61,7 +53,7 @@ extern "C" {
/** maximum number of characters in a translated xml entity. */
#define CUNIT_MAX_ENTITY_LEN 5
CU_EXPORT int CU_translate_special_characters(const char* szSrc, char* szDest, int maxlen);
CU_EXPORT int CU_translate_special_characters(const char* szSrc, char* szDest, size_t maxlen);
CU_EXPORT int CU_compare_strings(const char* szSrc, const char* szDest);
CU_EXPORT void CU_trim_left(char* szString);
......@@ -91,5 +83,5 @@ void test_cunit_Util(void);
#endif /* USE_DEPRECATED_CUNIT_NAMES */
#endif /* _CUNIT_UTIL_H */
#endif /* CUNIT_UTIL_H_SEEN */
/** @} */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
* CUnit - A Unit testing framework library for C.
* Copyright (C) 2001 Anil Kumar
* Copyright (C) 2004, 2005 Anil Kumar, Jerry St.Clair
* Copyright (C) 2001 Anil Kumar
* Copyright (C) 2004,2005,2006 Anil Kumar, Jerry St.Clair
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......@@ -19,25 +19,16 @@
*/
/*
* Contains the Curses based Test Interface implementation.
* Implementation of the Curses based Test Interface.
*
* Created By : Anil Kumar on ...(on 1st Nov. 2001)
* Last Modified : 01/Nov/2001
* Comment : Started Curses based interface for CUnit.
* Email : aksaharan@yahoo.com
* 01/Nov/2001 Started Curses based interface for CUnit. (AK)
*
* Modified : 04/Nov/2001 by Anil Kumar
* Comment : Added Scrolling Capability to the Details Window.
* Email : aksaharan@yahoo.com
* 04/Nov/2001 Added Scrolling Capability to the Details Window. (AK)
*
* Modified : 24/Nov/2001 by Anil Kumar
* Comment : Added List and Show Failure Capability to the Details Window.
* Also added group initialization failure message handler.
* Email : aksaharan@yahoo.com
* 24/Nov/2001 Added List and Show Failure Capability to the Details Window.
* Also added group initialization failure message handler. (AK)
*
* Modified : 9-Aug-2004 (JDS)
* Comment : New interface, made all curses local functions static
* Email : jds2@users.sourceforge.net
* 09-Aug-2004 New interface, made all curses local functions static. (JDS)
*/
/** @file
......@@ -213,11 +204,13 @@ void CU_curses_run_tests(void)
setvbuf(stderr, NULL, _IONBF, 0);
f_szOptions = MAIN_OPTIONS;
if (!initialize_windows())
return;
if (!initialize_windows()) {
return;
}
if (!test_initialize())
if (!test_initialize()) {
goto test_initialize_fail;
}
curses_registry_level_run(CU_get_registry());
......@@ -266,8 +259,9 @@ static bool initialize_windows(void)
{
bool bStatus = false;
if (NULL == (application_windows.pMainWin = initscr()))
if (NULL == (application_windows.pMainWin = initscr())) {
goto main_fail;
}
start_color();
......@@ -276,23 +270,29 @@ static bool initialize_windows(void)
f_nWidth = application_windows.pMainWin->_maxx;
f_nHeight = application_windows.pMainWin->_maxy;
if (NULL == (application_windows.pTitleWin = newwin(3, f_nWidth, 0, 0)))
if (NULL == (application_windows.pTitleWin = newwin(3, f_nWidth, 0, 0))) {
goto title_fail;
}
if (NULL == (application_windows.pProgressWin = newwin(2, f_nWidth, 3, 0)))
if (NULL == (application_windows.pProgressWin = newwin(2, f_nWidth, 3, 0))) {
goto progress_fail;
}
if (NULL == (application_windows.pSummaryWin = newwin(1, f_nWidth, 5, 0)))
if (NULL == (application_windows.pSummaryWin = newwin(1, f_nWidth, 5, 0))) {
goto summary_fail;
}
if (NULL == (application_windows.pRunSummaryWin = newwin(1, f_nWidth, 6, 0)))
if (NULL == (application_windows.pRunSummaryWin = newwin(1, f_nWidth, 6, 0))) {
goto run_summary_fail;
}
if (NULL == (application_windows.pDetailsWin = newwin(f_nHeight - f_nTop - 7 , f_nWidth, 7, 0)))
if (NULL == (application_windows.pDetailsWin = newwin(f_nHeight - f_nTop - 7 , f_nWidth, 7, 0))) {
goto details_fail;
}
if (NULL == (application_windows.pOptionsWin = newwin(1, f_nWidth, f_nHeight - f_nTop, 0)))
if (NULL == (application_windows.pOptionsWin = newwin(1, f_nWidth, f_nHeight - f_nTop, 0))) {
goto option_fail;
}
curs_set(0);
noecho();
......@@ -344,8 +344,9 @@ static void uninitialize_windows(void)
nocbreak();
keypad(application_windows.pMainWin, CU_FALSE);
if (details_pad.pPad)
if (details_pad.pPad) {
delwin(details_pad.pPad);
}
delwin(application_windows.pOptionsWin);
delwin(application_windows.pDetailsWin);
......@@ -387,17 +388,18 @@ static void refresh_title_window(void)
const char* const szSite = "http:\\\\cunit.sourceforge.net\\";
static bool bFirstTime = true;
if (!bFirstTime)
if (!bFirstTime) {
return;
}
wattrset(application_windows.pTitleWin, A_BOLD | COLOR_PAIR(TITLE_COLOR));
mvwprintw(application_windows.pTitleWin,
0, f_nLeft + (f_nWidth - strlen(szPackageTitle))/2,
"%s", szPackageTitle);
0, f_nLeft + (f_nWidth - strlen(szPackageTitle))/2,
"%s", szPackageTitle);
wattrset(application_windows.pTitleWin, A_BOLD | A_UNDERLINE | COLOR_PAIR(TITLE_COLOR));
mvwprintw(application_windows.pTitleWin, 1, f_nLeft + (f_nWidth - strlen(szSite))/2,
"%s", szSite);
"%s", szSite);
wattrset(application_windows.pTitleWin, A_NORMAL);
wrefresh(application_windows.pTitleWin);
......@@ -422,7 +424,7 @@ static void refresh_summary_window(voi