mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-05 01:59:30 +01:00
tests: added test for UTF8CharacterToUnicode
git-svn-id: trunk@18736 -
This commit is contained in:
parent
52fd879da6
commit
8b19dba49b
@ -17,6 +17,7 @@ type
|
|||||||
procedure TestUTF16ToUTF8;
|
procedure TestUTF16ToUTF8;
|
||||||
procedure TestUTF16ToUnicode;
|
procedure TestUTF16ToUnicode;
|
||||||
procedure TestUnicodeToUTF16;
|
procedure TestUnicodeToUTF16;
|
||||||
|
procedure TestUTF8CharacterToUnicode;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
const
|
const
|
||||||
@ -125,6 +126,20 @@ begin
|
|||||||
AssertEquals(#$DBFF#$DFFD, UnicodeToUTF16($10FFFD));
|
AssertEquals(#$DBFF#$DFFD, UnicodeToUTF16($10FFFD));
|
||||||
end;
|
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
|
initialization
|
||||||
|
|
||||||
AddToLCLTestSuite(TTestUnicode);
|
AddToLCLTestSuite(TTestUnicode);
|
||||||
|
|||||||
@ -2,10 +2,11 @@
|
|||||||
<CONFIG>
|
<CONFIG>
|
||||||
<ProjectOptions>
|
<ProjectOptions>
|
||||||
<PathDelim Value="\"/>
|
<PathDelim Value="\"/>
|
||||||
<Version Value="6"/>
|
<Version Value="7"/>
|
||||||
<General>
|
<General>
|
||||||
<Flags>
|
<Flags>
|
||||||
<AlwaysBuild Value="False"/>
|
<AlwaysBuild Value="False"/>
|
||||||
|
<LRSInOutputDirectory Value="False"/>
|
||||||
</Flags>
|
</Flags>
|
||||||
<SessionStorage Value="InIDEConfig"/>
|
<SessionStorage Value="InIDEConfig"/>
|
||||||
<MainUnit Value="0"/>
|
<MainUnit Value="0"/>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user