2009-01-07 Rodrigo Kumpera <rkumpera@novell.com>
authorRodrigo Kumpera <kumpera@gmail.com>
Wed, 7 Jan 2009 17:06:18 +0000 (17:06 -0000)
committerRodrigo Kumpera <kumpera@gmail.com>
Wed, 7 Jan 2009 17:06:18 +0000 (17:06 -0000)
* bug-459094.cs: New regression test.

* Makefile.am: Test added.

svn path=/trunk/mono/; revision=122675

mono/tests/ChangeLog
mono/tests/Makefile.am
mono/tests/bug-459094.cs [new file with mode: 0644]

index e80f37360ced1503bb5ba4b5e7471d7c0e8ec397..b1bb4b4e479cb5747e7e164fc9854d9f3008f083 100644 (file)
@@ -1,3 +1,9 @@
+2009-01-07 Rodrigo Kumpera  <rkumpera@novell.com>
+
+       * bug-459094.cs: New regression test.
+
+       * Makefile.am: Test added.
+
 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
 
        * bug-462592.cs: New regression test.
index 0ca1958b4cd85723d98ae3f4e6ce3e3fc4921d94..3182a2ba87854c470f88f5eff149cc33531ff42d 100644 (file)
@@ -333,7 +333,8 @@ BASE_TEST_CS_SRC=           \
        bug-461941.cs   \
        bug-461261.cs   \
        bug-400716.cs   \
-       bug-462592.cs
+       bug-462592.cs   \
+       bug-459094.cs
 
 if AMD64
 TEST_CS_SRC = $(BASE_TEST_CS_SRC) async-exc-compilation.cs
diff --git a/mono/tests/bug-459094.cs b/mono/tests/bug-459094.cs
new file mode 100644 (file)
index 0000000..5d0362c
--- /dev/null
@@ -0,0 +1,35 @@
+using System;\r
+using System.IO;\r
+
+class Driver
+{
+       static int Main ()
+       {
+               string step = "abcde12345abcde12345abcde12345abcde12345";
+               string expected = Directory.GetCurrentDirectory();
+               string current = "";
+               /*if (Directory.Exists (step)) FIXME this doesn't work on linux 
+                       Directory.Delete (step, true);*/
+
+               try {
+                       for (int i = 0; i < 4000; ++i) {
+                               current = Directory.GetCurrentDirectory ();
+                               if (!current.Equals (expected)) {
+                                       Console.WriteLine ("expected dir {0} but got {1}", expected, current);
+                                       return 1;
+                               }
+                               Console.WriteLine("I={0} DIR={1}",i,Directory.GetCurrentDirectory().Length);
+                               Directory.CreateDirectory (step);
+                               Directory.SetCurrentDirectory (step);
+                               expected += Path.DirectorySeparatorChar + step;
+                       }
+               } catch (PathTooLongException) {
+                       Console.WriteLine ("ok, got PathTooLongException");
+                       return 0;
+               }
+
+               Console.WriteLine ("Max path not reached");
+               return 2;
+       }
+}
+