mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-20 08:59:38 +01:00
DBG: tests
git-svn-id: trunk@32950 -
This commit is contained in:
parent
e4f88c9b1c
commit
235d156fab
@ -96,8 +96,8 @@ procedure FooFunc(
|
||||
{$I WatchesPrgSimple.inc}
|
||||
{ enum/set }
|
||||
{$I WatchesPrgEnum.inc}
|
||||
{ Array }
|
||||
{$I WatchesPrgArray.inc}
|
||||
|
||||
|
||||
{ variants }
|
||||
{$I WatchesPrgVariant.inc}
|
||||
{ procedure/function/method }
|
||||
@ -117,8 +117,8 @@ type
|
||||
{$I WatchesPrgSimple.inc}
|
||||
{ enum/set }
|
||||
{$I WatchesPrgEnum.inc}
|
||||
{ Array }
|
||||
{$I WatchesPrgArray.inc}
|
||||
|
||||
|
||||
{ variants }
|
||||
{$I WatchesPrgVariant.inc}
|
||||
{ procedure/function/method }
|
||||
@ -137,8 +137,8 @@ var
|
||||
{$I WatchesPrgSimple.inc}
|
||||
{ enum/set }
|
||||
{$I WatchesPrgEnum.inc}
|
||||
{ Array }
|
||||
{$I WatchesPrgArray.inc}
|
||||
|
||||
|
||||
{ variants }
|
||||
{$I WatchesPrgVariant.inc}
|
||||
{ procedure/function/method }
|
||||
@ -158,8 +158,8 @@ var
|
||||
{$I WatchesPrgSimple.inc}
|
||||
{ enum/set }
|
||||
{$I WatchesPrgEnum.inc}
|
||||
{ Array }
|
||||
{$I WatchesPrgArray.inc}
|
||||
|
||||
|
||||
{ variants }
|
||||
{$I WatchesPrgVariant.inc}
|
||||
{ procedure/function/method }
|
||||
@ -178,8 +178,8 @@ var
|
||||
{$I WatchesPrgSimple.inc}
|
||||
{ enum/set }
|
||||
{$I WatchesPrgEnum.inc}
|
||||
{ Array }
|
||||
{$I WatchesPrgArray.inc}
|
||||
|
||||
|
||||
{ variants }
|
||||
{$I WatchesPrgVariant.inc}
|
||||
{ procedure/function/method }
|
||||
@ -196,8 +196,8 @@ var
|
||||
{$I WatchesPrgSimple.inc}
|
||||
{ enum/set }
|
||||
{$I WatchesPrgEnum.inc}
|
||||
{ Array }
|
||||
{$I WatchesPrgArray.inc}
|
||||
|
||||
|
||||
{ variants }
|
||||
{$I WatchesPrgVariant.inc}
|
||||
{ procedure/function/method }
|
||||
@ -216,8 +216,8 @@ begin
|
||||
{$I WatchesPrgSimple.inc}
|
||||
{ enum/set }
|
||||
{$I WatchesPrgEnum.inc}
|
||||
{ Array }
|
||||
{$I WatchesPrgArray.inc}
|
||||
|
||||
|
||||
{ variants }
|
||||
{$I WatchesPrgVariant.inc}
|
||||
{ procedure/function/method }
|
||||
@ -232,6 +232,29 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
|
||||
|
||||
procedure FooFuncArray(
|
||||
(*** parameter and var-param ***)
|
||||
{$DEFINE FooFunc_Param}
|
||||
{$I WatchesPrgArray.inc} { Array }
|
||||
Dummy: Integer
|
||||
{$UNDEF FooFunc_Param}
|
||||
);
|
||||
(*** local var/type ***)
|
||||
{$DEFINE FooFunc_Local}
|
||||
{$I WatchesPrgArray.inc} { Array }
|
||||
{$UNDEF FooFunc_Local}
|
||||
begin
|
||||
{$DEFINE FooFunc_Body}
|
||||
{$I WatchesPrgArray.inc} { Array }
|
||||
{$UNDEF FooFunc_Body}
|
||||
|
||||
// break on next line
|
||||
writeln(1);
|
||||
end;
|
||||
|
||||
|
||||
var
|
||||
(*** global var (to feed var-param)-***)
|
||||
{$DEFINE Global_Var}
|
||||
@ -271,8 +294,8 @@ begin
|
||||
|
||||
{$UNDEF Global_Body}
|
||||
|
||||
FooFunc(
|
||||
{$DEFINE Global_Call_FooFunc}
|
||||
{$DEFINE Global_Call_FooFunc}
|
||||
FooFunc(
|
||||
{ class/record/object }
|
||||
{$I WatchesPrgStruct.inc}
|
||||
{ strings }
|
||||
@ -281,16 +304,20 @@ begin
|
||||
{$I WatchesPrgSimple.inc}
|
||||
{ enum/set }
|
||||
{$I WatchesPrgEnum.inc}
|
||||
{ Array }
|
||||
{$I WatchesPrgArray.inc}
|
||||
{ variants }
|
||||
{$I WatchesPrgVariant.inc}
|
||||
{ procedure/function/method }
|
||||
{$I WatchesPrgProc.inc}
|
||||
|
||||
0
|
||||
{$UNDEF Global_Call_FooFunc}
|
||||
);
|
||||
);
|
||||
|
||||
FooFuncArray(
|
||||
{ Array }
|
||||
{$I WatchesPrgArray.inc}
|
||||
0
|
||||
);
|
||||
{$UNDEF Global_Call_FooFunc}
|
||||
|
||||
|
||||
// same with nil
|
||||
@ -312,8 +339,8 @@ begin
|
||||
|
||||
{$UNDEF Global_Body_NIL}
|
||||
|
||||
FooFunc(
|
||||
{$DEFINE Global_Call_FooFunc}
|
||||
{$DEFINE Global_Call_FooFunc}
|
||||
FooFunc(
|
||||
{ class/record/object }
|
||||
{$I WatchesPrgStruct.inc}
|
||||
{ strings }
|
||||
@ -322,16 +349,20 @@ begin
|
||||
{$I WatchesPrgSimple.inc}
|
||||
{ enum/set }
|
||||
{$I WatchesPrgEnum.inc}
|
||||
{ Array }
|
||||
{$I WatchesPrgArray.inc}
|
||||
{ variants }
|
||||
{$I WatchesPrgVariant.inc}
|
||||
{ procedure/function/method }
|
||||
{$I WatchesPrgProc.inc}
|
||||
|
||||
0
|
||||
{$UNDEF Global_Call_FooFunc}
|
||||
);
|
||||
);
|
||||
|
||||
FooFuncArray(
|
||||
{ Array }
|
||||
{$I WatchesPrgArray.inc}
|
||||
0
|
||||
);
|
||||
{$UNDEF Global_Call_FooFunc}
|
||||
|
||||
// not bother to free mem
|
||||
end.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -84,7 +84,11 @@
|
||||
TMyAnsiStringDArray = Array of AnsiString;
|
||||
TMyAnsiStringSArray = Array [3..5] of AnsiString;
|
||||
|
||||
// TODO array of ShortString
|
||||
TMyPAnsiStringDArray = Array of PAnsiString;
|
||||
TMyPAnsiStringSArray = Array [3..5] of PAnsiString;
|
||||
|
||||
TMyShortStringDArray = Array of ShortString;
|
||||
TMyShortStringSArray = Array [3..5] of ShortString;
|
||||
|
||||
// strings in object
|
||||
TStringHolderObj = class
|
||||
@ -271,6 +275,13 @@
|
||||
|
||||
ArgTMyAnsiStringDArray: TMyAnsiStringDArray; var VArgTMyAnsiStringDArray: TMyAnsiStringDArray;
|
||||
ArgTMyAnsiStringSArray: TMyAnsiStringSArray; var VArgTMyAnsiStringSArray: TMyAnsiStringSArray;
|
||||
|
||||
ArgTMyPAnsiStringDArray: TMyPAnsiStringDArray; var VArgTMyPAnsiStringDArray: TMyPAnsiStringDArray;
|
||||
ArgTMyPAnsiStringSArray: TMyPAnsiStringSArray; var VArgTMyPAnsiStringSArray: TMyPAnsiStringSArray;
|
||||
|
||||
ArgTMyShortStringDArray: TMyShortStringDArray; var VArgTMyShortStringDArray: TMyShortStringDArray;
|
||||
ArgTMyShortStringSArray: TMyShortStringSArray; var VArgTMyShortStringSArray: TMyShortStringSArray;
|
||||
|
||||
ArgTStringHolderObj: TStringHolderObj; var VArgTStringHolderObj: TStringHolderObj;
|
||||
ArgTStringHolderRec: TStringHolderRec; var VArgTStringHolderRec: TStringHolderRec;
|
||||
|
||||
@ -323,6 +334,13 @@
|
||||
|
||||
GlobTMyAnsiStringDArray, GlobTMyAnsiStringDArray2,
|
||||
GlobTMyAnsiStringSArray, GlobTMyAnsiStringSArray2,
|
||||
|
||||
GlobTMyPAnsiStringDArray, GlobTMyPAnsiStringDArray2,
|
||||
GlobTMyPAnsiStringSArray, GlobTMyPAnsiStringSArray2,
|
||||
|
||||
GlobTMyShortStringDArray, GlobTMyShortStringDArray2,
|
||||
GlobTMyShortStringSArray, GlobTMyShortStringSArray2,
|
||||
|
||||
GlobTStringHolderObj, GlobTStringHolderObj2,
|
||||
GlobTStringHolderRec, GlobTStringHolderRec2,
|
||||
{$ENDIF}
|
||||
@ -458,6 +476,12 @@
|
||||
GlobAMyAnsiStringDArray, GlobAMyAnsiStringDArray2: Array of AnsiString;
|
||||
GlobAMyAnsiStringSArray, GlobAMyAnsiStringSArray2: Array [3..5] of AnsiString;
|
||||
|
||||
GlobTMyPAnsiStringDArray, GlobTMyPAnsiStringDArray2: TMyPAnsiStringDArray;
|
||||
GlobTMyPAnsiStringSArray, GlobTMyPAnsiStringSArray2: TMyPAnsiStringSArray;
|
||||
|
||||
GlobTMyShortStringDArray, GlobTMyShortStringDArray2: TMyShortStringDArray;
|
||||
GlobTMyShortStringSArray, GlobTMyShortStringSArray2: TMyShortStringSArray;
|
||||
|
||||
GlobTStringHolderObj, GlobTStringHolderObj2: TStringHolderObj;
|
||||
GlobTStringHolderRec, GlobTStringHolderRec2: TStringHolderRec;
|
||||
|
||||
@ -584,19 +608,61 @@
|
||||
|
||||
SetLength(GlobTMyAnsiStringDArray, 3);
|
||||
SetLength(GlobTMyAnsiStringDArray2, 3);
|
||||
GlobTMyAnsiStringDArray[0] := 'DArray1 Str0';
|
||||
GlobTMyAnsiStringDArray[1] := 'DArray1 Str1';
|
||||
GlobTMyAnsiStringDArray[0] := 'DArray1 Str0';
|
||||
GlobTMyAnsiStringDArray[1] := 'DArray1 Str1';
|
||||
GlobTMyAnsiStringDArray2[0] := 'DArray2 Str0';
|
||||
GlobTMyAnsiStringDArray2[1] := 'DArray2 Str1';
|
||||
|
||||
GlobTMyAnsiStringSArray[3] := 'SArray1 Str3';
|
||||
GlobTMyAnsiStringSArray[4] := 'SArray1 Str4';
|
||||
GlobTMyAnsiStringSArray[3] := 'SArray1 Str3';
|
||||
GlobTMyAnsiStringSArray[4] := 'SArray1 Str4';
|
||||
GlobTMyAnsiStringSArray2[3] := 'SArray2 Str3';
|
||||
GlobTMyAnsiStringSArray2[4] := 'SArray2 Str4';
|
||||
|
||||
//GlobAMyAnsiStringDArray, GlobAMyAnsiStringDArray2: Array of AnsiString;
|
||||
//GlobAMyAnsiStringSArray, GlobAMyAnsiStringSArray2: Array [3..5] of AnsiString;
|
||||
//
|
||||
SetLength(GlobAMyAnsiStringDArray, 3);
|
||||
SetLength(GlobAMyAnsiStringDArray2, 3);
|
||||
GlobAMyAnsiStringDArray[0] := 'ADArray1 Str0';
|
||||
GlobAMyAnsiStringDArray[1] := 'ADArray1 Str1';
|
||||
GlobAMyAnsiStringDArray2[0] := 'ADArray2 Str0';
|
||||
GlobAMyAnsiStringDArray2[1] := 'ADArray2 Str1';
|
||||
|
||||
GlobAMyAnsiStringSArray[3] := 'ASArray1 Str3';
|
||||
GlobAMyAnsiStringSArray[4] := 'ASArray1 Str4';
|
||||
GlobAMyAnsiStringSArray2[3] := 'ASArray2 Str3';
|
||||
GlobAMyAnsiStringSArray2[4] := 'ASArray2 Str4';
|
||||
|
||||
//GlobTMyPAnsiStringDArray, GlobTMyPAnsiStringDArray2: TMyPAnsiStringDArray;
|
||||
//GlobTMyPAnsiStringSArray, GlobTMyPAnsiStringSArray2: TMyPAnsiStringSArray;
|
||||
SetLength(GlobTMyPAnsiStringDArray, 3);
|
||||
SetLength(GlobTMyPAnsiStringDArray2, 3);
|
||||
GlobTMyPAnsiStringDArray[0] := @GlobTMyAnsiStringDArray[0];
|
||||
GlobTMyPAnsiStringDArray[1] := @GlobTMyAnsiStringDArray[1];
|
||||
GlobTMyPAnsiStringDArray2[0] := @GlobTMyAnsiStringDArray2[0];
|
||||
GlobTMyPAnsiStringDArray2[1] := @GlobTMyAnsiStringDArray2[1];
|
||||
|
||||
GlobTMyPAnsiStringSArray[3] := @GlobTMyAnsiStringSArray[3];
|
||||
GlobTMyPAnsiStringSArray[4] := @GlobTMyAnsiStringSArray[4];
|
||||
GlobTMyPAnsiStringSArray2[3] := @GlobTMyAnsiStringSArray2[3];
|
||||
GlobTMyPAnsiStringSArray2[4] := @GlobTMyAnsiStringSArray2[4];
|
||||
|
||||
|
||||
//GlobTMyShortStringDArray, GlobTMyShortStringDArray2: TMyShortStringDArray;
|
||||
//GlobTMyShortStringSArray, GlobTMyShortStringSArray2: TMyShortStringSArray;
|
||||
SetLength(GlobTMyShortStringDArray, 3);
|
||||
SetLength(GlobTMyShortStringDArray2, 3);
|
||||
GlobTMyShortStringDArray[0] := 'DArray1 Short0';
|
||||
GlobTMyShortStringDArray[1] := 'DArray1 Short1';
|
||||
GlobTMyShortStringDArray2[0] := 'DArray2 Short0';
|
||||
GlobTMyShortStringDArray2[1] := 'DArray2 Short1';
|
||||
|
||||
GlobTMyShortStringSArray[3] := 'SArray1 Short3';
|
||||
GlobTMyShortStringSArray[4] := 'SArray1 Short4';
|
||||
GlobTMyShortStringSArray2[3] := 'SArray2 Short3';
|
||||
GlobTMyShortStringSArray2[4] := 'SArray2 Short4';
|
||||
|
||||
|
||||
|
||||
|
||||
GlobTStringHolderObj := TStringHolderObj.Create;
|
||||
GlobTStringHolderObj.FTMyAnsiString := 'Obj1 MyAnsi';
|
||||
|
||||
@ -45,18 +45,31 @@
|
||||
ValInt: Integer;
|
||||
ValFoo: TFoo;
|
||||
end;
|
||||
TNewRec = type TRec;
|
||||
|
||||
PRec2 = ^TRec2;
|
||||
PPRec2 = ^PRec2;
|
||||
TRec2 = record
|
||||
PRecSelf = ^TRecSelf;
|
||||
PPRecSelf = ^PRecSelf;
|
||||
TRecSelf = record
|
||||
ValInt: Integer;
|
||||
ValPRec: PRec;
|
||||
ValPPRec: PPRec;
|
||||
ValPRec2: PRec2;
|
||||
ValPPRec2: PPRec2;
|
||||
ValPRec2: PRecSelf;
|
||||
ValPPRec2: PPRecSelf;
|
||||
ValRecSelfDArray: Array of PRecSelf;
|
||||
ValRecSelfS0Array: Array [0..2] of PRecSelf;
|
||||
ValRecSelfS1Array: Array [1..3] of PRecSelf;
|
||||
ValRecSelfS3Array: Array [3..6] of PRecSelf;
|
||||
end;
|
||||
|
||||
TNewRec = type TRec;
|
||||
TRecSelfDArray = Array of TRecSelf;
|
||||
TRecSelfS0Array = Array [0..2] of TRecSelf;
|
||||
TRecSelfS1Array = Array [1..3] of TRecSelf;
|
||||
TRecSelfS3Array = Array [3..6] of TRecSelf;
|
||||
|
||||
TPRecSelfDArray = Array of PRecSelf;
|
||||
TPRecSelfS0Array = Array [0..2] of PRecSelf;
|
||||
TPRecSelfS1Array = Array [1..3] of PRecSelf;
|
||||
TPRecSelfS3Array = Array [3..6] of PRecSelf;
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF FooFunc_LocalType}
|
||||
@ -79,14 +92,42 @@
|
||||
ArgPRec: PRec; var VArgPRec: PRec;
|
||||
ArgPPRec: PPRec; var VArgPPRec: PPRec;
|
||||
ArgTNewRec: TNewRec; var VArgTNewRec: TNewRec;
|
||||
|
||||
ArgTRecSelf: TRecSelf; var VArgTRecSelf: TRecSelf;
|
||||
ArgPRecSelf: PRecSelf; var VArgPRecSelf: PRecSelf;
|
||||
ArgPPRecSelf: PPRecSelf; var VArgPPRecSelf: PPRecSelf;
|
||||
|
||||
ArgTRecSelfDArray: TRecSelfDArray; var VArgTRecSelfDArray: TRecSelfDArray;
|
||||
ArgTRecSelfS0Array: TRecSelfS0Array; var VArgTRecSelfS0Array: TRecSelfS0Array;
|
||||
ArgTRecSelfS1Array: TRecSelfS1Array; var VArgTRecSelfS1Array: TRecSelfS1Array;
|
||||
ArgTRecSelfS3Array: TRecSelfS3Array; var VArgTRecSelfS3Array: TRecSelfS3Array;
|
||||
|
||||
ArgTPRecSelfDArray: TPRecSelfDArray; var VArgTPRecSelfDArray: TPRecSelfDArray;
|
||||
ArgTPRecSelfS0Array: TPRecSelfS0Array; var VArgTPRecSelfS0Array: TPRecSelfS0Array;
|
||||
ArgTPRecSelfS1Array: TPRecSelfS1Array; var VArgTPRecSelfS1Array: TPRecSelfS1Array;
|
||||
ArgTPRecSelfS3Array: TPRecSelfS3Array; var VArgTPRecSelfS3Array: TPRecSelfS3Array;
|
||||
{$ENDIF}
|
||||
{$IFDEF Global_Call_FooFunc}
|
||||
//FooFunc(
|
||||
{ records }
|
||||
GlobTRec, GlobTRec,
|
||||
GlobPRec, GlobPRec,
|
||||
GlobPPRec, GlobPPRec,
|
||||
GlobTNewRec, GlobTNewRec,
|
||||
GlobTRec, GlobTRec,
|
||||
GlobPRec, GlobPRec,
|
||||
GlobPPRec, GlobPPRec,
|
||||
GlobTNewRec, GlobTNewRec,
|
||||
|
||||
GlobTRecSelf, GlobTRecSelf2,
|
||||
GlobPRecSelf, GlobPRecSelf2,
|
||||
GlobPPRecSelf, GlobPPRecSelf2,
|
||||
|
||||
GlobTRecSelfDArray, GlobTRecSelfDArray2,
|
||||
GlobTRecSelfS0Array, GlobTRecSelfS0Array2,
|
||||
GlobTRecSelfS1Array, GlobTRecSelfS1Array2,
|
||||
GlobTRecSelfS3Array, GlobTRecSelfS3Array2,
|
||||
|
||||
GlobTPRecSelfDArray, GlobTPRecSelfDArray2,
|
||||
GlobTPRecSelfS0Array, GlobTPRecSelfS0Array2,
|
||||
GlobTPRecSelfS1Array, GlobTPRecSelfS1Array2,
|
||||
GlobTPRecSelfS3Array, GlobTPRecSelfS3Array2,
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF FooFunc_LocalVar}
|
||||
@ -107,14 +148,28 @@
|
||||
//var
|
||||
{ records }
|
||||
GlobTRec, GlobTRec1, GlobTRec2: TRec;
|
||||
GlobPRec: PRec;
|
||||
GlobPRec, GlobPRec2: PRec;
|
||||
GlobPPRec: PPRec;
|
||||
GlobTNewRec: TNewRec;
|
||||
|
||||
PGlobTRec: ^TRec;
|
||||
PGlobTNewRec: ^TNewRec;
|
||||
{$ENDIF}
|
||||
|
||||
GlobTRecSelf, GlobTRecSelf2: TRecSelf;
|
||||
GlobPRecSelf, GlobPRecSelf2: PRecSelf;
|
||||
GlobPPRecSelf, GlobPPRecSelf2: PPRecSelf;
|
||||
|
||||
GlobTRecSelfDArray, GlobTRecSelfDArray2: TRecSelfDArray;
|
||||
GlobTRecSelfS0Array, GlobTRecSelfS0Array2: TRecSelfS0Array;
|
||||
GlobTRecSelfS1Array, GlobTRecSelfS1Array2: TRecSelfS1Array;
|
||||
GlobTRecSelfS3Array, GlobTRecSelfS3Array2: TRecSelfS3Array;
|
||||
|
||||
GlobTPRecSelfDArray, GlobTPRecSelfDArray2: TPRecSelfDArray;
|
||||
GlobTPRecSelfS0Array, GlobTPRecSelfS0Array2: TPRecSelfS0Array;
|
||||
GlobTPRecSelfS1Array, GlobTPRecSelfS1Array2: TPRecSelfS1Array;
|
||||
GlobTPRecSelfS3Array, GlobTPRecSelfS3Array2: TPRecSelfS3Array;
|
||||
|
||||
{$ENDIF}
|
||||
{%endregion VARIABLES}
|
||||
|
||||
{%region CODE (initilization)}
|
||||
@ -135,31 +190,104 @@
|
||||
{$IFDEF Global_Body}
|
||||
//begin
|
||||
{ records }
|
||||
with GlobTRec do begin
|
||||
ValInt := -1;
|
||||
ValFoo := nil;
|
||||
end;
|
||||
with GlobTRec1 do begin
|
||||
ValInt := 1;
|
||||
ValFoo := TFoo.Create;
|
||||
ValFoo.ValueInt := 11;
|
||||
end;
|
||||
with GlobTRec2 do begin
|
||||
ValInt := 2;
|
||||
ValFoo := TFoo.Create;
|
||||
ValFoo.ValueInt := 22;
|
||||
end;
|
||||
GlobTRec.ValInt := -1;
|
||||
GlobTRec.ValFoo := nil;
|
||||
|
||||
GlobTRec1.ValInt := 1;
|
||||
GlobTRec1.ValFoo := TFoo.Create;
|
||||
GlobTRec1.ValFoo.ValueInt := 11;
|
||||
|
||||
GlobTRec2.ValInt := 2;
|
||||
GlobTRec2.ValFoo := TFoo.Create;
|
||||
GlobTRec2.ValFoo.ValueInt := 22;
|
||||
|
||||
GlobPRec := @GlobTRec1;
|
||||
GlobPPRec := @GlobPRec;
|
||||
GlobPRec2 := @GlobTRec2;
|
||||
GlobPPRec := @GlobPRec2;
|
||||
|
||||
with GlobTNewRec do begin
|
||||
ValInt := 3;
|
||||
ValFoo := nil;
|
||||
end;
|
||||
GlobTNewRec.ValInt := 3;
|
||||
GlobTNewRec.ValFoo := nil;
|
||||
|
||||
PGlobTRec := @GlobTNewRec;
|
||||
PGlobTNewRec := @GlobTNewRec;
|
||||
|
||||
//GlobTRecSelf, GlobTRecSelf2: TRecSelf;
|
||||
GlobTRecSelf.ValInt := 100;
|
||||
GlobTRecSelf.ValPRec := @GlobTRec1; // Valint=1
|
||||
GlobTRecSelf.ValPPRec := @GlobPRec2; // Valint=2
|
||||
GlobTRecSelf.ValPRec2 := @GlobTRecSelf; // self
|
||||
GlobTRecSelf.ValPPRec2 := @GlobTRecSelf.ValPRec2;
|
||||
|
||||
GlobTRecSelf2.ValInt := 102;
|
||||
GlobTRecSelf2.ValPRec := @GlobTRec1; // Valint=1
|
||||
GlobTRecSelf2.ValPPRec := @GlobPRec2; // Valint=2
|
||||
GlobTRecSelf2.ValPRec2 := @GlobTRecSelf2;
|
||||
GlobTRecSelf2.ValPPRec2 := @GlobTRecSelf2.ValPRec2;
|
||||
|
||||
SetLength(GlobTRecSelf.ValRecSelfDArray, 2);
|
||||
GlobTRecSelf.ValRecSelfDArray[0] := @GlobTRecSelf2;
|
||||
GlobTRecSelf.ValRecSelfDArray[1] := @GlobTRecSelf;
|
||||
GlobTRecSelf.ValRecSelfS0Array[0] := @GlobTRecSelf2;
|
||||
GlobTRecSelf.ValRecSelfS0Array[1] := @GlobTRecSelf;
|
||||
GlobTRecSelf.ValRecSelfS1Array[1] := @GlobTRecSelf2;
|
||||
GlobTRecSelf.ValRecSelfS1Array[2] := @GlobTRecSelf;
|
||||
GlobTRecSelf.ValRecSelfS3Array[3] := @GlobTRecSelf2;
|
||||
GlobTRecSelf.ValRecSelfS3Array[4] := @GlobTRecSelf;
|
||||
|
||||
SetLength(GlobTRecSelf2.ValRecSelfDArray, 2);
|
||||
GlobTRecSelf2.ValRecSelfDArray[0] := @GlobTRecSelf;
|
||||
GlobTRecSelf2.ValRecSelfDArray[1] := @GlobTRecSelf2;
|
||||
GlobTRecSelf2.ValRecSelfS0Array[0] := @GlobTRecSelf;
|
||||
GlobTRecSelf2.ValRecSelfS0Array[1] := @GlobTRecSelf2;
|
||||
GlobTRecSelf2.ValRecSelfS1Array[1] := @GlobTRecSelf;
|
||||
GlobTRecSelf2.ValRecSelfS1Array[2] := @GlobTRecSelf2;
|
||||
GlobTRecSelf2.ValRecSelfS3Array[3] := @GlobTRecSelf;
|
||||
GlobTRecSelf2.ValRecSelfS3Array[4] := @GlobTRecSelf2;
|
||||
|
||||
//GlobPRecSelf, GlobPRecSelf2: PRecSelf;
|
||||
GlobPRecSelf := @GlobTRecSelf;
|
||||
GlobPRecSelf2 := @GlobTRecSelf2;
|
||||
|
||||
//GlobPPRecSelf, GlobPPRecSelf2: PPRecSelf;
|
||||
GlobPPRecSelf := @GlobPRecSelf;
|
||||
GlobPPRecSelf2 := @GlobPRecSelf2;
|
||||
|
||||
//GlobTRecSelfDArray, GlobTRecSelfDArray2: TRecSelfDArray;
|
||||
SetLength(GlobTRecSelfDArray, 2);
|
||||
SetLength(GlobTRecSelfDArray2, 2);
|
||||
GlobTRecSelfDArray[0] := GlobTRecSelf;
|
||||
GlobTRecSelfDArray[1] := GlobTRecSelf2;
|
||||
GlobTRecSelfDArray2[0] := GlobTRecSelf;
|
||||
GlobTRecSelfDArray2[1] := GlobTRecSelf2;
|
||||
|
||||
//GlobTRecSelfS0Array, GlobTRecSelfS0Array2: TRecSelfS0Array;
|
||||
GlobTRecSelfS0Array[0] := GlobTRecSelf;
|
||||
GlobTRecSelfS0Array[1] := GlobTRecSelf2;
|
||||
GlobTRecSelfS0Array2[0] := GlobTRecSelf;
|
||||
GlobTRecSelfS0Array2[1] := GlobTRecSelf2;
|
||||
//GlobTRecSelfS1Array, GlobTRecSelfS1Array2: TRecSelfS1Array;
|
||||
GlobTRecSelfS1Array[1] := GlobTRecSelf;
|
||||
GlobTRecSelfS1Array[2] := GlobTRecSelf2;
|
||||
GlobTRecSelfS1Array2[1] := GlobTRecSelf;
|
||||
GlobTRecSelfS1Array2[2] := GlobTRecSelf2;
|
||||
//GlobTRecSelfS3Array, GlobTRecSelfS3Array2: TRecSelfS3Array;
|
||||
GlobTRecSelfS3Array[3] := GlobTRecSelf;
|
||||
GlobTRecSelfS3Array[4] := GlobTRecSelf2;
|
||||
GlobTRecSelfS3Array2[3] := GlobTRecSelf;
|
||||
GlobTRecSelfS3Array2[4] := GlobTRecSelf2;
|
||||
|
||||
//GlobTPRecSelfDArray, GlobTPRecSelfDArray2: TPRecSelfDArray;
|
||||
SetLength(GlobTPRecSelfDArray, 2);
|
||||
SetLength(GlobTPRecSelfDArray2, 2);
|
||||
GlobTPRecSelfDArray[0] := @GlobTRecSelfDArray[0];
|
||||
GlobTPRecSelfDArray[1] := @GlobTRecSelfDArray[1];
|
||||
GlobTPRecSelfDArray2[0] := @GlobTRecSelfDArray2[0];
|
||||
GlobTPRecSelfDArray2[1] := @GlobTRecSelfDArray2[1];
|
||||
|
||||
|
||||
//GlobTPRecSelfS0Array, GlobTPRecSelfS0Array2: TPRecSelfS0Array;
|
||||
//GlobTPRecSelfS1Array, GlobTPRecSelfS1Array2: TPRecSelfS1Array;
|
||||
//GlobTPRecSelfS3Array, GlobTPRecSelfS3Array2: TPRecSelfS3Array;
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF Global_Body_NIL}
|
||||
|
||||
@ -370,10 +370,7 @@ end;
|
||||
|
||||
procedure TGDBTestCase.InternalDbgOutPut(Sender: TObject; const AText: String);
|
||||
begin
|
||||
if GetLogActive then begin
|
||||
CreateLog;
|
||||
writeln(FLogFile, AText);
|
||||
end;
|
||||
LogToFile(AText);
|
||||
DoDbgOutPut(Sender, AText);
|
||||
end;
|
||||
|
||||
@ -579,20 +576,18 @@ begin
|
||||
if (MinGdbVers > 0) then begin
|
||||
i := GetDebuggerInfo.Version;
|
||||
if (i > 0) and (i < MinGdbVers) then
|
||||
AIgnoreReason := AIgnoreReason + IntToStr(FTestCnt) + ': ' + s
|
||||
+ 'GDB ('+IntToStr(i)+') to old, required:'+IntToStr(MinGdbVers)
|
||||
+ LineEnding;
|
||||
AIgnoreReason := AIgnoreReason
|
||||
+ 'GDB ('+IntToStr(i)+') to old, required:'+IntToStr(MinGdbVers);
|
||||
end;
|
||||
if (MinFpcVers > 0) then begin
|
||||
i := GetCompilerInfo.Version;
|
||||
if (i > 0) and (i < MinFpcVers) then
|
||||
AIgnoreReason := AIgnoreReason + IntToStr(FTestCnt) + ': ' + s
|
||||
+ 'FPC ('+IntToStr(i)+') to old, required:'+IntToStr(MinFpcVers)
|
||||
+ LineEnding;
|
||||
AIgnoreReason := AIgnoreReason
|
||||
+ 'FPC ('+IntToStr(i)+') to old, required:'+IntToStr(MinFpcVers);
|
||||
end;
|
||||
|
||||
if AIgnoreReason <> '' then begin
|
||||
FUnexpectedSuccess := FUnexpectedSuccess + AIgnoreReason;
|
||||
FUnexpectedSuccess:= FUnexpectedSuccess + IntToStr(FTestCnt) + ': ' + '### '+AIgnoreReason +' >>> '+s+LineEnding;
|
||||
inc(FUnexpectedSuccessCnt);
|
||||
end
|
||||
else
|
||||
@ -683,12 +678,12 @@ begin
|
||||
writeln(FLogFile, '================= Unexpected Success'+LineEnding);
|
||||
writeln(FLogFile, FUnexpectedSuccess);
|
||||
writeln(FLogFile, '================='+LineEnding);
|
||||
if (FTestErrorCnt > 0) and (pos('failed', FFinalLogFileName) < 1)
|
||||
then FFinalLogFileName := FFinalLogFileName + '.failed';
|
||||
if (FIgnoredErrorCnt > 0) and (pos('ignored', FFinalLogFileName) < 1)
|
||||
then FFinalLogFileName := FFinalLogFileName + '.ignored';
|
||||
if (FUnexpectedSuccessCnt > 0) and (pos('unexpected', FFinalLogFileName) < 1)
|
||||
then FFinalLogFileName := FFinalLogFileName + '.unexpected';
|
||||
if (FTestErrorCnt > 0) and (pos('failed', FFinalLogFileName) < 1)
|
||||
then FFinalLogFileName := FFinalLogFileName + '.failed';
|
||||
end;
|
||||
if s <> '' then begin
|
||||
Fail(s1+ LineEnding + s);
|
||||
@ -719,6 +714,9 @@ begin
|
||||
end;
|
||||
|
||||
procedure TGDBTestCase.LogToFile(const s: string);
|
||||
var
|
||||
buf: array[0..5000] of char;
|
||||
i: Integer;
|
||||
begin
|
||||
if GetLogActive then begin
|
||||
CreateLog;
|
||||
|
||||
@ -48,25 +48,25 @@ end;
|
||||
|
||||
{ TTestBreakPoint }
|
||||
|
||||
procedure TTestBreakPoint.DoCurrent(Sender: TObject; const ALocation: TDBGLocationRec);
|
||||
procedure TTestBreakPoint.DoCurrent(Sender: TObject; const ALocation: TDBGLocationRec);
|
||||
begin
|
||||
FCurFile := ALocation.SrcFile;
|
||||
FCurLine := ALocation.SrcLine;
|
||||
end;
|
||||
|
||||
function TTestBreakPoint.DoGetFeedBack(Sender: TObject; const AText, AInfo: String;
|
||||
function TTestBreakPoint.DoGetFeedBack(Sender: TObject; const AText, AInfo: String;
|
||||
AType: TDBGFeedbackType; AButtons: TDBGFeedbackResults): TDBGFeedbackResult;
|
||||
begin
|
||||
Result := frOk;
|
||||
FreeAndNil(FBrkErr);
|
||||
end;
|
||||
|
||||
function TTestBreakPoint.GdbClass: TGDBMIDebuggerClass;
|
||||
function TTestBreakPoint.GdbClass: TGDBMIDebuggerClass;
|
||||
begin
|
||||
Result := TTestBrkGDBMIDebugger;
|
||||
end;
|
||||
|
||||
procedure TTestBreakPoint.TestBadAddrBreakpoint;
|
||||
procedure TTestBreakPoint.TestBadAddrBreakpoint;
|
||||
var
|
||||
TestExeName: string;
|
||||
dbg: TTestBrkGDBMIDebugger;
|
||||
@ -74,7 +74,7 @@ var
|
||||
begin
|
||||
if SkipTest then exit;
|
||||
if not TestControlForm.CheckListBox1.Checked[TestControlForm.CheckListBox1.Items.IndexOf('TTestBreakPoint')] then exit;
|
||||
if not TestControlForm.CheckListBox1.Checked[TestControlForm.CheckListBox1.Items.IndexOf('TTestBreakPoint.BadAddr')] then exit;
|
||||
if not TestControlForm.CheckListBox1.Checked[TestControlForm.CheckListBox1.Items.IndexOf(' TTestBreakPoint.BadAddr')] then exit;
|
||||
ClearTestErrors;
|
||||
FBrkErr := nil;
|
||||
|
||||
@ -122,7 +122,7 @@ begin
|
||||
|
||||
end;
|
||||
|
||||
procedure TTestBreakPoint.TestInteruptWhilePaused;
|
||||
procedure TTestBreakPoint.TestInteruptWhilePaused;
|
||||
var
|
||||
TestExeName, Err, IgnoreRes: string;
|
||||
dbg: TTestBrkGDBMIDebugger;
|
||||
@ -130,7 +130,7 @@ var
|
||||
begin
|
||||
if SkipTest then exit;
|
||||
if not TestControlForm.CheckListBox1.Checked[TestControlForm.CheckListBox1.Items.IndexOf('TTestBreakPoint')] then exit;
|
||||
if not TestControlForm.CheckListBox1.Checked[TestControlForm.CheckListBox1.Items.IndexOf('TTestBreakPoint.BadInterrupt')] then exit;
|
||||
if not TestControlForm.CheckListBox1.Checked[TestControlForm.CheckListBox1.Items.IndexOf(' TTestBreakPoint.BadInterrupt')] then exit;
|
||||
|
||||
(* Trigger a InterruptTarget while paused.
|
||||
Test if the app can continue, and reach it normal exit somehow (even if multiply interupts must be skipped)
|
||||
@ -201,7 +201,7 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
if TestControlForm.CheckListBox1.Checked[TestControlForm.CheckListBox1.Items.IndexOf('TTestBreakPoint.BadInterrupt.All')] then begin
|
||||
if TestControlForm.CheckListBox1.Checked[TestControlForm.CheckListBox1.Items.IndexOf(' TTestBreakPoint.BadInterrupt.All')] then begin
|
||||
try
|
||||
LogToFile(LineEnding+'###################### with pause -- 2 breaks ########################'+LineEnding+LineEnding);
|
||||
Err := '';
|
||||
@ -287,7 +287,7 @@ begin
|
||||
|
||||
|
||||
m := 1;
|
||||
if TestControlForm.CheckListBox1.Checked[TestControlForm.CheckListBox1.Items.IndexOf('TTestBreakPoint.BadInterrupt.All')]
|
||||
if TestControlForm.CheckListBox1.Checked[TestControlForm.CheckListBox1.Items.IndexOf(' TTestBreakPoint.BadInterrupt.All')]
|
||||
then m := 5; // run extra tests of Passed none-pause run
|
||||
|
||||
Err := '';
|
||||
@ -361,7 +361,7 @@ begin
|
||||
TestEquals('Passed none-pause run', '', Err, 0, IgnoreRes);
|
||||
|
||||
|
||||
if TestControlForm.CheckListBox1.Checked[TestControlForm.CheckListBox1.Items.IndexOf('TTestBreakPoint.BadInterrupt.All')] then begin
|
||||
if TestControlForm.CheckListBox1.Checked[TestControlForm.CheckListBox1.Items.IndexOf(' TTestBreakPoint.BadInterrupt.All')] then begin
|
||||
|
||||
try
|
||||
LogToFile(LineEnding+'###################### withOUT pause -- with stepping ########################'+LineEnding+LineEnding);
|
||||
|
||||
@ -64,25 +64,25 @@ begin
|
||||
CheckListBox1.Checked[j] := True;
|
||||
j := CheckListBox1.Items.Add('TTestWatch');
|
||||
CheckListBox1.Checked[j] := True;
|
||||
j := CheckListBox1.Items.Add('TTestWatch.Unstable');
|
||||
j := CheckListBox1.Items.Add(' TTestWatch.Unstable');
|
||||
CheckListBox1.Checked[j] := False;
|
||||
j := CheckListBox1.Items.Add('TTestWatch.Gdb');
|
||||
j := CheckListBox1.Items.Add(' TTestWatch.Gdb');
|
||||
CheckListBox1.Checked[j] := True;
|
||||
j := CheckListBox1.Items.Add('TTestWatch.All');
|
||||
j := CheckListBox1.Items.Add(' TTestWatch.All');
|
||||
CheckListBox1.Checked[j] := True;
|
||||
j := CheckListBox1.Items.Add('TTestWatch.Mix');
|
||||
j := CheckListBox1.Items.Add(' TTestWatch.Mix');
|
||||
CheckListBox1.Checked[j] := True;
|
||||
j := CheckListBox1.Items.Add('TTestWatch.Mix.All');
|
||||
j := CheckListBox1.Items.Add(' TTestWatch.Mix.All');
|
||||
CheckListBox1.Checked[j] := True;
|
||||
j := CheckListBox1.Items.Add('TTestWatch.Cache');
|
||||
j := CheckListBox1.Items.Add(' TTestWatch.Cache');
|
||||
CheckListBox1.Checked[j] := True;
|
||||
j := CheckListBox1.Items.Add('TTestBreakPoint');
|
||||
CheckListBox1.Checked[j] := True;
|
||||
j := CheckListBox1.Items.Add('TTestBreakPoint.BadAddr');
|
||||
j := CheckListBox1.Items.Add(' TTestBreakPoint.BadAddr');
|
||||
CheckListBox1.Checked[j] := True;
|
||||
j := CheckListBox1.Items.Add('TTestBreakPoint.BadInterrupt');
|
||||
j := CheckListBox1.Items.Add(' TTestBreakPoint.BadInterrupt');
|
||||
CheckListBox1.Checked[j] := True;
|
||||
j := CheckListBox1.Items.Add('TTestBreakPoint.BadInterrupt.All');
|
||||
j := CheckListBox1.Items.Add(' TTestBreakPoint.BadInterrupt.All');
|
||||
CheckListBox1.Checked[j] := False;
|
||||
|
||||
d := GetDebuggers;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user