mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 14:31:31 +00:00
ICU-157 add test for sizeof(wchar_t)
X-SVN-Rev: 221
This commit is contained in:
parent
14e6e92642
commit
ca34bad82b
4 changed files with 125 additions and 18 deletions
|
@ -42,7 +42,7 @@ RSC=rc.exe
|
|||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /GX /I "..\..\..\include" /I "..\..\..\source\common" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /Z7 /I "..\..\..\include" /I "..\..\..\source\common" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
|
@ -50,7 +50,7 @@ BSC32=bscmake.exe
|
|||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 ..\..\..\lib\release\icuuc.lib ..\..\..\lib\release\icui18n.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 ..\..\..\lib\release\icuuc.lib ..\..\..\lib\release\icui18n.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
|
||||
!ELSEIF "$(CFG)" == "intltest - Win32 Debug"
|
||||
|
||||
|
@ -259,6 +259,10 @@ SOURCE=.\sdtfmtts.cpp
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\strtest.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\tchcfmt.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
@ -515,6 +519,10 @@ SOURCE=.\sdtfmtts.h
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\strtest.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\tchcfmt.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
#include "utypes.h"
|
||||
#include "itutil.h"
|
||||
#include "strtest.h"
|
||||
#include "loctest.h"
|
||||
#include "citrtest.h"
|
||||
#include "ustrtest.h"
|
||||
|
@ -36,24 +37,15 @@ void IntlTestUtilities::runIndexedTest( int32_t index, bool_t exec, char* &name,
|
|||
if (exec) logln("TestSuite Utilities: ");
|
||||
switch (index) {
|
||||
case 0:
|
||||
name = "LocaleTest";
|
||||
name = "StringTest";
|
||||
if (exec) {
|
||||
logln("LocaleTest---"); logln("");
|
||||
LocaleTest test;
|
||||
logln("StringTest---"); logln("");
|
||||
StringTest test;
|
||||
callTest( test, par );
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
name = "CharIterTest";
|
||||
if (exec) {
|
||||
logln("CharIterTest---"); logln("");
|
||||
CharIterTest test;
|
||||
callTest( test, par );
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
name = "UnicodeStringTest";
|
||||
if (exec) {
|
||||
logln("UnicodeStringTest---"); logln("");
|
||||
|
@ -62,7 +54,25 @@ void IntlTestUtilities::runIndexedTest( int32_t index, bool_t exec, char* &name,
|
|||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
name = "LocaleTest";
|
||||
if (exec) {
|
||||
logln("LocaleTest---"); logln("");
|
||||
LocaleTest test;
|
||||
callTest( test, par );
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
name = "CharIterTest";
|
||||
if (exec) {
|
||||
logln("CharIterTest---"); logln("");
|
||||
CharIterTest test;
|
||||
callTest( test, par );
|
||||
}
|
||||
break;
|
||||
|
||||
case 4:
|
||||
name = "UnicodeTest";
|
||||
if (exec) {
|
||||
logln("UnicodeTest---"); logln("");
|
||||
|
@ -71,7 +81,7 @@ void IntlTestUtilities::runIndexedTest( int32_t index, bool_t exec, char* &name,
|
|||
}
|
||||
break;
|
||||
|
||||
case 4:
|
||||
case 5:
|
||||
name = "ResourceBundleTest";
|
||||
if (exec) {
|
||||
logln("ResourceBundleTest---"); logln("");
|
||||
|
@ -80,7 +90,7 @@ void IntlTestUtilities::runIndexedTest( int32_t index, bool_t exec, char* &name,
|
|||
}
|
||||
break;
|
||||
|
||||
case 5:
|
||||
case 6:
|
||||
name = "MutexTest";
|
||||
if (exec) {
|
||||
logln("MutexTest---"); logln("");
|
||||
|
@ -89,7 +99,7 @@ void IntlTestUtilities::runIndexedTest( int32_t index, bool_t exec, char* &name,
|
|||
}
|
||||
break;
|
||||
|
||||
case 6:
|
||||
case 7:
|
||||
name = "MultithreadTest";
|
||||
if (exec) {
|
||||
logln("MultithreadTest---"); logln("");
|
||||
|
@ -98,7 +108,7 @@ void IntlTestUtilities::runIndexedTest( int32_t index, bool_t exec, char* &name,
|
|||
}
|
||||
break;
|
||||
|
||||
case 7:
|
||||
case 8:
|
||||
name = "PUtilTest";
|
||||
if (exec) {
|
||||
logln("PUtilTest---"); logln("");
|
||||
|
|
47
icu4c/source/test/intltest/strtest.cpp
Normal file
47
icu4c/source/test/intltest/strtest.cpp
Normal file
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* *
|
||||
* COPYRIGHT: *
|
||||
* (C) Copyright International Business Machines Corporation, 1999 *
|
||||
* Licensed Material - Program-Property of IBM - All Rights Reserved. *
|
||||
* US Government Users Restricted Rights - Use, duplication, or disclosure *
|
||||
* restricted by GSA ADP Schedule Contract with IBM Corp. *
|
||||
* *
|
||||
*******************************************************************************
|
||||
* file name: strtest.cpp
|
||||
* encoding: US-ASCII
|
||||
* tab size: 8 (not used)
|
||||
* indentation:4
|
||||
*
|
||||
* created on: 1999nov22
|
||||
* created by: Markus W. Scherer
|
||||
*/
|
||||
|
||||
#include <wchar.h>
|
||||
#include "utypes.h"
|
||||
#include "putil.h"
|
||||
#include "intltest.h"
|
||||
#include "strtest.h"
|
||||
|
||||
void StringTest::TestSizeofWCharT() {
|
||||
if(U_SIZEOF_WCHAR_T!=sizeof(wchar_t)) {
|
||||
errln("TestSizeofWCharT: U_SIZEOF_WCHAR_T!=sizeof(wchar_t) - U_SIZEOF_WCHAR_T needs to be fixed in platform.h");
|
||||
}
|
||||
}
|
||||
|
||||
void StringTest::runIndexedTest(int32_t index, bool_t exec, char *&name, char *par) {
|
||||
if(exec) {
|
||||
logln("TestSuite Character and String Test: ");
|
||||
}
|
||||
switch(index) {
|
||||
case 0:
|
||||
name="TestSizeofWCharT";
|
||||
if(exec) {
|
||||
TestSizeofWCharT();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
name="";
|
||||
break;
|
||||
}
|
||||
}
|
42
icu4c/source/test/intltest/strtest.h
Normal file
42
icu4c/source/test/intltest/strtest.h
Normal file
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* *
|
||||
* COPYRIGHT: *
|
||||
* (C) Copyright International Business Machines Corporation, 1999 *
|
||||
* Licensed Material - Program-Property of IBM - All Rights Reserved. *
|
||||
* US Government Users Restricted Rights - Use, duplication, or disclosure *
|
||||
* restricted by GSA ADP Schedule Contract with IBM Corp. *
|
||||
* *
|
||||
*******************************************************************************
|
||||
* file name: strtest.h
|
||||
* encoding: US-ASCII
|
||||
* tab size: 8 (not used)
|
||||
* indentation:4
|
||||
*
|
||||
* created on: 1999nov22
|
||||
* created by: Markus W. Scherer
|
||||
*/
|
||||
|
||||
/*
|
||||
* Test character- and string- related settings in utypes.h,
|
||||
* macros in putil.h, and constructors in unistr.h .
|
||||
*/
|
||||
|
||||
#ifndef __STRTEST_H__
|
||||
#define __STRTEST_H__
|
||||
|
||||
#include "utypes.h"
|
||||
#include "intltest.h"
|
||||
|
||||
class StringTest : public IntlTest {
|
||||
public:
|
||||
StringTest() {}
|
||||
~StringTest() {}
|
||||
|
||||
void runIndexedTest(int32_t index, bool_t exec, char *&name, char *par=NULL);
|
||||
|
||||
private:
|
||||
void TestSizeofWCharT();
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Add table
Reference in a new issue