mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 06:25:30 +00:00
ICU-1872 A better test for the global mutex
X-SVN-Rev: 8515
This commit is contained in:
parent
08db07139b
commit
35bdabdc68
2 changed files with 25 additions and 12 deletions
|
@ -16,6 +16,7 @@
|
|||
|
||||
#include "cintltst.h"
|
||||
|
||||
void addSetup(TestNode** root);
|
||||
void addUtility(TestNode** root);
|
||||
void addBreakIter(TestNode** root);
|
||||
void addStandardNamesTest(TestNode **root);
|
||||
|
@ -34,20 +35,21 @@ void addUCharTransformTest(TestNode** root);
|
|||
|
||||
void addAllTests(TestNode** root)
|
||||
{
|
||||
addStandardNamesTest(root);
|
||||
addSetup(root); /* Leave this test first! */
|
||||
addUDataTest(root);
|
||||
addPUtilTest(root);
|
||||
addUTF16Test(root);
|
||||
addUTF8Test(root);
|
||||
addUtility(root);
|
||||
addBreakIter(root);
|
||||
addFormatTest(root);
|
||||
addConvert(root);
|
||||
addUCharTransformTest(root);
|
||||
addCompactArrayTest(root);
|
||||
addFormatTest(root);
|
||||
addStandardNamesTest(root);
|
||||
addBreakIter(root);
|
||||
addCollTest(root);
|
||||
addComplexTest(root);
|
||||
addUDataTest(root);
|
||||
addUTransTest(root);
|
||||
addPUtilTest(root);
|
||||
addCompactArrayTest(root);
|
||||
addTestDeprecatedAPI(root);
|
||||
addUCharTransformTest(root);
|
||||
}
|
||||
|
||||
|
|
|
@ -47,6 +47,20 @@ static char* _testDataPath=NULL;
|
|||
*/
|
||||
void ctest_setICU_DATA(void);
|
||||
|
||||
static UBool gMutexInitialized = TRUE;
|
||||
|
||||
static TestMutex(void) {
|
||||
if (gMutexInitialized) {
|
||||
log_err("*** Failure! The global mutex was not initialized.\n"
|
||||
"*** Make sure the right linker was used.\n");
|
||||
}
|
||||
}
|
||||
|
||||
void addSetup(TestNode** root)
|
||||
{
|
||||
addTest(root, &TestMutex, "setup/TestMutex");
|
||||
}
|
||||
|
||||
int main(int argc, const char* const argv[])
|
||||
{
|
||||
int nerrors = 0;
|
||||
|
@ -58,11 +72,8 @@ int main(int argc, const char* const argv[])
|
|||
UConverter *cnv;
|
||||
|
||||
/* This must be tested before using anything! */
|
||||
if (!umtx_isInitialized(NULL)) {
|
||||
fprintf(stderr,
|
||||
"*** Failure! The global mutex was not initialized.\n"
|
||||
"*** Make sure the right linker was used.\n");
|
||||
return 1;
|
||||
if (umtx_isInitialized(NULL)) {
|
||||
gMutexInitialized = FALSE;
|
||||
}
|
||||
|
||||
while (REPEAT_TESTS > 0) {
|
||||
|
|
Loading…
Add table
Reference in a new issue