Explorar o código

2002-05-15 Nick Drochak <[email protected]>

	* StreamReaderTest.cs:
	* StreamWriterTest.cs:
	Make sure invalid file name has invalid characters in it.  These are
	platform dependant.

svn path=/trunk/mcs/; revision=4627
Nick Drochak %!s(int64=24) %!d(string=hai) anos
pai
achega
94205af0d6

+ 7 - 0
mcs/class/corlib/Test/System.IO/ChangeLog

@@ -1,3 +1,10 @@
+2002-05-15  Nick Drochak  <[email protected]>
+
+	* StreamReaderTest.cs: 
+	* StreamWriterTest.cs: 
+	Make sure invalid file name has invalid characters in it.  These are 
+	platform dependant.
+
 2002-05-14  Nick Drochak  <[email protected]>
 
 	* FileTest.cs: Delete temporary files after each test method; Catch

+ 3 - 3
mcs/class/corlib/Test/System.IO/StreamReaderTest.cs

@@ -116,7 +116,7 @@ public class StreamReaderTest : TestCase
 		{
 			bool errorThrown = false;
 			try {
-				StreamReader r = new StreamReader("!$what? what? Huh? !$*#");
+				StreamReader r = new StreamReader("!$what? what? Huh? !$*#" + Path.InvalidPathChars[0]);
 			} catch (IOException) {
 				errorThrown = true;
 			} catch (ArgumentException) {
@@ -255,7 +255,7 @@ public class StreamReaderTest : TestCase
 		{
 			bool errorThrown = false;
 			try {
-				StreamReader r = new StreamReader("!$what? what? Huh? !$*#", false);
+				StreamReader r = new StreamReader("!$what? what? Huh? !$*#" + Path.InvalidPathChars[0], false);
 			} catch (IOException) {
 				errorThrown = true;
 			} catch (ArgumentException) {
@@ -320,7 +320,7 @@ public class StreamReaderTest : TestCase
 		{
 			bool errorThrown = false;
 			try {
-				StreamReader r = new StreamReader("!$what? what? Huh? !$*#", true);
+				StreamReader r = new StreamReader("!$what? what? Huh? !$*#" + Path.InvalidPathChars[0], true);
 			} catch (IOException) {
 				errorThrown = true;
 			} catch (ArgumentException) {

+ 6 - 6
mcs/class/corlib/Test/System.IO/StreamWriterTest.cs

@@ -112,7 +112,7 @@ public class StreamWriterTest : TestCase
 		{
 			bool errorThrown = false;
 			try {
-				StreamWriter r = new StreamWriter("!$what? what? Huh? !$*#");
+				StreamWriter r = new StreamWriter("!$what? what? Huh? !$*#" + Path.InvalidPathChars[0]);
 			} catch (IOException) {
 				errorThrown = true;
 			} catch (ArgumentException) {
@@ -122,7 +122,7 @@ public class StreamWriterTest : TestCase
 			} catch (Exception e) {
 				Fail ("Incorrect exception thrown at 4: " + e.ToString());
 			}
-			Assert("invalid filename error not thrown", errorThrown);
+			Assert("1 invalid filename error not thrown", errorThrown);
 		}
 		// TODO - Security/Auth exceptions
 		{
@@ -168,7 +168,7 @@ public class StreamWriterTest : TestCase
 		{
 			bool errorThrown = false;
 			try {
-				StreamWriter r = new StreamWriter("!$what? what? Huh? !$*#", false);
+				StreamWriter r = new StreamWriter("!$what? what? Huh? !$*#" + Path.InvalidPathChars[0], false);
 			} catch (IOException) {
 				errorThrown = true;
 			} catch (ArgumentException) {
@@ -178,7 +178,7 @@ public class StreamWriterTest : TestCase
 			} catch (Exception e) {
 				Fail ("Incorrect exception thrown at 4: " + e.ToString());
 			}
-			Assert("invalid filename error not thrown", errorThrown);
+			Assert("2 invalid filename error not thrown", errorThrown);
 		}
 		{
 			StreamWriter r = new StreamWriter(_codeFileName, false);
@@ -221,7 +221,7 @@ public class StreamWriterTest : TestCase
 		{
 			bool errorThrown = false;
 			try {
-				StreamWriter r = new StreamWriter("!$what? what? Huh? !$*#", true);
+				StreamWriter r = new StreamWriter("!$what? what? Huh? !$*#" + Path.InvalidPathChars[0], true);
 			} catch (IOException) {
 				errorThrown = true;
 			} catch (ArgumentException) {
@@ -231,7 +231,7 @@ public class StreamWriterTest : TestCase
 			} catch (Exception e) {
 				Fail ("Incorrect exception thrown at 8: " + e.ToString());
 			}
-			Assert("invalid filename error not thrown", errorThrown);
+			Assert("3 invalid filename error not thrown", errorThrown);
 		}
 		{
 			try {