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

« back to all changes in this revision

Viewing changes to fpcsrc/tests/test/units/system/tdir.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
{ Program to test OS-specific features of the system unit }
 
2
{ routines to test:                                       }
 
3
{   mkdir()                                               }
 
4
{   chdir()                                               }
 
5
{ This program shoulf not be executed in a root directory }
 
6
{ Creates the following directory, and sets it as the     }
 
7
{ current directory.                                      }
 
8
{    ../testdir                                           }
 
9
 
 
10
{ %skiptarget=wince }
 
11
 
 
12
Program tdir;
 
13
{$I-}
 
14
 
 
15
procedure test(value, required: longint);
 
16
begin
 
17
  if value <> required then
 
18
    begin
 
19
      writeln('Got ',value,' instead of ',required);
 
20
      halt(1);
 
21
    end;
 
22
end;
 
23
 
 
24
 
 
25
 
 
26
var
 
27
 s: string;
 
28
Begin
 
29
   Write('changing to parent directory...');
 
30
   chdir('..');
 
31
   test(IOResult, 0);
 
32
   WriteLn('Passed!');
 
33
 
 
34
   Write('making directory...');
 
35
   mkdir('testdir');
 
36
   test(IOResult, 0);
 
37
   WriteLn('Passed!');
 
38
 
 
39
   Write('going into the newly created directory...');
 
40
   chdir('testdir');
 
41
   test(IOResult, 0);
 
42
   WriteLn('Passed!');
 
43
 
 
44
   Write('making directory...');
 
45
   mkdir('testdir2');
 
46
   test(IOResult, 0);
 
47
   WriteLn('Passed!');
 
48
 
 
49
   Write('removing directory ...');
 
50
   rmdir('testdir2');
 
51
   test(IOResult, 0);
 
52
   WriteLn('Passed!');
 
53
 
 
54
 
 
55
   Write('going directory up ...');
 
56
   chdir('..');
 
57
   test(IOResult, 0);
 
58
   WriteLn('Passed!');
 
59
 
 
60
   Write('removing directory ...');
 
61
   rmdir('testdir');
 
62
   test(IOResult, 0);
 
63
   WriteLn('Passed!');
 
64
 
 
65
   WriteLn('getting current directory...');
 
66
   getdir(0,s);
 
67
   WriteLn(s);
 
68
end.