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]; TUtf8Char = String[7];
EMaskError=class(EConvertError);
TMaskChar = record TMaskChar = record
case CharType: TMaskCharType of case CharType: TMaskCharType of
mcChar: (CharValue: TUtf8Char); mcChar: (CharValue: TUtf8Char);
@ -229,7 +231,7 @@ var
procedure CharSetError; procedure CharSetError;
begin begin
raise EConvertError.CreateFmt(lrsInvalidCharSet, [AValue]); raise EMaskError.CreateFmt(lrsInvalidCharSet, [AValue]);
end; end;
procedure AddAnyText; procedure AddAnyText;

View File

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

View File

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