Skip to content

Commit

Permalink
include UpperCopy255Buf() explicit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud Bouchez committed Apr 26, 2022
1 parent 87fb5bd commit 5973720
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/mormot.commit.inc
@@ -1 +1 @@
'2.0.3272'
'2.0.3273'
12 changes: 11 additions & 1 deletion test/test.core.base.pas
Expand Up @@ -4294,8 +4294,9 @@ procedure TTestCoreBase._UTF8;
($61, $41, $62, $42, $e0, $c0, $fd, $dd, $14b, $14a, $371, $370,
$3F3, $37F, $451, $401, $435, $415, $442, $422, $4e1, $4e0, $2d00, $10a0);
var
i: PtrInt;
i, j: PtrInt;
up, lo, up2: array[0..10] of AnsiChar;
src, dst: array[byte] of AnsiChar;
begin
CheckEqual('A', UpperCaseReference('a'));
CheckEqual('ABC', UpperCaseReference('aBc'));
Expand All @@ -4315,6 +4316,15 @@ procedure TTestCoreBase._UTF8;
CheckEqual(Utf8ILCompReference(@lo, @up, StrLen(@lo), StrLen(@up)), 0,
'CaseFoldingLComp');
end;
FillCharFast(src, SizeOf(src), ord('a'));
for i := 0 to 200 do
begin
FillCharFast(dst, SizeOf(dst), 0);
UpperCopy255Buf(@dst, @src, i)^ := #0;
Check(StrLen(@dst) = i);
for j := 0 to i - 1 do
Check(dst[j] = 'A');
end;
end;

procedure Test(CP: cardinal; const W: WinAnsiString);
Expand Down

0 comments on commit 5973720

Please sign in to comment.