mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 10:39:18 +02:00
* also check for invalid attribute data in tests
git-svn-id: trunk@42364 -
This commit is contained in:
parent
ba413bcdfc
commit
38fad4b5cf
@ -32,12 +32,14 @@ end;
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
ad := GetAttributeData(TMyObject.ClassInfo);
|
ad := GetAttributeData(TMyObject.ClassInfo);
|
||||||
if ad^.AttributeCount<>1 then
|
if not assigned(ad) then
|
||||||
halt(1);
|
halt(1);
|
||||||
|
if ad^.AttributeCount<>1 then
|
||||||
|
halt(2);
|
||||||
|
|
||||||
AClassAttribute := GetAttribute(ad,0);
|
AClassAttribute := GetAttribute(ad,0);
|
||||||
if AClassAttribute = nil then
|
if AClassAttribute = nil then
|
||||||
halt(2);
|
halt(3);
|
||||||
writeln('ok');
|
writeln('ok');
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
@ -23,12 +23,14 @@ var
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
ad := GetAttributeData(TMyObject.ClassInfo);
|
ad := GetAttributeData(TMyObject.ClassInfo);
|
||||||
|
if not Assigned(ad) then
|
||||||
|
Halt(1);
|
||||||
if ad^.AttributeCount<>1 then
|
if ad^.AttributeCount<>1 then
|
||||||
halt(1);
|
halt(2);
|
||||||
|
|
||||||
AClassAttribute := GetAttribute(ad,0);
|
AClassAttribute := GetAttribute(ad,0);
|
||||||
if AClassAttribute = nil then
|
if AClassAttribute = nil then
|
||||||
halt(2);
|
halt(3);
|
||||||
writeln('ok');
|
writeln('ok');
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
@ -36,20 +36,22 @@ end;
|
|||||||
begin
|
begin
|
||||||
rtd := GetAttributeData(TMyObject.ClassInfo);
|
rtd := GetAttributeData(TMyObject.ClassInfo);
|
||||||
|
|
||||||
if rtd^.AttributeCount<>2 then
|
if not Assigned(rtd) then
|
||||||
halt(1);
|
halt(1);
|
||||||
|
if rtd^.AttributeCount<>2 then
|
||||||
|
halt(2);
|
||||||
|
|
||||||
AClassAttribute := GetAttribute(rtd,1) as tmyt;
|
AClassAttribute := GetAttribute(rtd,1) as tmyt;
|
||||||
if AClassAttribute = nil then
|
if AClassAttribute = nil then
|
||||||
halt(2);
|
|
||||||
if AClassAttribute.FID<>1425 then
|
|
||||||
halt(3);
|
halt(3);
|
||||||
|
if AClassAttribute.FID<>1425 then
|
||||||
|
halt(4);
|
||||||
|
|
||||||
AClassAttribute := GetAttribute(rtd,0) as tmyt;
|
AClassAttribute := GetAttribute(rtd,0) as tmyt;
|
||||||
if AClassAttribute = nil then
|
if AClassAttribute = nil then
|
||||||
halt(2);
|
halt(5);
|
||||||
if AClassAttribute.FID<>924 then
|
if AClassAttribute.FID<>924 then
|
||||||
halt(3);
|
halt(6);
|
||||||
writeln('ok');
|
writeln('ok');
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
@ -22,12 +22,14 @@ var
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
ad := GetAttributeData(TMyObject.ClassInfo);
|
ad := GetAttributeData(TMyObject.ClassInfo);
|
||||||
if ad^.AttributeCount<>1 then
|
if not Assigned(ad) then
|
||||||
halt(1);
|
halt(1);
|
||||||
|
if ad^.AttributeCount<>1 then
|
||||||
|
halt(2);
|
||||||
|
|
||||||
AClassAttribute := GetAttribute(ad,0);
|
AClassAttribute := GetAttribute(ad,0);
|
||||||
if AClassAttribute = nil then
|
if AClassAttribute = nil then
|
||||||
halt(2);
|
halt(3);
|
||||||
writeln('ok');
|
writeln('ok');
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user