File: testerrorhandler.pas

package info (click to toggle)
lazarus 3.6%2Bdfsg1-4~bpo12%2B1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-backports
  • size: 252,956 kB
  • sloc: pascal: 2,078,443; xml: 457,059; makefile: 323,038; cpp: 93,064; sh: 3,463; java: 609; perl: 297; sql: 222; ansic: 137
file content (40 lines) | stat: -rw-r--r-- 741 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
unit TestErrorHandler;

{$mode objfpc}{$H+}

interface

uses
  FpDbgDwarf, FpDbgUtil, FpErrorMessages, TestHelperClasses, {$ifdef FORCE_LAZLOGGER_DUMMY} LazLoggerDummy {$else} LazLoggerBase {$endif}, LazUTF8,
  DbgIntfBaseTypes, sysutils, fpcunit, testregistry;

type

  { TTestMemManager }

  { TTestErrorHandler }

  TTestErrorHandler = class(TTestCase)
  published
    procedure TestErrorHandler;
  end;

implementation

{ TTestErrorHandler }

procedure TTestErrorHandler.TestErrorHandler;
var
  e: TFpError;
  e2: TFpError;
begin
  e := CreateError(fpErrSymbolNotFound_p, ['a', '']);
  e2 := CreateError(fpErrLocationParserMemRead, e, []);
  ErrorHandler.ErrorAsString(e2);
end;

initialization
  RegisterTest(TTestErrorHandler);

end.