LazUtils: Use a new exception type EMaskError for TMask. Helps testing a new implementation.

git-svn-id: trunk@64665 -
This commit is contained in:
juha 2021-02-25 10:13:11 +00:00
parent 99b12d5c6b
commit 4113f5b16f
3 changed files with 6 additions and 10 deletions

View File

@ -25,6 +25,8 @@ type
TUtf8Char = String[7];
EMaskError=class(EConvertError);
TMaskChar = record
case CharType: TMaskCharType of
mcChar: (CharValue: TUtf8Char);
@ -229,7 +231,7 @@ var
procedure CharSetError;
begin
raise EConvertError.CreateFmt(lrsInvalidCharSet, [AValue]);
raise EMaskError.CreateFmt(lrsInvalidCharSet, [AValue]);
end;
procedure AddAnyText;

View File

@ -62,13 +62,7 @@
<Debugging>
<Exceptions>
<Item>
<Name Value="ECodetoolError"/>
</Item>
<Item>
<Name Value="EFOpenError"/>
</Item>
<Item>
<Name Value="EConvertError"/>
<Name Value="EMaskError"/>
</Item>
</Exceptions>
</Debugging>

View File

@ -58,8 +58,8 @@ procedure TTestMask.TestMaskException(const S, Mask: String; AFail: Boolean);
begin
FS := S;
FMask := Mask;
if AFail then // Exception type will be EMaskError
AssertException('Invalid syntax: ' + S + ' match ' + Mask + ': ', EConvertError, @Test)
if AFail then
AssertException('Invalid syntax: ' + S + ' match ' + Mask + ': ', EMaskError, @Test)
else
try
Test;