I am showing the stack trace in DUnit using JCLDebug ( Click here for more information). See stack trace below.
The stack trace shows all calls up to the function calling the actual function causing the error. Line 238 of ConvertScriptTestU calls another function called "GetDataLine" (which is not in the stack trace), which then calls IntToStr (which causes EConvertError). Why doesn't stack trace enable GetDataLine?
This stack trace is much less useful, since I still need to figure out which line in GetDataLine raises EConvertError.
I use DUnit here, but I saw the same thing as when using JclDebug outside of DUnit.
[ANSWER]
Just add this line to the project file:
JCLdebug.JclStackTrackingOptions:=[stStack, stRawMode];
Includes "Raw Mode". You may need to configure some compiler options (for example, "create stack frames")
[/ANSWER]
TestConversion: EConvertError
at SysUtils:0 SysUtils.ConvertErrorFmt$00414A7E
'''' is not a valid integer value
StackTrace
[00414A79]{ConvertDataTests.exe} SysUtils.ConvertErrorFmt
[007E2699]{ConvertDataTests.exe} ConvertScriptTestU.ConvertDataTest.WriteDataToFile (Line 238, "ConvertDataTestU.pas")
[007E2198]{ConvertDataTests.exe} ConvertScriptTestU.ConvertDataTest.TestConversion (Line 164, "ConvertDataTestU.pas")
[0053C66E]{ConvertDataTests.exe} TestFramework.TTestCase.RunTest (Line 2380, "TestFrameWork.pas")
[00537DBA]{ConvertDataTests.exe} TestFramework.TTestResult.RunTestRun (Line 1199, "TestFrameWork.pas")
[00538078]{ConvertDataTests.exe} TestFramework.TTestResult.Run (Line 1275, "TestFrameWork.pas")
[0053963A]{ConvertDataTests.exe} TestFramework.TAbstractTest.RunWithFixture (Line 1723, "TestFrameWork.pas")
[0053C4DD]{ConvertDataTests.exe} TestFramework.TTestCase.RunWithFixture (Line 2363, "TestFrameWork.pas")
source
share