<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2016-07-19 5:47 GMT-03:00 Michael Van Canneyt <span dir="ltr"><<a href="mailto:michael@freepascal.org" target="_blank">michael@freepascal.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class=""><div class="h5"><br>
<br>
On Tue, 19 Jul 2016, Dimitrios Chr. Ioannidis wrote:<br><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
    Exception class:   EAssertionFailedError<br>
    Exception message: "Correct extended value" expected: <5,67> but was: <6><br>
        at   $0043241F  TTESTJSONDESTREAMER__TESTFLOAT4,  line 374 of testjsonrtti.pp<br>
</blockquote>
<br></div></div>
I am aware of this.<br>
<br>
However, this is only on i386, on 64-bit the code runs fine.<br>
I have no idea why, the code should be CPU agnostic.<br>
<br>
I have not yet had the opportunity to debug it on a i386 machine.<span class=""><font color="#888888"><br></font></span></blockquote><div><br></div><div>I just looked at it in this weekend.<br><br></div><div>After doing some tests and reading the docs i realized that is not a bug in fpjsonrtti, nor a bug at all.<br><br></div><div>First write directly 4.56 to the property (of comp type). Reading it directly gives a rounded value (5)<br></div><div><br></div>Than i read the docs:<br><a href="http://www.freepascal.org/docs-html/ref/refsu6.html">http://www.freepascal.org/docs-html/ref/refsu6.html</a><br>"The Comp type is, in effect, a 64-bit integer and is not available on all target platforms. To get more information on the supported types for each platform, refer to the Programmer’s Guide. "<br><br><a href="http://www.freepascal.org/docs-html/prog/progsu160.html#x204-2130008.2.5">http://www.freepascal.org/docs-html/prog/progsu160.html#x204-2130008.2.5</a><br>"Comp<br><br>For Intel 80x86 processors, the comp type contains a 63-bit integral value, and a sign bit (in the MSB position). The comp type uses 8 bytes of storage space.<br><br>On other processors, the comp type is not supported.<br>"<br><br></div><div class="gmail_quote">It works in 64bit cpu because is testing other code:<br><br>{$ifdef CPUX86_64}<br>    AssertProp('ExtendedProp',TJSONFloat(5));<br>  {$else}<br>    AssertProp('ExtendedProp',4.56);<br>  {$endif}    <br><br></div><div class="gmail_quote">Luiz<br></div></div></div>