tests: added test for UTF8CharacterToUnicode

git-svn-id: trunk@18736 -
This commit is contained in:
vincents 2009-02-18 00:22:47 +00:00
parent 52fd879da6
commit 8b19dba49b
2 changed files with 17 additions and 1 deletions

View File

@ -17,6 +17,7 @@ type
procedure TestUTF16ToUTF8;
procedure TestUTF16ToUnicode;
procedure TestUnicodeToUTF16;
procedure TestUTF8CharacterToUnicode;
end;
const
@ -125,6 +126,20 @@ begin
AssertEquals(#$DBFF#$DFFD, UnicodeToUTF16($10FFFD));
end;
procedure TTestUnicode.TestUTF8CharacterToUnicode;
var
i,u: cardinal;
s: String;
dum: integer;
begin
for i:=0 to $10FFFF do
begin
s:=UnicodeToUTF8(i);
u:=UTF8CharacterToUnicode(PChar(s), dum);
AssertEquals('got (hexidecimal): ' + InttoHex(u,6), i, u);
end;
end;
initialization
AddToLCLTestSuite(TTestUnicode);

View File

@ -2,10 +2,11 @@
<CONFIG>
<ProjectOptions>
<PathDelim Value="\"/>
<Version Value="6"/>
<Version Value="7"/>
<General>
<Flags>
<AlwaysBuild Value="False"/>
<LRSInOutputDirectory Value="False"/>
</Flags>
<SessionStorage Value="InIDEConfig"/>
<MainUnit Value="0"/>