[fpc-pascal] Testing if exception raised in fpcUnit

Graeme Geldenhuys graeme at geldenhuys.co.uk
Mon Nov 5 14:03:22 CET 2012


On 2012-11-05 12:49, ik wrote:
> 
> So how do I do it ?

Create a method of the test class, and pass that to AssertException.

Alternatively, do it manually as follows:

  try
    si.SetSlideName('001~z~1~a~4~d~1.1.2.swf');
    si.SlideTypeDB;
  except
    on E: exception do
    begin
      CheckEquals(EUnknownSlideType.ClassName, E.ClassName, 'Failing on 2');
    end;
  end;


Regards,
  - Graeme -




More information about the fpc-pascal mailing list