XE8, DUnit and 4.0.12 issue

delphi package - automated exception handling
Post Reply
MH
Posts: 5
Joined: Wed Jun 17, 2009 11:31 am

XE8, DUnit and 4.0.12 issue

Post by MH »

Trying to compile an existing DUnit test project failed in TestFramework.pas on line 3210.
The StackTrace method is to be called there and it looks like the parameters got expanded
so that the params 4-6 are all pointers now. DUnit fails to comply with this.

Is there any solution available from the MadExcept side?
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Re: XE8, DUnit and 4.0.12 issue

Post by madshi »

I've no experience with DUnit. How does the exact code line look like which the compiler complains about now?
MH
Posts: 5
Joined: Wed Jun 17, 2009 11:31 am

Re: XE8, DUnit and 4.0.12 issue

Post by MH »

Code: Select all

function TTestFailure.CaptureStackTrace(ThrownException: Exception; ThrownExceptionAddress: Pointer): string;
{$IFDEF USE_JEDI_JCL}
var
  Trace: TStrings;
{$ENDIF}
begin
{$IFDEF CLR}
  Result := thrownException.StackTrace;
{$ELSE}
{$IFDEF USE_JEDI_JCL}
  Trace := TStringList.Create;
  try
    JclDebug.JclLastExceptStackListToStrings(Trace, true);
    Result := Trace.Text;
  finally
    Trace.Free;
  end;
{$ELSE}
 Auskommentiert, da Parameter des StackTrace Aufrufs in MadExcept 4.0.12 anders sind
{$IFDEF madExcept}
  Result := madStackTrace.StackTrace( false, false, false, nil,
                                           ThrownExceptionAddress, false,
                                           false, 0, 0, nil,
                                           @ThrownExceptionAddress );
{$ELSE}
  Result := '';
{$ENDIF madExcept}
{$ENDIF USE_JEDI_JCL}
{$ENDIF CLR}
end;
I also filed a Quality Portal issue:
https://quality.embarcadero.com/browse/RSP-11253
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Re: XE8, DUnit and 4.0.12 issue

Post by madshi »

Just add one additional "nil" after the first "nil", I think that should fix the compiler complaint. madExcept 4 added an additional parameter there. Might not have been a good idea, I have to admit now. I should have placed the new parameter at the end of the function... :?
degoo
Posts: 1
Joined: Thu Aug 06, 2015 11:17 am

Re: XE8, DUnit and 4.0.12 issue

Post by degoo »

Hi,
I'm Diego Navarro, an Embarcadero RTL developer, please, send me a private message to contact and fix this issue properly on our TestFramework, I need more info about this interface change and when was introduced.
Thanks!!
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Re: XE8, DUnit and 4.0.12 issue

Post by madshi »

I've replied via email.
Post Reply