* support 'true'/'false' for SetOrdProp on booleans (fixes #9347)

+ test for that bug, plus another test based on it which doesn't work yet

git-svn-id: trunk@8247 -
This commit is contained in:
Jonas Maebe 2007-08-08 13:26:28 +00:00
parent 174a2686f7
commit b43404964c
3 changed files with 50 additions and 0 deletions

2
.gitattributes vendored
View File

@ -8368,6 +8368,8 @@ tests/webtbs/tw9299.pp -text
tests/webtbs/tw9306a.pp -text
tests/webtbs/tw9306b.pp -text
tests/webtbs/tw9309.pp -text
tests/webtbs/tw9347.pp svneol=native#text/plain
tests/webtbs/tw9347a.pp svneol=native#text/plain
tests/webtbs/tw9384.pp svneol=native#text/plain
tests/webtbs/ub1873.pp svneol=native#text/plain
tests/webtbs/ub1883.pp svneol=native#text/plain

21
tests/webtbs/tw9347.pp Normal file
View File

@ -0,0 +1,21 @@
{$ifdef fpc}
{$mode delphi}
{$endif}
{$r-}
uses
SysUtils, Classes, TypInfo, Variants;
type
TBla = class(TPersistent)
private
fBool: Boolean;
fint: integer;
published
property Bool: Boolean read fBool write fBool;
property int: integer read fint write fint;
end;
begin
SetPropValue(TBla.Create, 'Bool', 'true');
end.

27
tests/webtbs/tw9347a.pp Normal file
View File

@ -0,0 +1,27 @@
{$ifdef fpc}
{$mode delphi}
{$endif}
{$r-}
uses
SysUtils, Classes, TypInfo, Variants;
type
TBla = class(TPersistent)
private
fBool: Boolean;
fint: integer;
published
property Bool: Boolean read fBool write fBool;
property int: integer read fint write fint;
end;
begin
try
{ delphi gives a range error here, also if range checking is off }
SetPropValue(TBla.Create, 'Bool', 2);
except on ERangeError do
halt(0);
end;
halt(1);
end.