* Patch from Graeme Geldenhuys to move FailNotEquals to main interface

git-svn-id: trunk@30315 -
This commit is contained in:
michael 2015-03-24 13:40:56 +00:00
parent 1f868aac8b
commit e227d76b7d
2 changed files with 6 additions and 7 deletions

View File

@ -21,7 +21,6 @@
class procedure CheckNotNull(obj: IUnknown; msg: string = ''); overload; virtual;
class procedure CheckIs(obj :TObject; pClass: TClass; 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 CheckTrue(condition: Boolean; msg: string = '');
class procedure CheckFalse(condition: Boolean; msg: string = '');
class procedure CheckException(AMethod: TRunMethod; AExceptionClass: ExceptClass; msg: string = '');
@ -153,12 +152,6 @@ begin
AssertSame(msg, expected, actual);
end;
class procedure TAssert.FailNotEquals(expected, actual: string; msg: string;
errorAddr: Pointer);
begin
Fail(msg + ComparisonMsg(Expected, Actual));
end;
class procedure TAssert.CheckTrue(condition: Boolean; msg: string);
begin
if (not condition) then

View File

@ -81,6 +81,7 @@ type
public
class procedure Fail(const AMessage: string; AErrorAddrs: Pointer = nil);
class procedure Fail(const AFmt: string; Args : Array of const; AErrorAddrs: Pointer = nil);
class procedure FailNotEquals(const expected, actual: string; const ErrorMsg: string = ''; AErrorAddrs: Pointer = nil);
class procedure AssertTrue(const AMessage: string; ACondition: boolean); overload;
class procedure AssertTrue(ACondition: boolean); overload;
class procedure AssertFalse(const AMessage: string; ACondition: boolean); overload;
@ -529,6 +530,11 @@ begin
raise EAssertionFailedError.CreateFmt(AFmt,Args) at AErrorAddrs;
end;
class procedure TAssert.FailNotEquals(const expected, actual: string; const ErrorMsg: string; AErrorAddrs: Pointer);
begin
Fail(NotEqualsErrorMessage(expected, actual, ErrorMsg), AErrorAddrs);
end;
class procedure TAssert.AssertTrue(const AMessage: string; ACondition: boolean);
begin