Hello Michael,
Finally, I also found the original testcomps.pp file in the sources (and
at the sime time I discovered a limitation of the Windows 7 file search
tool, which was why I did not find the file before).
As indicated below, the version that comes with the sources is not complete.
I modified testcomps.pp so that the tests fully compile with the stable
fpc 2.4.4 version.
It is attached here, I hope it helps.
Thank you for this json library !
Best regards,
Stephane
On 18/11/2011 15:30, Stephane Carre wrote:
Thank you Michael.
I checked before in the fpc source 2.4.4 download available from
sourceforge, but could not find testcomps anywhere.
The version you attached does not contain TVariantComponent. Is that a
newer, or older version than the one that should match fpc 2.4.4 ?
Otherwise I guess I can adapt the missing pieces.
Best regards,
Stephane
On 18/11/2011 13:17, Michael Van Canneyt wrote:
It is attached.
It is committed, but probably not where you expected it :-)
Michael.
unit testcomps;
interface
uses classes, sysutils;
Type
TEmptyPersistent = class(TPersistent);
TBooleanComponent = class(TComponent)
private
FBooleanProp: boolean;
published
property BooleanProp: boolean read FBooleanProp write FBooleanProp;
end;
TVariantComponent = class(TComponent)
private
FVariantProp: variant;
published
property VariantProp: variant read FVariantProp write FVariantProp;
end;
TStringsComponent = class(TComponent)
private
FStringsProp: TStrings;
Public
Constructor Create(AOwner : TComponent); override;
Destructor Destroy; override;
Published
Property StringsProp : TStrings Read FStringsProp Write FStringsProp;
end;
TEmptyComponent = Class(TComponent)
end;
// Simple integer, fits in 1 byte
TIntegerComponent = Class(TComponent)
private
FIntProp: Integer;
Public
Constructor Create(AOwner : TComponent); override;
Published
Property IntProp : Integer Read FIntProp Write FIntProp;
end;
// Simple integer, fits in 2 bytes
TIntegerComponent2 = Class(TComponent)
private
FIntProp: Integer;
Public
Constructor Create(AOwner : TComponent); override;
Published
Property IntProp : Integer Read FIntProp Write FIntProp;
end;
// Simple integer, fits in 3 bytes
TIntegerComponent3 = Class(TComponent)
private
FIntProp: Integer;
Public
Constructor Create(AOwner : TComponent); override;
Published
Property IntProp : Integer Read FIntProp Write FIntProp;
end;
// Simple integer, Default value. (set)
TIntegerComponent4 = Class(TComponent)
private
FIntProp: Integer;
Public
Constructor Create(AOwner : TComponent); override;
Published
Property IntProp : Integer Read FIntProp Write FIntProp default 6;
end;
// Simple integer, Default value. (not set)
TIntegerComponent5 = Class(TComponent)
private
FIntProp: Integer;
Public
Constructor Create(AOwner : TComponent); override;
Published
Property IntProp : Integer Read FIntProp Write FIntProp default 6;
end;
// Simple Int64 property fits in a single byte.
TInt64Component = Class(TComponent)
private
FIntProp: Int64;
Public
Constructor Create(AOwner : TComponent); override;
Published
Property Int64Prop : Int64 Read FIntProp Write FIntProp;
end;
// Simple Int64 property fits 2 bytes.
TInt64Component2 = Class(TComponent)
private
FIntProp: Int64;
Public
Constructor Create(AOwner : TComponent); override;
Published
Property Int64Prop : Int64 Read FIntProp Write FIntProp;
end;
// Simple Int64 property fits 3 bytes.
TInt64Component3 = Class(TComponent)
private
FIntProp: Int64;
Public
Constructor Create(AOwner : TComponent); override;
Published
Property Int64Prop : Int64 Read FIntProp Write FIntProp;
end;
// Simple Int64 property fits 4 bytes.
TInt64Component4 = Class(TComponent)
private
FIntProp: Int64;
Public
Constructor Create(AOwner : TComponent); override;
Published
Property Int64Prop : Int64 Read FIntProp Write FIntProp;
end;
// Int64 property with default, set.
TInt64Component5 = Class(TComponent)
private
FIntProp: Int64;
Public
Constructor Create(AOwner : TComponent); override;
Published
Property Int64Prop : Int64 Read FIntProp Write FIntProp default 7;
end;
// Int64 property with default, not set.
TInt64Component6 = Class(TComponent)
private
FIntProp: Int64;
Public
Constructor Create(AOwner : TComponent); override;
Published
Property Int64Prop : Int64 Read FIntProp Write FIntProp default 7;
end;
// String property.
TStringComponent = Class(TComponent)
private
F: String;
Public
Constructor Create(AOwner : TComponent); override;
Published
Property StringProp : String Read F Write F;
end;
// String property, empty
TStringComponent2 = Class(TComponent)
private
F: String;
Published
Property