~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

Viewing changes to fpcsrc/tests/test/units/system/tpi.pp

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
{ this tests the pi routine, as an inline }
 
2
program tpi;
 
3
 
 
4
const
 
5
 PI_CONST = 3.1459;
 
6
 { the following expression also works on constants }
 
7
 PI_CONST_VALUE = pi;
 
8
 
 
9
 procedure fail;
 
10
  begin
 
11
    WriteLn('Failed!');
 
12
    halt(1);
 
13
  end;
 
14
 
 
15
var
 
16
 value : real;
 
17
 _result : boolean;
 
18
Begin
 
19
  Write('Pi() test...');
 
20
  _result := true;
 
21
  value:=pi;
 
22
  if trunc(value) <> trunc(PI_CONST) then
 
23
     _result := false;
 
24
  If trunc(Pi) <> trunc(PI_CONST) then
 
25
     _result := false;
 
26
  If trunc(Pi) <> trunc(PI_CONST_VALUE) then
 
27
     _result := false;
 
28
  if not _result then
 
29
     fail;
 
30
  WriteLn('Success!');
 
31
end.