{"action":"created","issue":{"url":"https://api.github.com/repos/VSoftTechnologies/Delphi-Mocks/issues/25","labels_url":"https://api.github.com/repos/VSoftTechnologies/Delphi-Mocks/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/VSoftTechnologies/Delphi-Mocks/issues/25/comments","events_url":"https://api.github.com/repos/VSoftTechnologies/Delphi-Mocks/issues/25/events","html_url":"https://github.com/VSoftTechnologies/Delphi-Mocks/issues/25","id":29847338,"number":25,"title":"Problem with mock in Win64 mode.","user":{"login":"asiwon","id":6987684,"avatar_url":"https://avatars.githubusercontent.com/u/6987684?v=3","gravatar_id":"","url":"https://api.github.com/users/asiwon","html_url":"https://github.com/asiwon","followers_url":"https://api.github.com/users/asiwon/followers","following_url":"https://api.github.com/users/asiwon/following{/other_user}","gists_url":"https://api.github.com/users/asiwon/gists{/gist_id}","starred_url":"https://api.github.com/users/asiwon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asiwon/subscriptions","organizations_url":"https://api.github.com/users/asiwon/orgs","repos_url":"https://api.github.com/users/asiwon/repos","events_url":"https://api.github.com/users/asiwon/events{/privacy}","received_events_url":"https://api.github.com/users/asiwon/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/VSoftTechnologies/Delphi-Mocks/labels/Rtti%20bug","name":"Rtti bug","color":"e10c02"},{"url":"https://api.github.com/repos/VSoftTechnologies/Delphi-Mocks/labels/TVirtualInterface%20bug","name":"TVirtualInterface bug","color":"e102d8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2014-03-20T18:55:13Z","updated_at":"2015-03-12T04:25:08Z","closed_at":null,"body":"Hello,\r\n\r\nI have problem with using mocks in code compiled to Win64 platform. I wrote small example app which shows wrong values returned by mock:\r\n\r\n  unit Unit1;\r\n\r\n    interface\r\n\r\n    uses\r\n      Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,\r\n      Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;\r\n\r\n    type\r\n      TForm1 = class(TForm)\r\n        Button1: TButton;\r\n        procedure Button1Click(Sender: TObject);\r\n      private\r\n        function TestDouble: Double;\r\n        { Private declarations }\r\n      public\r\n        { Public declarations }\r\n      end;\r\n\r\n      ITest = interface(IInvokable)\r\n        ['{DE3ACD58-A748-4528-A2A6-13C7A9247DB2}']\r\n        function GetDate: TDateTime;\r\n        property Date: TDateTime read GetDate;\r\n      end;\r\n\r\n    var\r\n      Form1: TForm1;\r\n\r\n    implementation\r\n\r\n    uses\r\n      Delphi.Mocks;\r\n\r\n    {$R *.dfm}\r\n\r\n    procedure TForm1.Button1Click(Sender: TObject);\r\n    var\r\n      mock: TMock<ITest>;\r\n      test: ITest;\r\n    begin\r\n      mock := TMock<ITest>.Create;\r\n      mock.Setup.WillReturn(Date).When.GetDate;\r\n      Button1.Tag := Trunc(TestDouble);\r\n      test := mock;\r\n      Button1.Caption := DateToStr(test.GetDate);\r\n    end;\r\n\r\n    function TForm1.TestDouble: Double;\r\n    begin\r\n      Result := 123;\r\n    end;\r\n\r\nAfter execution of the  Button1Click procedure caption of the button is changed to wrong value (1900-05-02 value 123 in date format) when app is compiled for Win64 platform. When application is compiled for Win32 platform value is correct (current date). I think this is not Delphi Mocks related problem but TVirtualInterface related problem. Maybe it is corrected in newer version of Delphi. I'm using Delphi XE4 Pro."},"comment":{"url":"https://api.github.com/repos/VSoftTechnologies/Delphi-Mocks/issues/comments/78421921","html_url":"https://github.com/VSoftTechnologies/Delphi-Mocks/issues/25#issuecomment-78421921","issue_url":"https://api.github.com/repos/VSoftTechnologies/Delphi-Mocks/issues/25","id":78421921,"user":{"login":"HoracioFilho","id":6182310,"avatar_url":"https://avatars.githubusercontent.com/u/6182310?v=3","gravatar_id":"","url":"https://api.github.com/users/HoracioFilho","html_url":"https://github.com/HoracioFilho","followers_url":"https://api.github.com/users/HoracioFilho/followers","following_url":"https://api.github.com/users/HoracioFilho/following{/other_user}","gists_url":"https://api.github.com/users/HoracioFilho/gists{/gist_id}","starred_url":"https://api.github.com/users/HoracioFilho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HoracioFilho/subscriptions","organizations_url":"https://api.github.com/users/HoracioFilho/orgs","repos_url":"https://api.github.com/users/HoracioFilho/repos","events_url":"https://api.github.com/users/HoracioFilho/events{/privacy}","received_events_url":"https://api.github.com/users/HoracioFilho/received_events","type":"User","site_admin":false},"created_at":"2015-03-12T04:25:08Z","updated_at":"2015-03-12T04:25:08Z","body":"@vincentparrett @asiwon Bugs related to TVirtualInterface and TVirtualMethodInterceptor were fixed in XE6 according http://qc.embarcadero.com/wc/qcmain.aspx?d=102627 and http://qc.embarcadero.com/wc/qcmain.aspx?d=99028 :D"}}