Browse Source

--- Merging r19908 into '.':
U packages/fcl-fpcunit/src/DUnitCompatibleInterface.inc

# revisions: 19908
------------------------------------------------------------------------
r19908 | joost | 2011-12-29 16:44:19 +0100 (Thu, 29 Dec 2011) | 1 line
Changed paths:
M /trunk/packages/fcl-fpcunit/src/DUnitCompatibleInterface.inc

* Added more Delphi-compatibility wrappers
------------------------------------------------------------------------

git-svn-id: branches/fixes_2_6@20042 -

marco 13 years ago
parent
commit
268bf41487
1 changed files with 9 additions and 2 deletions
  1. 9 2
      packages/fcl-fpcunit/src/DUnitCompatibleInterface.inc

+ 9 - 2
packages/fcl-fpcunit/src/DUnitCompatibleInterface.inc

@@ -20,8 +20,9 @@
     class procedure CheckIs(obj :TObject; pClass: TClass; msg: string = ''); overload;
     class procedure CheckIs(obj :TObject; pClass: TClass; msg: string = ''); overload;
     class procedure CheckSame(expected, actual: TObject; msg: string = ''); overload;
     class procedure CheckSame(expected, actual: TObject; msg: string = ''); overload;
     class procedure FailNotEquals(expected, actual: string; msg: string = ''; errorAddr: Pointer = nil); virtual;
     class procedure FailNotEquals(expected, actual: string; msg: string = ''; errorAddr: Pointer = nil); virtual;
-    class procedure CheckTrue(condition: Boolean; msg: string);
-    class procedure CheckFalse(condition: Boolean; msg: string);
+    class procedure CheckTrue(condition: Boolean; msg: string = '');
+    class procedure CheckFalse(condition: Boolean; msg: string = '');
+    class procedure CheckException(AMethod: TRunMethod; AExceptionClass: ExceptClass; msg: string = '');
     class function  EqualsErrorMessage(const expected, actual: string; const ErrorMsg: string): string;
     class function  EqualsErrorMessage(const expected, actual: string; const ErrorMsg: string): string;
     class function  NotEqualsErrorMessage(const expected, actual: string; const ErrorMsg: string): string;
     class function  NotEqualsErrorMessage(const expected, actual: string; const ErrorMsg: string): string;
 
 
@@ -158,6 +159,12 @@ begin
       FailNotEquals(BoolToStr(false, true), BoolToStr(true, true), msg, nil);
       FailNotEquals(BoolToStr(false, true), BoolToStr(true, true), msg, nil);
 end;
 end;
 
 
+
+class procedure TAssert.CheckException(AMethod: TRunMethod; AExceptionClass: ExceptClass; msg: string = '');
+begin
+  AssertException(msg, AExceptionClass, AMethod);
+end;
+
 class function TAssert.EqualsErrorMessage(const expected, actual: string;
 class function TAssert.EqualsErrorMessage(const expected, actual: string;
     const ErrorMsg: string): string;
     const ErrorMsg: string): string;
 begin
 begin