소스 검색

Move getting error address / only execute when needed

Martin 2 달 전
부모
커밋
3a89160739
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      packages/fcl-fpcunit/src/fpcunit.pp

+ 4 - 4
packages/fcl-fpcunit/src/fpcunit.pp

@@ -1387,8 +1387,6 @@ class procedure TAssert.AssertException(const AMessage: string; const AFormatArg
 var
   Msg,FailMsg : string;
 begin
-  If AErrorAddr=Nil then
-    AErrorAddr:=CallerAddr;
   FailMsg:='';
   try
     AMethod;
@@ -1414,6 +1412,8 @@ begin
   end;
   if aMessage<>'' then
     Msg:=Format(AMessage, AFormatArgs) + ': '+Msg;
+  If AErrorAddr=Nil then
+    AErrorAddr:=CallerAddr;
   Fail(Msg, AErrorAddr);
 end;
 
@@ -1486,8 +1486,6 @@ var
   Msg,FailMsg : string;
 
 begin
-  If AErrorAddr=Nil then
-    AErrorAddr:=CallerAddr;
   FailMsg:='';
   try
     AMethod;
@@ -1513,6 +1511,8 @@ begin
   end;
   if aMessage<>'' then
     Msg:=Format(AMessage, AFormatArgs) + ': '+Msg;
+  If AErrorAddr=Nil then
+    AErrorAddr:=CallerAddr;
   Fail(Msg, AErrorAddr);
 end;