Browse Source

* Modified test to not create sub-dirs outside the test's directory.

git-svn-id: trunk@39864 -
yury 6 years ago
parent
commit
46b89f0ef9
1 changed files with 10 additions and 6 deletions
  1. 10 6
      tests/test/units/system/tdir.pp

+ 10 - 6
tests/test/units/system/tdir.pp

@@ -5,7 +5,7 @@
 { This program shoulf not be executed in a root directory }
 { Creates the following directory, and sets it as the     }
 { current directory.                                      }
-{    ../testdir                                           }
+{       testdir                                           }
 
 { %skiptarget=wince }
 
@@ -24,12 +24,11 @@ end;
 
 
 var
- s: string;
+ s, old_dir: string;
 Begin
-   Write('changing to parent directory...');
-   chdir('..');
-   test(IOResult, 0);
-   WriteLn('Passed!');
+   WriteLn('getting current directory...');
+   getdir(0,old_dir);
+   WriteLn(old_dir);
 
    Write('making directory...');
    mkdir('testdir');
@@ -94,4 +93,9 @@ Begin
    WriteLn('getting current directory...');
    getdir(0,s);
    WriteLn(s);
+   if s<>old_dir then
+     begin
+       WriteLn('Invalid current dir: ', s);
+       Halt(2);
+     end;
 end.