Przeglądaj źródła

fix for different results message

svn path=/trunk/mcs/; revision=48160
Andrew Skiba 20 lat temu
rodzic
commit
03f871414b

+ 7 - 3
mcs/class/System.XML/Test/System.Xml.Xsl/standalone_tests/ChangeLog

@@ -1,16 +1,20 @@
-2004-07-06  Andrew Skiba  <[email protected]>
+2005-08-09  Andrew Skiba  <[email protected]>
+
+	* xslttest.cs: fix the different results message
+
+2005-07-06  Andrew Skiba  <[email protected]>
 
 	* Makefile, xslttest.cs: convert to be executed from NUnit
 	* XsltTestUtils.cs, generate.cs: added
 	* fixme.lst: update with currently failing tests
 
-2004-06-28  Andrew Skiba  <[email protected]>
+2005-06-28  Andrew Skiba  <[email protected]>
 
 	* Makefile: touch file, not directory, doh!
 	* fixme.lst: added
 	* knownFailures: remove fixed testcases
 
-2004-06-09  Andrew Skiba  <[email protected]>
+2005-06-09  Andrew Skiba  <[email protected]>
 
 	* Makefile, catalog-fixed.diff : Patch the fixed catalog to correct things 
 	I could not fix with sed script

+ 17 - 6
mcs/class/System.XML/Test/System.Xml.Xsl/standalone_tests/xslttest.cs

@@ -102,17 +102,28 @@ namespace MonoTests.oasis_xslt {
 			Categories = arr;
 		}
 
+		static string EscapeString (string res)
+		{
+			MemoryStream s = new MemoryStream ();
+			XmlTextWriter w = new XmlTextWriter (s, System.Text.Encoding.ASCII);
+			w.WriteString (res);
+			w.Close ();	
+			
+			StringBuilder sb = new StringBuilder (res.Length);
+			byte [] arr = s.ToArray ();
+			foreach (byte b in arr)
+				sb.Append (Convert.ToChar (b));
+
+			return sb.ToString ();
+		}
+
 		string CompareResult (string actual, string expected)
 		{
 			//TODO: add xml comparison
 			if (actual == expected)
 				return null;
-			else
-#if !FAILURE_DETAILED_MESSAGE
-				return "Different.";
-#else
-				return "Different.\nActual*****\n"+actual+"\nReference*****\n"+expected;
-#endif
+			string res = "Different.\nActual*****\n"+actual+"\nReference*****\n"+expected;
+			return EscapeString (res);
 		}
 
 		string CompareException (Exception actual, string testid)