Commit 52856205 authored by tlh2000's avatar tlh2000

* removed trailing whitespaces


git-svn-id: http://svn.code.sf.net/p/cunit/code/trunk@128 f00e6729-6848-4c17-8bfb-678c97c00071
parent b9833f07
......@@ -34,7 +34,7 @@
/** @addtogroup Automated
* @{
*/
#ifndef CUNIT_AUTOMATED_H_SEEN
#define CUNIT_AUTOMATED_H_SEEN
......@@ -46,31 +46,31 @@ extern "C" {
#endif
CU_EXPORT void CU_automated_run_tests(void);
/**<
/**<
* Runs CUnit tests using the automated interface.
* This function sets appropriate callback functions, initializes the
* test output files, and calls the appropriate functions to list the
* tests and run them. If an output file name root has not been
* specified using CU_set_output_filename(), a generic root will be
* This function sets appropriate callback functions, initializes the
* test output files, and calls the appropriate functions to list the
* tests and run them. If an output file name root has not been
* specified using CU_set_output_filename(), a generic root will be
* applied. It is an error to call this function before the CUnit
* test registry has been initialized (check by assertion).
*/
CU_EXPORT CU_ErrorCode CU_list_tests_to_file(void);
/**<
* Generates an xml file containing a list of all tests in all suites
* in the active registry. The output file will be named according to
* the most recent call to CU_set_output_filename(), or a default if
/**<
* Generates an xml file containing a list of all tests in all suites
* in the active registry. The output file will be named according to
* the most recent call to CU_set_output_filename(), or a default if
* not previously set.
*
* @return An error code indicating the error status.
*/
CU_EXPORT void CU_set_output_filename(const char* szFilenameRoot);
/**<
/**<
* Sets the root file name for automated test output files.
* The strings "-Listing.xml" and "-Results.xml" are appended to the
* specified root to generate the filenames. If szFilenameRoot is
* The strings "-Listing.xml" and "-Results.xml" are appended to the
* specified root to generate the filenames. If szFilenameRoot is
* empty, the default root ("CUnitAutomated") is used.
*
* @param szFilenameRoot String containing root to use for file names.
......
......@@ -48,7 +48,7 @@ typedef enum {
} CU_BasicRunMode;
CU_EXPORT CU_ErrorCode CU_basic_run_tests(void);
/**<
/**<
* Runs all registered CUnit tests using the basic interface.
* The default CU_BasicRunMode is used unless it has been
* previously changed using CU_basic_set_mode(). The CUnit test
......@@ -59,7 +59,7 @@ CU_EXPORT CU_ErrorCode CU_basic_run_tests(void);
*/
CU_EXPORT CU_ErrorCode CU_basic_run_suite(CU_pSuite pSuite);
/**<
/**<
* Runs all tests for a specific suite in the basic interface.
* If pSuite is NULL, the function returns without taking any
* action. The default CU_BasicRunMode is used unless it has
......@@ -99,8 +99,8 @@ CU_EXPORT CU_BasicRunMode CU_basic_get_mode(void);
CU_EXPORT void CU_basic_show_failures(CU_pFailureRecord pFailure);
/**<
* Prints a summary of run failures to stdout.
* This is provided for user convenience upon request, and does
* not take into account the current run mode. The failures are
* This is provided for user convenience upon request, and does
* not take into account the current run mode. The failures are
* printed to stdout independent of the most recent run mode.
*
* @param pFailure List of CU_pFailureRecord's to output.
......
......@@ -31,10 +31,10 @@
* return, provided _FATAL versions of assertions to return
* from test function on failure. (JDS)
*
* 01-Sep-2004 Modified assertions for setjmp/longjmp mechanism of
* 01-Sep-2004 Modified assertions for setjmp/longjmp mechanism of
* aborting test runs, added CU_FAIL and CU_PASS macros. (JDS)
*
* 07-May-2005 Added CU_ prefix to remaining CUnit defines (BOOL, TRUE,
* 07-May-2005 Added CU_ prefix to remaining CUnit defines (BOOL, TRUE,
* FALSE, MAX_...). Added CU_UNREFERENCED_PARAMETER() define. (JDS)
*/
......
This diff is collapsed.
This diff is collapsed.
......@@ -23,8 +23,8 @@
* CUnit project files.
*
* 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
* 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)
*
* 20-Jul-2004 New interface, support for deprecated version 1 names. (JDS)
......@@ -33,8 +33,8 @@
*
* 17-Apr-2006 Added CU_translated_strlen() and CU_number_width().
* Removed CUNIT_MAX_STRING_LENGTH - dangerous since not enforced.
* Fixed off-by-1 error in CU_translate_special_characters(),
* modifying implementation & results in some cases. User can
* Fixed off-by-1 error in CU_translate_special_characters(),
* modifying implementation & results in some cases. User can
* now tell if conversion failed. (JDS)
*/
......@@ -58,23 +58,23 @@ extern "C" {
/**< Maximum number of characters in a translated xml entity. */
CU_EXPORT size_t CU_translate_special_characters(const char *szSrc, char *szDest, size_t maxlen);
/**<
* Converts special characters in szSrc to xml entity codes and stores
/**<
* Converts special characters in szSrc to xml entity codes and stores
* result in szDest. Currently conversion of '&', '<', and '>' is supported.
* Note that conversion to entities increases the length of the converted
* string. The greatest conversion size increase would be a string
* consisting entirely of entity characters of converted length
* CUNIT_MAX_ENTITY_LEN. Neither szSrc nor szDest may be NULL
* Note that conversion to entities increases the length of the converted
* string. The greatest conversion size increase would be a string
* consisting entirely of entity characters of converted length
* CUNIT_MAX_ENTITY_LEN. Neither szSrc nor szDest may be NULL
* (checked by assertion).<br /><br />
*
* maxlen gives the maximum number of characters in the translated string.
* If szDest does not have enough room to hold the converted string, the
* return value will be zero and szDest will contain an empty string.
* If this occurs, the remaining characters in szDest may be overwritten
* in an unspecified manner. It is the caller's responsibility to make
* sure there is sufficient room in szDest to hold the converted string.
* CU_translated_strlen() may be used to calculate the length of buffer
* required (remember to add 1 for the terminating \0).
* in an unspecified manner. It is the caller's responsibility to make
* sure there is sufficient room in szDest to hold the converted string.
* CU_translated_strlen() may be used to calculate the length of buffer
* required (remember to add 1 for the terminating \0).
*
* @param szSrc Source string to convert (non-NULL).
* @param szDest Location to hold the converted string (non-NULL).
......@@ -84,11 +84,11 @@ CU_EXPORT size_t CU_translate_special_characters(const char *szSrc, char *szDest
*/
CU_EXPORT size_t CU_translated_strlen(const char *szSrc);
/**<
/**<
* Calculates the length of a translated string.
* This function calculates the buffer length required to hold a string
* after processing with CU_translate_special_characters(). The returned
* length does not include space for the terminating '\0' character.
* length does not include space for the terminating '\0' character.
* szSrc may not be NULL (checked by assertion).
*
* @param szSrc Source string to analyze (non-NULL).
......@@ -112,20 +112,20 @@ CU_EXPORT void CU_trim_left(char *szString);
*/
CU_EXPORT void CU_trim_right(char *szString);
/**<
/**<
* Trims trailing whitespace from the specified string.
* @param szString The string to trim.
*/
CU_EXPORT void CU_trim(char *szString);
/**<
/**<
* Trims leading and trailing whitespace from the specified string.
* @param szString The string to trim.
*/
CU_EXPORT size_t CU_number_width(int number);
/**<
* Calulates the number of places required to display
/**<
* Calulates the number of places required to display
* number in decimal.
*/
......
......@@ -116,12 +116,12 @@ void CU_automated_run_tests(void)
CU_set_test_complete_handler(automated_test_complete_message_handler);
CU_set_all_test_complete_handler(automated_all_tests_complete_message_handler);
CU_set_suite_init_failure_handler(automated_suite_init_failure_message_handler);
CU_set_suite_cleanup_failure_handler(automated_suite_cleanup_failure_message_handler);
CU_set_suite_cleanup_failure_handler(automated_suite_cleanup_failure_message_handler);
f_bWriting_CUNIT_RUN_SUITE = CU_FALSE;
automated_run_all_tests(NULL);
if (CUE_SUCCESS != uninitialize_result_file()) {
fprintf(stderr, "\n%s", _("ERROR - Failed to close/uninitialize the result files."));
}
......@@ -172,9 +172,9 @@ CU_ErrorCode CU_list_tests_to_file()
* Static function implementation
*=================================================================*/
/** Runs the registered tests using the automated interface.
* If non-NULL. the specified registry is set as the active
* If non-NULL. the specified registry is set as the active
* registry for running the tests. If NULL, then the default
* CUnit test registry is used. The actual test running is
* CUnit test registry is used. The actual test running is
* performed by CU_run_all_tests().
* @param pRegistry The test registry to run.
*/
......@@ -445,7 +445,7 @@ static void automated_suite_init_failure_message_handler(const CU_pSuite pSuite)
" <FAILURE_REASON> %s </FAILURE_REASON> \n"
" </CUNIT_RUN_SUITE_FAILURE> \n"
" </CUNIT_RUN_SUITE> \n",
pSuite->pName,
pSuite->pName,
_("Suite Initialization Failed"));
}
......@@ -473,7 +473,7 @@ static void automated_suite_cleanup_failure_message_handler(const CU_pSuite pSui
" <FAILURE_REASON> %s </FAILURE_REASON> \n"
" </CUNIT_RUN_SUITE_FAILURE> \n"
" </CUNIT_RUN_SUITE> \n",
pSuite->pName,
pSuite->pName,
_("Suite Cleanup Failed"));
}
......@@ -592,7 +592,7 @@ static CU_ErrorCode automated_list_all_tests(CU_pTestRegistry pRegistry, const c
" <TEST_CASE_DEFINITION> \n"
" <TEST_CASE_NAME> %s </TEST_CASE_NAME> \n"
" <TEST_ACTIVE_VALUE> %s </TEST_ACTIVE_VALUE> \n"
" </TEST_CASE_DEFINITION> \n",
" </TEST_CASE_DEFINITION> \n",
pTest->pName,
(CU_FALSE != pSuite->fActive) ? _("Yes") : _("No"));
pTest = pTest->pNext;
......
......@@ -175,8 +175,8 @@ static CU_ErrorCode basic_initialize(void)
/*------------------------------------------------------------------------*/
/** Runs all tests within the basic interface.
* If non-NULL, the test registry is changed to the specified registry
* before running the tests, and reset to the original registry when
* If non-NULL, the test registry is changed to the specified registry
* before running the tests, and reset to the original registry when
* done. If NULL, the default CUnit test registry will be used.
* @param pRegistry The CU_pTestRegistry containing the tests
* to be run. If NULL, use the default registry.
......@@ -254,8 +254,8 @@ static void basic_test_start_message_handler(const CU_pTest pTest, const CU_pSui
* @param pSuite The suite containing the test.
* @param pFailure Pointer to the 1st failure record for this test.
*/
static void basic_test_complete_message_handler(const CU_pTest pTest,
const CU_pSuite pSuite,
static void basic_test_complete_message_handler(const CU_pTest pTest,
const CU_pSuite pSuite,
const CU_pFailureRecord pFailureList)
{
CU_pFailureRecord pFailure = pFailureList;
......
......@@ -36,7 +36,7 @@
* 24-Apr-2006 Suite/test selection is now by number rather than name.
* Inactive suites/tests now reported.
* Interface supports (de)activation of tests/suites.
* Help function added for both menu levels.
* Help function added for both menu levels.
* Option menu added. Immediate action on hotkeys
* without needing to <ENTER>, like curses. (JDS)
*
......@@ -143,9 +143,9 @@ void CU_console_run_tests(void)
/*=================================================================
* Static function implementation
*=================================================================*/
/**
/**
* Main loop for console interface.
* Displays actions and responds based on user imput. If pRegistry
* Displays actions and responds based on user imput. If pRegistry
* is NULL, will use the default internal CUnit test registry.
*
* @param pRegistry The CU_pTestRegistry to use for testing.
......@@ -303,7 +303,7 @@ static CU_STATUS console_suite_level_run(CU_pSuite pSuite)
}
/*------------------------------------------------------------------------*/
/**
/**
* Sets CUnit options interactively using console interface.
* Displays actions and responds based on user imput.
*/
......@@ -314,7 +314,7 @@ static CU_STATUS console_set_options_run(void)
char szTemp[256];
while (CU_STATUS_CONTINUE == eStatus) {
fprintf(stdout, "\n%s\n",
fprintf(stdout, "\n%s\n",
_("***************** CUNIT CONSOLE - OPTIONS **************************"));
fprintf(stdout, _(" 1 - Inactive suites/tests treated as runtime failures %s"),
(CU_FALSE != CU_get_fail_on_inactive()) ? _("Yes") : _("No"));
......@@ -338,10 +338,10 @@ static CU_STATUS console_set_options_run(void)
}
/*------------------------------------------------------------------------*/
/**
/**
* Runs all tests within the console interface.
* The test registry is changed to the specified registry before running
* the tests, and reset to the original registry when done. If pRegistry
* The test registry is changed to the specified registry before running
* the tests, and reset to the original registry when done. If pRegistry
* is NULL, the default internal CUnit test registry is used.
*
* @param pRegistry The CU_pTestRegistry containing the tests to be run.
......@@ -393,14 +393,14 @@ static CU_ErrorCode console_run_single_test(CU_pSuite pSuite, CU_pTest pTest)
/*------------------------------------------------------------------------*/
/**
* Reads the number of a test from standard input and locates the test
* at that position. A pointer to the located test is stored
* Reads the number of a test from standard input and locates the test
* at that position. A pointer to the located test is stored
* in ppTest upon return.
*
* @param pSuite The suite to be queried.
* @param ppTest Pointer to location to store the selected test.
* @return CUE_SUCCESS if a test was successfully selected, CUE_NOTEST
* otherwise. On return, ppTest points to the test selected,
* otherwise. On return, ppTest points to the test selected,
* or NULL if none.
*/
static CU_ErrorCode select_test(CU_pSuite pSuite, CU_pTest* ppTest)
......@@ -418,7 +418,7 @@ static CU_ErrorCode select_test(CU_pSuite pSuite, CU_pTest* ppTest)
else {
list_tests(pSuite);
fprintf(stdout, "\n");
fprintf(stdout, _("Enter number of test to select (1-%u) : "),
fprintf(stdout, _("Enter number of test to select (1-%u) : "),
pSuite->uiNumberOfTests);
fgets(buffer, 100, stdin);
......@@ -430,16 +430,16 @@ static CU_ErrorCode select_test(CU_pSuite pSuite, CU_pTest* ppTest)
/*------------------------------------------------------------------------*/
/**
* Reads the number of a suite from standard input and locates the suite
* at that position. If pRegistry is NULL, the default CUnit registry
* will be used. The located pSuite is returned in ppSuite. ppSuite
* will be NULL if there is no suite in the registry having the input name.
* Reads the number of a suite from standard input and locates the suite
* at that position. If pRegistry is NULL, the default CUnit registry
* will be used. The located pSuite is returned in ppSuite. ppSuite
* will be NULL if there is no suite in the registry having the input name.
* Returns NULL if the suite is successfully located, non-NULL otherwise.
*
* @param pRegistry The CU_pTestRegistry to query. If NULL, use the
* default internal CUnit test registry.
* @param ppSuite Pointer to location to store the selected suite.
* @return CUE_SUCCESS if a suite was successfully selected, CUE_NOSUITE
* @return CUE_SUCCESS if a suite was successfully selected, CUE_NOSUITE
* otherwise. On return, ppSuite points to the suite selected.
*/
static CU_ErrorCode select_suite(CU_pTestRegistry pRegistry, CU_pSuite* ppSuite)
......@@ -457,7 +457,7 @@ static CU_ErrorCode select_suite(CU_pTestRegistry pRegistry, CU_pSuite* ppSuite)
else {
list_suites(pRegistry);
fprintf(stdout, "\n");
fprintf(stdout, _("Enter number of suite to select (1-%u) : "),
fprintf(stdout, _("Enter number of suite to select (1-%u) : "),
pRegistry->uiNumberOfSuites);
fgets(buffer, 100, stdin);
......@@ -501,9 +501,9 @@ static void list_suites(CU_pTestRegistry pRegistry)
}
fprintf(stdout, "\n%s", _("--------------------- Registered Suites -----------------------------"));
fprintf(stdout, "\n%*s %-*s%*s%*s%*s%*s\n",
fprintf(stdout, "\n%*s %-*s%*s%*s%*s%*s\n",
width[0], _("#"),
width[1], _("Suite Name"),
width[1], _("Suite Name"),
width[2], _("Init?"),
width[3], _("Cleanup?"),
width[4], _("#Tests"),
......@@ -542,7 +542,7 @@ static void list_tests(CU_pSuite pSuite)
fprintf(stdout, "\n");
fprintf(stdout, _("Suite %s contains no tests."), pSuite->pName);
fprintf(stdout, "\n");
return;
return;
}
assert(NULL != pSuite->pTest);
......@@ -554,20 +554,20 @@ static void list_tests(CU_pSuite pSuite)
width[2] = CU_MAX(strlen(_("Active?")), CU_MAX(f_yes_width, f_no_width)) + 1;
}
fprintf(stdout, "\n%s",
fprintf(stdout, "\n%s",
_("----------------- Test List ------------------------------"));
fprintf(stdout, "\n%s%s\n", _("Suite: "), pSuite->pName);
fprintf(stdout, "\n%*s %-*s%*s\n",
fprintf(stdout, "\n%*s %-*s%*s\n",
width[0], _("#"),
width[1], _("Test Name"),
width[2], _("Active?"));
for (uiCount = 1, pCurTest = pSuite->pTest ;
NULL != pCurTest ;
for (uiCount = 1, pCurTest = pSuite->pTest ;
NULL != pCurTest ;
uiCount++, pCurTest = pCurTest->pNext) {
assert(NULL != pCurTest->pName);
fprintf(stdout, "\n%*u. %-*.*s%*s",
width[0], uiCount,
fprintf(stdout, "\n%*u. %-*.*s%*s",
width[0], uiCount,
width[1], width[1]-1, pCurTest->pName,
width[2]-1, (CU_FALSE != pCurTest->fActive) ? _("Yes") : _("No"));
}
......@@ -588,21 +588,21 @@ static void show_failures(void)
}
else {
fprintf(stdout, "\n%s",
fprintf(stdout, "\n%s",
_("--------------- Test Run Failures -------------------------"));
fprintf(stdout, "\n%s\n",
fprintf(stdout, "\n%s\n",
_(" src_file:line# : (suite:test) : failure_condition"));
for (i = 1 ; (NULL != pFailure) ; pFailure = pFailure->pNext, i++) {
fprintf(stdout, "\n%d. %s:%u : (%s : %s) : %s", i,
(NULL != pFailure->strFileName)
(NULL != pFailure->strFileName)
? pFailure->strFileName : "",
pFailure->uiLineNumber,
((NULL != pFailure->pSuite) && (NULL != pFailure->pSuite->pName))
((NULL != pFailure->pSuite) && (NULL != pFailure->pSuite->pName))
? pFailure->pSuite->pName : "",
((NULL != pFailure->pTest) && (NULL != pFailure->pTest->pName))
((NULL != pFailure->pTest) && (NULL != pFailure->pTest->pName))
? pFailure->pTest->pName : "",
(NULL != pFailure->strCondition)
(NULL != pFailure->strCondition)
? pFailure->strCondition : "");
}
fprintf(stdout, "\n-----------------------------------------------------------");
......@@ -641,8 +641,8 @@ static void console_test_start_message_handler(const CU_pTest pTest, const CU_pS
* @param pSuite The suite containing the test.
* @param pFailure Pointer to the 1st failure record for this test.
*/
static void console_test_complete_message_handler(const CU_pTest pTest,
const CU_pSuite pSuite,
static void console_test_complete_message_handler(const CU_pTest pTest,
const CU_pSuite pSuite,
const CU_pFailureRecord pFailure)
{
/*
......@@ -675,7 +675,7 @@ static void console_suite_init_failure_message_handler(const CU_pSuite pSuite)
assert(NULL != pSuite);
assert(NULL != pSuite->pName);
fprintf(stdout,
fprintf(stdout,
_("\nWARNING - Suite initialization failed for '%s'."), pSuite->pName);
}
......
......@@ -33,7 +33,7 @@
* 30-Apr-2006 Suite/test selection is now by number rather than name.
* Inactive suites/tests now reported.
* Interface supports (de)activation of tests/suites.
* Help function added for both menu levels.
* Help function added for both menu levels.
* Option menu added. (JDS)
*
* 02-May-2006 Added internationalization hooks. (JDS)
......@@ -121,10 +121,10 @@ typedef struct
/** Standard string length. */
#define STRING_LENGTH 128
/** String holding main menu run options. */
static const char* MAIN_OPTIONS =
static const char* MAIN_OPTIONS =
N_("(R)un (S)elect (L)ist (A)ctivate (F)ailures (O)ptions (H)elp (Q)uit");
/** String holding suite menu run options. */
static const char* SUITE_OPTIONS =
static const char* SUITE_OPTIONS =
N_("(R)un (S)elect (L)ist (A)ctivate (F)ailures (O)ptions (H)elp (U)p (Q)uit");
/*
......@@ -437,7 +437,7 @@ static void show_detail_window_message(const char *msg)
assert(256 >= strlen(msg));
mvwprintw(details_pad.pPad, 0, 0, "%s", msg);
refresh_details_window();
}
}
}
/*------------------------------------------------------------------------*/
......@@ -450,7 +450,7 @@ static void refresh_run_summary_window(void)
if (f_pCurrentTest && f_pCurrentSuite) {
assert(NULL != f_pCurrentTest->pName);
assert(NULL != f_pCurrentSuite->pName);
snprintf(szTemp, STRING_LENGTH, _(szRunSummary),
snprintf(szTemp, STRING_LENGTH, _(szRunSummary),
f_pCurrentTest->pName, f_pCurrentSuite->pName);
}
else {
......@@ -546,7 +546,7 @@ static bool test_initialize(void)
/*------------------------------------------------------------------------*/
/** Parse a string and return the coded hotkeys.
* If called with szStr non-NULL, the string is simply stored.
* Subsequent calls with szStr NULL will cause the
* Subsequent calls with szStr NULL will cause the
* hotkeys in the string (chars between parentheses) to
* be returned sequentially in the order in which they
* appear in the original string.
......@@ -580,7 +580,7 @@ static const char* get_hotkey(const char* szStr, int* pPos)
else if (nTempIndex && ')' == *pS) {
szTemp[nTempIndex++] = *pS;
szTemp[nTempIndex++] = '\0';
return szTemp;
return szTemp;
}
else if (nTempIndex) {
szTemp[nTempIndex++] = *pS;
......@@ -591,7 +591,7 @@ static const char* get_hotkey(const char* szStr, int* pPos)
}
/*------------------------------------------------------------------------*/
/**
/**
* Main loop for curses interface.
* Displays actions and responds based on user imput.
* @param pRegistry The CU_pTestRegistry to use for testing.
......@@ -623,7 +623,7 @@ static STATUS curses_registry_level_run(CU_pTestRegistry pRegistry)
}
else {
list_suites(pRegistry);
snprintf(szTemp, STRING_LENGTH, _("Enter number of suite to select (1-%u) : "),
snprintf(szTemp, STRING_LENGTH, _("Enter number of suite to select (1-%u) : "),
pRegistry->uiNumberOfSuites);
read_input_string(szTemp, szSuiteNumber, STRING_LENGTH);
refresh_details_window();
......@@ -656,7 +656,7 @@ static STATUS curses_registry_level_run(CU_pTestRegistry pRegistry)
else {
while (1) {
list_suites(pRegistry);
snprintf(szTemp, STRING_LENGTH, _("Enter number of suite to select (1-%u) : "),
snprintf(szTemp, STRING_LENGTH, _("Enter number of suite to select (1-%u) : "),
pRegistry->uiNumberOfSuites);
read_input_string(szTemp, szSuiteNumber, STRING_LENGTH);
refresh_details_window();
......@@ -730,14 +730,14 @@ static STATUS curses_suite_level_run(CU_pSuite pSuite)
else if (option == _("S")[0]) {
if (0 == pSuite->uiNumberOfTests) {
snprintf(szTemp, STRING_LENGTH,
snprintf(szTemp, STRING_LENGTH,
_("Suite %s contains no tests."), pSuite->pName);
show_detail_window_message(szTemp);
}
else {
list_tests(pSuite);
snprintf(szTemp, STRING_LENGTH, "%s",
_("Enter number of test to select (1-%u) : "),
_("Enter number of test to select (1-%u) : "),
pRegistry->uiNumberOfSuites);
read_input_string(szTemp, szTestNumber, STRING_LENGTH);
test_num = atol(szTestNumber);
......@@ -762,7 +762,7 @@ static STATUS curses_suite_level_run(CU_pSuite pSuite)
else if (option == _("A")[0]) {
if (0 == pSuite->uiNumberOfTests) {
snprintf(szTemp, STRING_LENGTH,
snprintf(szTemp, STRING_LENGTH,
_("Suite %s contains no tests."), pSuite->pName);
show_detail_window_message(szTemp);
}
......@@ -770,7 +770,7 @@ static STATUS curses_suite_level_run(CU_pSuite pSuite)
while (1) {
list_tests(pSuite);
snprintf(szTemp, STRING_LENGTH, "%s",
_("Enter number of test to select (1-%u) : "),
_("Enter number of test to select (1-%u) : "),
pRegistry->uiNumberOfSuites);
read_input_string(szTemp, szTestNumber, STRING_LENGTH);
test_num = atol(szTestNumber);
......@@ -950,7 +950,7 @@ static void show_suite_level_help(CU_pSuite pSuite)
return;
}
snprintf(szTemp, STRING_LENGTH, _("Commands: R - run all tests in suite %s"),
snprintf(szTemp, STRING_LENGTH, _("Commands: R - run all tests in suite %s"),
pSuite->pName);
mvwprintw(details_pad.pPad, 0, 0, szTemp);
mvwprintw(details_pad.pPad, 1, 0, _(" S - Select and run a test"));
......@@ -1005,9 +1005,9 @@ static void list_suites(CU_pTestRegistry pRegistry)
width[5] = CU_MAX(strlen(_("Active?")), CU_MAX(f_yes_width, f_no_width)) + 1;
}
snprintf(szTemp, STRING_LENGTH, "%*s %-*s%*s%*s%*s%*s",
snprintf(szTemp, STRING_LENGTH, "%*s %-*s%*s%*s%*s%*s",
width[0], _("#"),
width[1], _("Suite Name"),
width[1], _("Suite Name"),
width[2], _("Init?"),
width[3], _("Cleanup?"),
width[4], _("#Tests"),
......@@ -1026,9 +1026,9 @@ static void list_suites(CU_pTestRegistry pRegistry)
mvwprintw(details_pad.pPad, i + 2, 0, "%s", szTemp);
}
mvwprintw(details_pad.pPad, i + 2, 0, "%s",
mvwprintw(details_pad.pPad, i + 2, 0, "%s",
"---------------------------------------------------------------------------");
mvwprintw(details_pad.pPad, i + 3, 0,
mvwprintw(details_pad.pPad, i + 3, 0,
_("Total Number of Suites : %-u"), pRegistry->uiNumberOfSuites);
refresh_details_window();
}
......@@ -1052,7 +1052,7 @@ static void list_tests(CU_pSuite pSuite)
}
if (0 == pSuite->uiNumberOfTests) {
snprintf(szTemp, STRING_LENGTH,
snprintf(szTemp, STRING_LENGTH,
_("Suite %s contains no tests."), pSuite->pName);
show_detail_window_message(szTemp);
return;
......@@ -1078,10 +1078,10 @@ static void list_tests(CU_pSuite pSuite)
mvwprintw(details_pad.pPad, 1, 0, szTemp);
for (i = 0, pCurTest = pSuite->pTest ;
NULL != pCurTest ;
NULL != pCurTest ;
pCurTest = pCurTest->pNext, i++) {
assert(NULL != pCurTest->pName);
snprintf(szTemp, STRING_LENGTH,
snprintf(szTemp, STRING_LENGTH,
"%*u. %-*.*s%*s",
width[0], i + 1,
width[1], width[1]-1, pCurTest->pName,
......@@ -1089,7 +1089,7 @@ static void list_tests(CU_pSuite pSuite)
mvwprintw(details_pad.pPad, i + 3, 0, "%s", szTemp);
}
mvwprintw(details_pad.pPad, i + 3, 0, "%s",
mvwprintw(details_pad.pPad, i + 3, 0, "%s",
"---------------------------------------------");
mvwprintw(details_pad.pPad, i + 4, 0,
_("Total Number of Tests : %-u"), pSuite->uiNumberOfTests);
......@@ -1138,7 +1138,7 @@ static void show_failures(void)
}
/*------------------------------------------------------------------------*/
/**
/**
* Sets CUnit options interactively using curses interface.
* Displays actions and responds based on user imput.
*/
......@@ -1222,7 +1222,7 @@ static CU_ErrorCode curses_run_suite_tests(CU_pSuite pSuite)
}
/*------------------------------------------------------------------------*/
/** Run a specific test for the specified suite within
/** Run a specific test for the specified suite within
* the curses interface.
* @param pSuite The suite containing the test to be run (non-NULL).
* @param pTest The test to be run (non-NULL).
......
......@@ -21,7 +21,7 @@
/*
* Error handling code used by CUnit
*
* 16-Jul-2004 Created access functions for error code, error action
* 16-Jul-2004 Created access functions for error code, error action
* functions, messages for new error codes. (JDS)
*
* 02-May-2006 Added internationalization hooks. (JDS)
......
......@@ -28,7 +28,7 @@
*
* 18-Jul-2004 New interface, doxygen comments, made local functions &
* constants static, fixed reporting of memory tracking (valid
* vs invalid cycles), restructured memory tracking to detect
* vs invalid cycles), restructured memory tracking to detect
* reallocations & multiple deletions. (JDS)
*
* 24-Apr-2005 Changed type of allocated sizes to size_t to avoid
......
This diff is collapsed.
This diff is collapsed.
......@@ -31,8 +31,8 @@
* 16-Jul-2004 New interface, doxygen comments. (JDS)
*
* 17-Apr-2006 Added CU_translated_strlen() and CU_number_width().
* Fixed off-by-1 error in CU_translate_special_characters(),
* modifying implementation & results in some cases. User can
* Fixed off-by-1 error in CU_translate_special_characters(),
* modifying implementation & results in some cases. User can
* now tell if conversion failed. (JDS)
*/
......@@ -55,10 +55,10 @@
/*------------------------------------------------------------------------*/
/**
/**
* Structure containing mappings of special characters to xml entity codes.
* special_char's in the CU_bindings array will be translated during calls
* to CU_translate_special_characters(). Add additional chars/replacements
* to CU_translate_special_characters(). Add additional chars/replacements
* or modify existing ones to change the behavior upon translation.
*/
static const struct bindings {
......@@ -71,7 +71,7 @@ static const struct bindings {
};
/*------------------------------------------------------------------------*/
/**
/**
* Checks whether a character is a special xml character.
* This function performs a lookup of the specified character in
* the CU_bindings structure. If it is a special character, its
......@@ -266,10 +266,10 @@ static void test_CU_translate_special_characters(void)
char *dest = dest_buf + MAX_LEN;
char ref_buf[BUF_LEN];
const int mask_char = 0x01; /* char written to buffer */
/* set up reference buffer for testing of translated strings */
memset(ref_buf, mask_char, BUF_LEN);
/* empty src */
memset(dest_buf, mask_char, BUF_LEN);
TEST(0 == CU_translate_special_characters("", dest, MAX_LEN));
......
......@@ -137,9 +137,9 @@ void test_cunit_report_results(void)
_(" seconds."));
}
CU_BOOL test_cunit_assert_impl(CU_BOOL value,
const char* condition,
const char* file,
CU_BOOL test_cunit_assert_impl(CU_BOOL value,
const char* condition,
const char* file,
unsigned int line)
{
test_cunit_add_test();
......