48 #ifndef CUNIT_UTIL_H_SEEN
49 #define CUNIT_UTIL_H_SEEN
52 #include "CUnit/CUnit.h"
58 #define CUNIT_MAX_ENTITY_LEN 5
121 CU_EXPORT
void CU_trim(
char *szString);
139 #define CU_MAIN_EXE_NAME CU_get_basename(argv[0])
142 #define CUNIT_FILE_PATH_MAX 4096
144 #ifdef CUNIT_BUILD_TESTS
145 void test_cunit_Util(
void);
152 #ifdef USE_DEPRECATED_CUNIT_NAMES
153 #define CUNIT_MAX_STRING_LENGTH 1024
155 #define translate_special_characters(src, dest, len) CU_translate_special_characters(src, dest, len)
157 #define compare_strings(src, dest) CU_compare_strings(src, dest)
160 #define trim_left(str) CU_trim_left(str)
162 #define trim_right(str) CU_trim_right(str)
164 #define trim(str) CU_trim(str)
CU_EXPORT void CU_trim_right(char *szString)
Trims trailing whitespace from the specified string.
Definition: Util.c:228
CU_EXPORT const char * CU_get_basename(const char *path)
Given a file path, return a pointer to the last component (the basename).
Definition: Util.c:259
CU_EXPORT size_t CU_number_width(int number)
Calulates the number of places required to display number in decimal.
Definition: Util.c:246
CU_EXPORT void CU_trim(char *szString)
Trims leading and trailing whitespace from the specified string.
Definition: Util.c:200
CU_EXPORT void CU_trim_left(char *szString)
Trims leading whitespace from the specified string.
Definition: Util.c:207
CU_EXPORT int CU_compare_strings(const char *szSrc, const char *szDest)
Case-insensitive string comparison.
Definition: Util.c:186
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 result in szDest.
Definition: Util.c:96
CU_EXPORT size_t CU_translated_strlen(const char *szSrc)
Calculates the length of a translated string.
Definition: Util.c:167