mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 02:39:37 +02:00
FpDebug: tests
git-svn-id: trunk@63886 -
This commit is contained in:
parent
47bbc252d8
commit
b3cbbc6218
@ -1131,6 +1131,17 @@ begin
|
|||||||
//t.CheckResults;
|
//t.CheckResults;
|
||||||
//exit;
|
//exit;
|
||||||
|
|
||||||
|
t.Add('U8Data1', weAnsiStr(''''#$E2#$89#$A7'''', 'Utf8String'))
|
||||||
|
//t.Add('U8Data1', weAnsiStr(''''#$2267'''', 'Utf8String'))
|
||||||
|
.NoCharQuoting
|
||||||
|
.IgnTypeName.IgnKind
|
||||||
|
.skipIf(Compiler.Version < 030000);
|
||||||
|
t.Add('U8Data2', weAnsiStr(''''#$E2#$89#$A7'X''', 'Utf8String'))
|
||||||
|
//t.Add('U8Data2', weAnsiStr(''''#$2267'X''', 'Utf8String'))
|
||||||
|
.NoCharQuoting
|
||||||
|
.IgnTypeName.IgnKind
|
||||||
|
.skipIf(Compiler.Version < 030000);
|
||||||
|
|
||||||
t.Add('SomeFunc1', weMatch('^function *\(SOMEVALUE, Foo: LONGINT; Bar: Word; x: Byte\): *BOOLEAN *AT *\$[0-9A-F]+', skFunction) );
|
t.Add('SomeFunc1', weMatch('^function *\(SOMEVALUE, Foo: LONGINT; Bar: Word; x: Byte\): *BOOLEAN *AT *\$[0-9A-F]+', skFunction) );
|
||||||
t.Add('SomeProc1', weMatch('^procedure *\(\) *AT *\$[0-9A-F]+', skProcedure) );
|
t.Add('SomeProc1', weMatch('^procedure *\(\) *AT *\$[0-9A-F]+', skProcedure) );
|
||||||
t.Add('@SomeFunc1', weMatch('^\^function.*\(\$[0-9A-F]+\)'{' = SomeFunc1'}, skPointer {skFunctionRef}) );
|
t.Add('@SomeFunc1', weMatch('^\^function.*\(\$[0-9A-F]+\)'{' = SomeFunc1'}, skPointer {skFunctionRef}) );
|
||||||
|
@ -320,6 +320,8 @@ var
|
|||||||
MyStringItemList: TMyStringItemListShort;
|
MyStringItemList: TMyStringItemListShort;
|
||||||
MyStringList: TMyStringList;
|
MyStringList: TMyStringList;
|
||||||
|
|
||||||
|
U8Data1, U8Data2: Utf8String;
|
||||||
|
|
||||||
{$if FPC_FULLVERSION >= 30000}
|
{$if FPC_FULLVERSION >= 30000}
|
||||||
dummy1: PFuncSelfRef;
|
dummy1: PFuncSelfRef;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -466,6 +468,8 @@ begin // TEST_BREAKPOINT=FooConstRefBegin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
U8Data1 := #$2267; //#$E2#$89#$A7;
|
||||||
|
U8Data2 := #$2267'X';
|
||||||
// access constant that are not passed as function arg
|
// access constant that are not passed as function arg
|
||||||
// so every constant is accessed, and they can not be optimized away
|
// so every constant is accessed, and they can not be optimized away
|
||||||
InterfacedObject:= TInterfacedObject.create;
|
InterfacedObject:= TInterfacedObject.create;
|
||||||
|
@ -32,6 +32,7 @@ type
|
|||||||
ehMatchTypeName, // The typename is a regex
|
ehMatchTypeName, // The typename is a regex
|
||||||
ehNoTypeInfo,
|
ehNoTypeInfo,
|
||||||
|
|
||||||
|
ehNoCharQuoting, // unprintable chars are already escaped/quoted
|
||||||
ehCharFromIndex, // Debugger is allowed Pchar: 'x' String 'y'
|
ehCharFromIndex, // Debugger is allowed Pchar: 'x' String 'y'
|
||||||
ehNoFieldOrder, // structure: fields can be in any order
|
ehNoFieldOrder, // structure: fields can be in any order
|
||||||
ehMissingFields, // structure: fields may have gaps
|
ehMissingFields, // structure: fields may have gaps
|
||||||
@ -171,6 +172,7 @@ type
|
|||||||
function IgnTypeName(ASymTypes: TSymbolTypes = []; ACond: Boolean = True): PWatchExpectation;
|
function IgnTypeName(ASymTypes: TSymbolTypes = []; ACond: Boolean = True): PWatchExpectation;
|
||||||
function MatchTypeName(ASymTypes: TSymbolTypes = []; ACond: Boolean = True): PWatchExpectation;
|
function MatchTypeName(ASymTypes: TSymbolTypes = []; ACond: Boolean = True): PWatchExpectation;
|
||||||
|
|
||||||
|
function NoCharQuoting(ASymTypes: TSymbolTypes = []; ACond: Boolean = True): PWatchExpectation;
|
||||||
function CharFromIndex(ASymTypes: TSymbolTypes = []; ACond: Boolean = True): PWatchExpectation;
|
function CharFromIndex(ASymTypes: TSymbolTypes = []; ACond: Boolean = True): PWatchExpectation;
|
||||||
|
|
||||||
function ExpectNotFound(ASymTypes: TSymbolTypes = []; ACond: Boolean = True): PWatchExpectation;
|
function ExpectNotFound(ASymTypes: TSymbolTypes = []; ACond: Boolean = True): PWatchExpectation;
|
||||||
@ -993,6 +995,13 @@ begin
|
|||||||
Result := Self^.AddFlag(ehMatchTypeName, ASymTypes);
|
Result := Self^.AddFlag(ehMatchTypeName, ASymTypes);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TWatchExpectationHelper.NoCharQuoting(ASymTypes: TSymbolTypes;
|
||||||
|
ACond: Boolean): PWatchExpectation;
|
||||||
|
begin
|
||||||
|
if not ACond then exit(Self);
|
||||||
|
Result := Self^.AddFlag(ehNoCharQuoting, ASymTypes);
|
||||||
|
end;
|
||||||
|
|
||||||
function TWatchExpectationHelper.CharFromIndex(ASymTypes: TSymbolTypes; ACond: Boolean): PWatchExpectation;
|
function TWatchExpectationHelper.CharFromIndex(ASymTypes: TSymbolTypes; ACond: Boolean): PWatchExpectation;
|
||||||
begin
|
begin
|
||||||
if not ACond then exit(Self);
|
if not ACond then exit(Self);
|
||||||
@ -1570,10 +1579,13 @@ begin
|
|||||||
with AContext.WatchExp do begin
|
with AContext.WatchExp do begin
|
||||||
Result := True;
|
Result := True;
|
||||||
Expect := AContext.Expectation;
|
Expect := AContext.Expectation;
|
||||||
|
|
||||||
e := QuoteText(Expect.ExpTextData);
|
|
||||||
|
|
||||||
ehf := Expect.ExpErrorHandlingFlags[Compiler.SymbolType];
|
ehf := Expect.ExpErrorHandlingFlags[Compiler.SymbolType];
|
||||||
|
|
||||||
|
if ehNoCharQuoting in ehf then
|
||||||
|
e := Expect.ExpTextData
|
||||||
|
else
|
||||||
|
e := QuoteText(Expect.ExpTextData);
|
||||||
|
|
||||||
if ehCharFromIndex in ehf then begin
|
if ehCharFromIndex in ehf then begin
|
||||||
if AContext.WatchVal.Value <> e then begin
|
if AContext.WatchVal.Value <> e then begin
|
||||||
//AnIgnoreRsn := AnIgnoreRsn + 'char from index not implemented';
|
//AnIgnoreRsn := AnIgnoreRsn + 'char from index not implemented';
|
||||||
@ -1633,7 +1645,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
e := QuoteText(Expect.ExpTextData);
|
if ehNoCharQuoting in ehf then
|
||||||
|
e := Expect.ExpTextData
|
||||||
|
else
|
||||||
|
e := QuoteText(Expect.ExpTextData);
|
||||||
Result := TestEquals('Data', e, v, AContext, AnIgnoreRsn);
|
Result := TestEquals('Data', e, v, AContext, AnIgnoreRsn);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -1643,11 +1658,16 @@ function TWatchExpectationList.CheckResultShortStr(
|
|||||||
var
|
var
|
||||||
Expect: TWatchExpectationResult;
|
Expect: TWatchExpectationResult;
|
||||||
e: String;
|
e: String;
|
||||||
|
ehf: TWatchExpErrorHandlingFlags;
|
||||||
begin
|
begin
|
||||||
with AContext.WatchExp do begin
|
with AContext.WatchExp do begin
|
||||||
Result := True;
|
Result := True;
|
||||||
Expect := AContext.Expectation;
|
Expect := AContext.Expectation;
|
||||||
e := QuoteText(Expect.ExpTextData);
|
ehf := Expect.ExpErrorHandlingFlags[Compiler.SymbolType];
|
||||||
|
if ehNoCharQuoting in ehf then
|
||||||
|
e := Expect.ExpTextData
|
||||||
|
else
|
||||||
|
e := QuoteText(Expect.ExpTextData);
|
||||||
|
|
||||||
Result := TestEquals('Data', e, AContext.WatchVal.Value, AContext, AnIgnoreRsn);
|
Result := TestEquals('Data', e, AContext.WatchVal.Value, AContext, AnIgnoreRsn);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user