From 1844ff4c013878dfcb7a76409386dd5a6e67f8ee Mon Sep 17 00:00:00 2001 From: joost Date: Sun, 10 Oct 2010 10:52:54 +0000 Subject: [PATCH] * Improved safecall test. Added code to test parameter-values git-svn-id: trunk@16120 - --- tests/test/tsafecall3.pp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/test/tsafecall3.pp b/tests/test/tsafecall3.pp index db9ac92102..b351d369e7 100644 --- a/tests/test/tsafecall3.pp +++ b/tests/test/tsafecall3.pp @@ -10,6 +10,8 @@ function SafecallProcedureAlias(AParam1,AParam2: integer):HRESULT; {$IFDEF windo procedure SafecallProcedure(AParam1,AParam2: integer); safecall; [public, alias: '_SAFECALLPROCEDURE']; var i,j: double; begin + if (AParam1<>$123456) or (AParam2<>$654321) then + halt(1); i := 1; j := 0; // division by zero, but no exception should be raised. Instead the function @@ -20,6 +22,8 @@ end; function SafecallFunctionAlias(AParam1,AParam2: integer; out _result: string):HRESULT; {$IFDEF windows}stdcall{$ELSE}cdecl{$ENDIF}; [external name '_SAFECALLFUNCTION']; function SafecallFunction(AParam1,AParam2: integer): string; safecall; [public, alias: '_SAFECALLFUNCTION']; begin + if (AParam1<>$123456) or (AParam2<>$654321) then + halt(2); raise exception.create('Ignore and return non-zero'); end; @@ -28,8 +32,8 @@ var begin if SafecallProcedureAlias($123456,$654321) = 0 then - halt(1); + halt(11); if SafecallFunctionAlias($123456,$654321,s) = 0 then - halt(2); + halt(12); end.