Explorar o código

* reverting incorrect part of previous commit

git-svn-id: branches/fixes_2_0@1986 -
Tomas Hajny %!s(int64=20) %!d(string=hai) anos
pai
achega
380cab6046
Modificáronse 2 ficheiros con 33 adicións e 8 borrados
  1. 6 6
      fv/test/testapp.pas
  2. 27 2
      fv/test/tfileio.pas

+ 6 - 6
fv/test/testapp.pas

@@ -45,9 +45,9 @@ PROGRAM TestApp;
      {$ifdef TEST}
      AsciiTab,
      {$endif TEST}
-     { $ifdef DEBUG
+     {$ifdef DEBUG}
      Gfvgraph,
-     $endif DEBUG}
+     {$endif DEBUG}
      Gadgets, TimedDlg, MsgBox;
 
 
@@ -122,7 +122,7 @@ Var
 {$endif DEBUG}
 begin
   inherited Idle;
-{ $ifdef DEBUG
+{$ifdef DEBUG}
    if WriteDebugInfo then
      begin
       WasSet:=true;
@@ -131,13 +131,13 @@ begin
    else
       WasSet:=false;
    if WriteDebugInfo then
-$endif DEBUG}
+{$endif DEBUG}
   Clock^.Update;
   Heap^.Update;
-{ $ifdef DEBUG
+{$ifdef DEBUG}
    if WasSet then
      WriteDebugInfo:=true;
-$endif DEBUG}
+{$endif DEBUG}
   if Desktop^.FirstThat(@IsTileable) <> nil then
     EnableCommands([cmTile, cmCascade])
   else

+ 27 - 2
fv/test/tfileio.pas

@@ -1,2 +1,27 @@
-begin
-end.
+USES
+  FVCommon,FileIO;
+
+VAR
+  Handle : THandle;
+  buf    : ARRAY[0..255] OF CHAR;
+  n      : LongWord;
+BEGIN
+  Handle := FileOpen(AsciiZ('test'), fa_Create);
+  writeln('FileOpen: ',Handle);
+
+  buf := 'Test'#0;
+  writeln('FileWrite: ', FileWrite(handle, Buf, 5, n));
+  writeln('Bytes written: ', n);
+
+  Writeln('SetFileSize: ', SetFileSize(handle, 4));
+
+  Writeln('SetFilePos: ', SetFilePos(handle, 2, 0, (LongInt(n))));
+  Writeln('Actual: ', n);
+
+  Writeln('FileRead: ', FileRead(Handle, buf, 2, n) );
+  Writeln('Actual: ', n);
+
+  Writeln('Buf[0]=', Buf[0], ' Buf[1]=', Buf[1]);
+
+  Writeln('FileClose: ', FileClose(Handle));
+END.