View Issue Details

IDProjectCategoryView StatusLast Update
0030878FPCPackagespublic2016-11-10 12:58
ReporterLuiz AmericoAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product VersionProduct Build 
Target Version3.2.0Fixed in Version3.1.1 
Summary0030878: Fix false negative in json tests
DescriptionPatch attached
See reasoning at: http://lists.freepascal.org/pipermail/fpc-devel/2016-July/037224.html
TagsNo tags attached.
Fixed in Revision
FPCOldBugId0
FPCTarget
Attached Files
  • fix-json-tests.diff (1,473 bytes)
    diff --git packages/fcl-json/tests/testcomps.pp packages/fcl-json/tests/testcomps.pp
    index d4dbea2..7398cb9 100644
    --- packages/fcl-json/tests/testcomps.pp
    +++ packages/fcl-json/tests/testcomps.pp
    @@ -191,7 +191,7 @@ Type
       Public
         Constructor Create(AOwner : TComponent);  override;
       Published
    -    Property ExtendedProp : Comp Read F Write F;
    +    Property CompProp : Comp Read F Write F;
       end;
     
       // Currency property
    diff --git packages/fcl-json/tests/testjsonrtti.pp packages/fcl-json/tests/testjsonrtti.pp
    index e066ad1..09d8ee3 100644
    --- packages/fcl-json/tests/testjsonrtti.pp
    +++ packages/fcl-json/tests/testjsonrtti.pp
    @@ -366,12 +366,8 @@ Var
     
     begin
       B:=TCompComponent.Create(Nil);
    -  DeStream('{ "ExtendedProp" : 5.67 }',B);
    -{$ifdef CPUX86_64}
    -  AssertEquals('Correct comp value',round(5.67),B.ExtendedProp);
    -{$else}
    -  AssertEquals('Correct extended value',5.67,B.ExtendedProp);
    -{$endif}
    +  DeStream('{ "CompProp" : 5.67 }',B);
    +  AssertEquals('Correct comp value',round(5.67),B.CompProp);
     end;
     
     procedure TTestJSONDeStreamer.TestFloat5;
    @@ -876,12 +872,7 @@ procedure TTestJSONStreamer.TestWriteFloat4;
     begin
       StreamObject(TCompComponent.Create(Nil));
       AssertPropCount(1);
    -  // Extended is correct, propname is wrong
    -  {$ifdef CPUX86_64}
    -    AssertProp('ExtendedProp',TJSONFloat(5));
    -  {$else}
    -    AssertProp('ExtendedProp',4.56);
    -  {$endif}
    +  AssertProp('CompProp',5);
     end;
     
     procedure TTestJSONStreamer.TestWriteFloat5;
    
    fix-json-tests.diff (1,473 bytes)

Activities

Luiz Americo

2016-11-07 00:55

developer  

fix-json-tests.diff (1,473 bytes)
diff --git packages/fcl-json/tests/testcomps.pp packages/fcl-json/tests/testcomps.pp
index d4dbea2..7398cb9 100644
--- packages/fcl-json/tests/testcomps.pp
+++ packages/fcl-json/tests/testcomps.pp
@@ -191,7 +191,7 @@ Type
   Public
     Constructor Create(AOwner : TComponent);  override;
   Published
-    Property ExtendedProp : Comp Read F Write F;
+    Property CompProp : Comp Read F Write F;
   end;
 
   // Currency property
diff --git packages/fcl-json/tests/testjsonrtti.pp packages/fcl-json/tests/testjsonrtti.pp
index e066ad1..09d8ee3 100644
--- packages/fcl-json/tests/testjsonrtti.pp
+++ packages/fcl-json/tests/testjsonrtti.pp
@@ -366,12 +366,8 @@ Var
 
 begin
   B:=TCompComponent.Create(Nil);
-  DeStream('{ "ExtendedProp" : 5.67 }',B);
-{$ifdef CPUX86_64}
-  AssertEquals('Correct comp value',round(5.67),B.ExtendedProp);
-{$else}
-  AssertEquals('Correct extended value',5.67,B.ExtendedProp);
-{$endif}
+  DeStream('{ "CompProp" : 5.67 }',B);
+  AssertEquals('Correct comp value',round(5.67),B.CompProp);
 end;
 
 procedure TTestJSONDeStreamer.TestFloat5;
@@ -876,12 +872,7 @@ procedure TTestJSONStreamer.TestWriteFloat4;
 begin
   StreamObject(TCompComponent.Create(Nil));
   AssertPropCount(1);
-  // Extended is correct, propname is wrong
-  {$ifdef CPUX86_64}
-    AssertProp('ExtendedProp',TJSONFloat(5));
-  {$else}
-    AssertProp('ExtendedProp',4.56);
-  {$endif}
+  AssertProp('CompProp',5);
 end;
 
 procedure TTestJSONStreamer.TestWriteFloat5;
fix-json-tests.diff (1,473 bytes)

Michael Van Canneyt

2016-11-09 22:22

administrator   ~0095726

Applied and tested, thanks for the patch!

Issue History

Date Modified Username Field Change
2016-11-07 00:55 Luiz Americo New Issue
2016-11-07 00:55 Luiz Americo File Added: fix-json-tests.diff
2016-11-07 08:11 Michael Van Canneyt Assigned To => Michael Van Canneyt
2016-11-07 08:11 Michael Van Canneyt Status new => assigned
2016-11-09 22:22 Michael Van Canneyt Note Added: 0095726
2016-11-09 22:22 Michael Van Canneyt Status assigned => resolved
2016-11-09 22:22 Michael Van Canneyt Fixed in Version => 3.1.1
2016-11-09 22:22 Michael Van Canneyt Resolution open => fixed
2016-11-09 22:22 Michael Van Canneyt Target Version => 3.2.0
2016-11-10 12:58 Luiz Americo Status resolved => closed