summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/webtbs/tw13512.pp
blob: 5e73c4bc21afefe0d5b64723736f0dd6ebdca9ed (plain)
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
{$mode objfpc}

Program BCDTest;

Uses SysUtils;

var
  gotexcept: boolean;
Begin
    WriteLn (BCDToInt ($1234)); { should retuen 1234 }
    if (BCDToInt ($1234)) <> 1234 then
      halt(1);

    gotexcept:=false;
    try
      WriteLn (BCDToInt ($A0));   { Invalid value }
    except
      gotexcept:=true;
    end;
    if not gotexcept then
      halt(1);

    WriteLn (BCDToInt ($7D));   { should return -7 }
    if (BCDToInt ($7D)) <> -7 then
      halt(2);
End.