|
@@ -17,6 +17,10 @@ uses
|
|
|
{$ifndef FPC}
|
|
|
type UnicodeChar = WideChar;
|
|
|
{$endif}
|
|
|
+
|
|
|
+const
|
|
|
+ { test only a spare grid, else the test runs too long (testing all combinations means dist=1) }
|
|
|
+ dist = 8;
|
|
|
|
|
|
procedure DoError(ACode : Integer; ACodePoint1, ACodePoint2 : Integer); overload;
|
|
|
begin
|
|
@@ -44,14 +48,14 @@ begin
|
|
|
end;
|
|
|
|
|
|
Inc(e);
|
|
|
- for i := Low(Word) to High(Word) do begin
|
|
|
- if (i < HIGH_SURROGATE_BEGIN) or (i > HIGH_SURROGATE_END) then begin
|
|
|
- for j := Low(Word) to High(Word) do begin
|
|
|
- if (j < LOW_SURROGATE_BEGIN) or (j > LOW_SURROGATE_END) then begin
|
|
|
- s[5] := UnicodeChar(i);
|
|
|
- s[6] := UnicodeChar(j);
|
|
|
+ for i := Low(Word) to High(Word) div dist do begin
|
|
|
+ if (i*dist < HIGH_SURROGATE_BEGIN) or (i*dist > HIGH_SURROGATE_END) then begin
|
|
|
+ for j := Low(Word) to High(Word) div dist do begin
|
|
|
+ if (j*dist < LOW_SURROGATE_BEGIN) or (j*dist > LOW_SURROGATE_END) then begin
|
|
|
+ s[5] := UnicodeChar(i*dist);
|
|
|
+ s[6] := UnicodeChar(j*dist);
|
|
|
if TCharacter.IsSurrogatePair(s,5) then
|
|
|
- DoError(e,i,j);
|
|
|
+ DoError(e,i*dist,j*dist);
|
|
|
end;
|
|
|
end;
|
|
|
end;
|