mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-13 17:01:16 +00:00
ICU-3946 Fix some tests to use U_EXPORT2 more often
X-SVN-Rev: 16019
This commit is contained in:
parent
e8f3a97f77
commit
b7ae145f93
3 changed files with 68 additions and 33 deletions
|
@ -137,7 +137,9 @@ static TestNode *createTestNode( )
|
|||
return newNode;
|
||||
}
|
||||
|
||||
void cleanUpTestTree(TestNode *tn) {
|
||||
void T_CTEST_EXPORT2
|
||||
cleanUpTestTree(TestNode *tn)
|
||||
{
|
||||
if(tn->child != NULL) {
|
||||
cleanUpTestTree(tn->child);
|
||||
}
|
||||
|
@ -149,9 +151,10 @@ void cleanUpTestTree(TestNode *tn) {
|
|||
}
|
||||
|
||||
|
||||
void addTest ( TestNode** root,
|
||||
TestFunctionPtr test,
|
||||
const char* name )
|
||||
void T_CTEST_EXPORT2
|
||||
addTest(TestNode** root,
|
||||
TestFunctionPtr test,
|
||||
const char* name )
|
||||
{
|
||||
TestNode *newNode;
|
||||
|
||||
|
@ -300,7 +303,8 @@ static void iterateTestsWithLevel ( const TestNode* root,
|
|||
|
||||
|
||||
|
||||
void showTests ( const TestNode *root )
|
||||
void T_CTEST_EXPORT2
|
||||
showTests ( const TestNode *root )
|
||||
{
|
||||
/* make up one for them */
|
||||
const TestNode *aList[MAXTESTS];
|
||||
|
@ -312,7 +316,8 @@ void showTests ( const TestNode *root )
|
|||
|
||||
}
|
||||
|
||||
void runTests ( const TestNode *root )
|
||||
void T_CTEST_EXPORT2
|
||||
runTests ( const TestNode *root )
|
||||
{
|
||||
int i;
|
||||
const TestNode *aList[MAXTESTS];
|
||||
|
@ -349,7 +354,8 @@ void runTests ( const TestNode *root )
|
|||
}
|
||||
}
|
||||
|
||||
const char* getTestName(void)
|
||||
const char* T_CTEST_EXPORT2
|
||||
getTestName(void)
|
||||
{
|
||||
if(currentTest != NULL) {
|
||||
return currentTest->name;
|
||||
|
@ -358,7 +364,8 @@ const char* getTestName(void)
|
|||
}
|
||||
}
|
||||
|
||||
const TestNode* getTest(const TestNode* root, const char* name)
|
||||
const TestNode* T_CTEST_EXPORT2
|
||||
getTest(const TestNode* root, const char* name)
|
||||
{
|
||||
const char* nextName;
|
||||
TestNode *nextNode;
|
||||
|
@ -429,7 +436,8 @@ static void vlog_err(const char *prefix, const char *pattern, va_list ap)
|
|||
va_end(ap);
|
||||
}
|
||||
|
||||
void vlog_info(const char *prefix, const char *pattern, va_list ap)
|
||||
void T_CTEST_EXPORT2
|
||||
vlog_info(const char *prefix, const char *pattern, va_list ap)
|
||||
{
|
||||
fprintf(stdout, "%-*s", INDENT_LEVEL," " );
|
||||
if(prefix) {
|
||||
|
@ -454,7 +462,8 @@ static void vlog_verbose(const char *prefix, const char *pattern, va_list ap)
|
|||
va_end(ap);
|
||||
}
|
||||
|
||||
void log_err(const char* pattern, ...)
|
||||
void T_CTEST_EXPORT2
|
||||
log_err(const char* pattern, ...)
|
||||
{
|
||||
va_list ap;
|
||||
if(strchr(pattern, '\n') != NULL) {
|
||||
|
@ -468,7 +477,8 @@ void log_err(const char* pattern, ...)
|
|||
vlog_err(NULL, pattern, ap);
|
||||
}
|
||||
|
||||
void log_info(const char* pattern, ...)
|
||||
void T_CTEST_EXPORT2
|
||||
log_info(const char* pattern, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
|
@ -476,7 +486,8 @@ void log_info(const char* pattern, ...)
|
|||
vlog_info(NULL, pattern, ap);
|
||||
}
|
||||
|
||||
void log_verbose(const char* pattern, ...)
|
||||
void T_CTEST_EXPORT2
|
||||
log_verbose(const char* pattern, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
|
@ -485,7 +496,8 @@ void log_verbose(const char* pattern, ...)
|
|||
}
|
||||
|
||||
|
||||
void log_data_err(const char* pattern, ...)
|
||||
void T_CTEST_EXPORT2
|
||||
log_data_err(const char* pattern, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, pattern);
|
||||
|
@ -504,7 +516,8 @@ void log_data_err(const char* pattern, ...)
|
|||
}
|
||||
|
||||
|
||||
int processArgs(const TestNode* root,
|
||||
int T_CTEST_EXPORT2
|
||||
processArgs(const TestNode* root,
|
||||
int argc,
|
||||
const char* const argv[])
|
||||
{
|
||||
|
|
|
@ -76,7 +76,8 @@ extern T_CTEST_EXPORT_API UTraceLevel ICU_TRACE;
|
|||
* @param root Subtree of tests.
|
||||
* @internal Internal APIs for testing purpose only
|
||||
*/
|
||||
T_CTEST_API void showTests ( const TestNode *root);
|
||||
T_CTEST_API void T_CTEST_EXPORT2
|
||||
showTests ( const TestNode *root);
|
||||
|
||||
/**
|
||||
* Run a subtree of tests.
|
||||
|
@ -84,7 +85,8 @@ T_CTEST_API void showTests ( const TestNode *root);
|
|||
* @param root Subtree of tests.
|
||||
* @internal Internal APIs for testing purpose only
|
||||
*/
|
||||
T_CTEST_API void runTests ( const TestNode* root);
|
||||
T_CTEST_API void T_CTEST_EXPORT2
|
||||
runTests ( const TestNode* root);
|
||||
|
||||
/**
|
||||
* Add a test to the subtree.
|
||||
|
@ -98,11 +100,19 @@ T_CTEST_API void runTests ( const TestNode* root);
|
|||
* @param path Path from root under which test will be placed. Ex. '/a/b/mytest'
|
||||
* @internal Internal APIs for testing purpose only
|
||||
*/
|
||||
T_CTEST_API void addTest ( TestNode** root,
|
||||
TestFunctionPtr test,
|
||||
const char *path);
|
||||
T_CTEST_API void T_CTEST_EXPORT2
|
||||
addTest(TestNode** root,
|
||||
TestFunctionPtr test,
|
||||
const char *path);
|
||||
|
||||
T_CTEST_API void cleanUpTestTree(TestNode *tn);
|
||||
/**
|
||||
* Clean up any allocated memory.
|
||||
* Conditions for calling this function are the same as u_cleanup().
|
||||
* @see u_cleanup
|
||||
* @internal Internal APIs for testing purpose only
|
||||
*/
|
||||
T_CTEST_API void T_CTEST_EXPORT2
|
||||
cleanUpTestTree(TestNode *tn);
|
||||
|
||||
/**
|
||||
* Retreive a specific subtest. (subtree).
|
||||
|
@ -112,8 +122,9 @@ T_CTEST_API void cleanUpTestTree(TestNode *tn);
|
|||
* @return The subtest, or NULL on failure.
|
||||
* @internal Internal APIs for testing purpose only
|
||||
*/
|
||||
T_CTEST_API const TestNode* getTest (const TestNode* root,
|
||||
const char *path);
|
||||
T_CTEST_API const TestNode* T_CTEST_EXPORT2
|
||||
getTest(const TestNode* root,
|
||||
const char *path);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -121,14 +132,16 @@ T_CTEST_API const TestNode* getTest (const TestNode* root,
|
|||
* @param pattern printf-style format string
|
||||
* @internal Internal APIs for testing purpose only
|
||||
*/
|
||||
T_CTEST_API void log_err(const char* pattern, ...);
|
||||
T_CTEST_API void T_CTEST_EXPORT2
|
||||
log_err(const char* pattern, ...);
|
||||
|
||||
/**
|
||||
* Log an informational message. (printf style)
|
||||
* @param pattern printf-style format string
|
||||
* @internal Internal APIs for testing purpose only
|
||||
*/
|
||||
T_CTEST_API void log_info(const char* pattern, ...);
|
||||
T_CTEST_API void T_CTEST_EXPORT2
|
||||
log_info(const char* pattern, ...);
|
||||
|
||||
/**
|
||||
* Log an informational message. (vprintf style)
|
||||
|
@ -137,7 +150,8 @@ T_CTEST_API void log_info(const char* pattern, ...);
|
|||
* @param ap variable-arguments list
|
||||
* @internal Internal APIs for testing purpose only
|
||||
*/
|
||||
T_CTEST_API void vlog_info(const char *prefix, const char *pattern, va_list ap);
|
||||
T_CTEST_API void T_CTEST_EXPORT2
|
||||
vlog_info(const char *prefix, const char *pattern, va_list ap);
|
||||
|
||||
/**
|
||||
* Log a verbose informational message. (printf style)
|
||||
|
@ -145,7 +159,8 @@ T_CTEST_API void vlog_info(const char *prefix, const char *pattern, va_list ap);
|
|||
* @param pattern printf-style format string
|
||||
* @internal Internal APIs for testing purpose only
|
||||
*/
|
||||
T_CTEST_API void log_verbose(const char* pattern, ...);
|
||||
T_CTEST_API void T_CTEST_EXPORT2
|
||||
log_verbose(const char* pattern, ...);
|
||||
|
||||
/**
|
||||
* Log an error message concerning missing data. (printf style)
|
||||
|
@ -154,7 +169,8 @@ T_CTEST_API void log_verbose(const char* pattern, ...);
|
|||
* @param pattern printf-style format string
|
||||
* @internal Internal APIs for testing purpose only
|
||||
*/
|
||||
T_CTEST_API void log_data_err(const char *pattern, ...);
|
||||
T_CTEST_API void T_CTEST_EXPORT2
|
||||
log_data_err(const char *pattern, ...);
|
||||
|
||||
/**
|
||||
* Processes the command line arguments.
|
||||
|
@ -169,14 +185,14 @@ T_CTEST_API void log_data_err(const char *pattern, ...);
|
|||
* @return positive for error count, 0 for success, negative for illegal argument
|
||||
* @internal Internal APIs for testing purpose only
|
||||
*/
|
||||
|
||||
T_CTEST_API int processArgs(const TestNode* root,
|
||||
int argc,
|
||||
const char* const argv[]);
|
||||
T_CTEST_API int T_CTEST_EXPORT2
|
||||
processArgs(const TestNode* root,
|
||||
int argc,
|
||||
const char* const argv[]);
|
||||
|
||||
|
||||
T_CTEST_API
|
||||
const char* getTestName(void);
|
||||
T_CTEST_API const char* T_CTEST_EXPORT2
|
||||
getTestName(void);
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -18,6 +18,12 @@
|
|||
#define T_CTEST_IMPORT
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
#define T_CTEST_EXPORT2 __cdecl
|
||||
#else
|
||||
#define T_CTEST_EXPORT2
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define C_CTEST_API extern "C"
|
||||
#else
|
||||
|
|
Loading…
Add table
Reference in a new issue