2004-02-14 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mono / tests / stream.cs
index 0636c8dc0d2a8440777de3defc110d815b785233..d3314381c00091ae965642534e7a78f7228d0892 100755 (executable)
@@ -4,9 +4,19 @@ using System.IO;
 public class Test {
 
        public static int Main () {
-               FileStream s = new FileStream ("/tmp/stest.dat", FileMode.Create);
-               
-               
+               byte[] buf = new byte [20];
+               int i;
+               FileStream s = new FileStream ("stest.dat", FileMode.OpenOrCreate, FileAccess.ReadWrite);
+               for (i=0; i < 20; ++i)
+                       buf [i] = 65;
+               s.Write (buf, 0, 20);
+               s.Position = 0;
+               for (i=0; i < 20; ++i)
+                       buf [i] = 66;
+               s.Read (buf, 0, 20);
+               for (i=0; i < 20; ++i)
+                       if (buf [i] != 65)
+                               return 1;
                
                return 0;
        }