ICU-1872 A better test for the global mutex

X-SVN-Rev: 8515
This commit is contained in:
George Rhoten 2002-04-25 21:49:16 +00:00
parent 08db07139b
commit 35bdabdc68
2 changed files with 25 additions and 12 deletions

View file

@ -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);
}

View file

@ -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) {