mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-03 09:30:35 +02:00
* 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:
parent
174a2686f7
commit
b43404964c
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -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
21
tests/webtbs/tw9347.pp
Normal 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
27
tests/webtbs/tw9347a.pp
Normal 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.
|
Loading…
Reference in New Issue
Block a user