ICU-4552 Test fix for new and delete for MFC on Windows.

X-SVN-Rev: 18168
This commit is contained in:
George Rhoten 2005-07-07 22:27:00 +00:00
parent ad53822131
commit c1a584bb0b
2 changed files with 15 additions and 1 deletions

View File

@ -421,6 +421,18 @@ void UObjectTest::testUMemory() {
m=n;
}
void UObjectTest::TestMFCCompatibility() {
#if U_HAVE_DEBUG_LOCATION_NEW
/* Make sure that it compiles with MFC's debuggable new usage. */
UnicodeString *str = new(__FILE__, __LINE__) UnicodeString();
str->append((UChar)0x0040); // Is it usable?
if(str->charAt(0) != 0x0040) {
errln("debug new doesn't work.");
}
delete str;
#endif
}
/* --------------- */
#define CASE(id,test) case id: name = #test; if (exec) { logln(#test "---"); logln((UnicodeString)""); test(); } break;
@ -432,6 +444,7 @@ void UObjectTest::runIndexedTest( int32_t index, UBool exec, const char* &name,
CASE(0, testIDs);
CASE(1, testUMemory);
CASE(2, TestMFCCompatibility);
default: name = ""; break; //needed to end loop
}

View File

@ -1,6 +1,6 @@
/********************************************************************
* COPYRIGHT:
* Copyright (c) 2002-2004, International Business Machines Corporation and
* Copyright (c) 2002-2005, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
@ -20,6 +20,7 @@ private:
// tests
void testIDs();
void testUMemory();
void TestMFCCompatibility();
//helper