Author: gert
Date: 2007-08-28 13:36:25 -0400 (Tue, 28 Aug 2007)
New Revision: 84965

Added:
   trunk/gert/standalone/bug82428/
   trunk/gert/standalone/bug82428/default.build
   trunk/gert/standalone/bug82428/test.cs
   trunk/gert/standalone/bug82498/
   trunk/gert/standalone/bug82498/default.build
   trunk/gert/standalone/bug82498/test1.cs
   trunk/gert/standalone/bug82498/test2.cs
   trunk/gert/standalone/bug82595/
   trunk/gert/standalone/bug82595/default.build
   trunk/gert/standalone/bug82595/test.cs
Modified:
   trunk/gert/standalone/known-issues
Log:
Added more tests.


Added: trunk/gert/standalone/bug82428/default.build
===================================================================
--- trunk/gert/standalone/bug82428/default.build        2007-08-28 17:01:29 UTC 
(rev 84964)
+++ trunk/gert/standalone/bug82428/default.build        2007-08-28 17:36:25 UTC 
(rev 84965)
@@ -0,0 +1,59 @@
+<project name="bug82428" default="rebuild">
+       <target name="mono-1.0">
+               <property name="csc.defines" 
value="NET_1_0,NET_1_1,ONLY_1_1,MONO" />
+       </target>
+
+       <target name="mono-2.0">
+               <property name="csc.defines" 
value="NET_1_0,NET_1_1,NET_2_0,ONLY_2_0,MONO" />
+       </target>
+
+       <target name="net-1.1">
+               <property name="csc.defines" value="NET_1_0,NET_1_1,ONLY_1_1" />
+       </target>
+
+       <target name="net-2.0">
+               <property name="csc.defines" 
value="NET_1_0,NET_1_1,NET_2_0,ONLY_2_0" />
+       </target>
+
+       <property name="frameworks" value="mono-1.0,mono-2.0,net-1.1,net-2.0" />
+
+       <target name="clean">
+               <delete>
+                       <fileset>
+                               <include name="encrypt.tmp" />
+                               <include name="out" />
+                               <include name="test.exe" />
+                       </fileset>
+               </delete>
+       </target>
+
+       <target name="build">
+               <property name="original.targetframework" 
value="${nant.settings.currentframework}" />
+
+               <foreach property="framework" item="String" in="${frameworks}" 
delim=",">
+                       <if test="${framework::exists(framework)}">
+                               <property name="nant.settings.currentframework" 
value="${framework}" />
+                               <call 
target="${nant.settings.currentframework}" />
+                               <call target="run" />
+                               <call target="clean" />
+                       </if>
+               </foreach>
+
+               <property name="nant.settings.currentframework" 
value="${original.targetframework}" />
+       </target>
+
+       <target name="compile">
+               <csc target="exe" define="${csc.defines}" output="test.exe" 
warnaserror="true" warninglevel="4">
+                       <sources>
+                               <include name="test.cs" />
+                       </sources>
+               </csc>
+       </target>
+
+       <target name="run" depends="compile">
+               <exec program="test.exe" managed="true" output="out" />
+               <fail if="${file::exists('out')}" />
+       </target>
+
+       <target name="rebuild" depends="clean, build" />
+</project>


Property changes on: trunk/gert/standalone/bug82428/default.build
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/gert/standalone/bug82428/test.cs
===================================================================
--- trunk/gert/standalone/bug82428/test.cs      2007-08-28 17:01:29 UTC (rev 
84964)
+++ trunk/gert/standalone/bug82428/test.cs      2007-08-28 17:36:25 UTC (rev 
84965)
@@ -0,0 +1,43 @@
+using System;
+using System.IO;
+using System.Security.Cryptography;
+using System.Runtime.Serialization;
+using System.Runtime.Serialization.Formatters.Binary;
+
+class Program
+{
+       static int Main ()
+       {
+               string filename = Path.Combine 
(AppDomain.CurrentDomain.BaseDirectory,
+                       "encrypt.tmp");
+               string data = "this is sensitive data";
+
+               DESCryptoServiceProvider des = new DESCryptoServiceProvider ();
+               des.GenerateIV ();
+               des.GenerateKey ();
+
+               // -----------  WRITING ENCRYPTED SERIALIZED DATA 
------------------
+               Stream stream = new FileStream (filename, FileMode.Create, 
FileAccess.Write);
+               stream = new CryptoStream (stream, des.CreateEncryptor (), 
CryptoStreamMode.Write);
+               BinaryFormatter bformatter = new BinaryFormatter ();
+               bformatter.Serialize (stream, data);
+               stream.Close ();
+
+               stream = null;
+               bformatter = null;
+               data = string.Empty;
+
+               // -----------  READING ENCRYPTED SERIALIZED DATA 
------------------
+               stream = new FileStream (filename, FileMode.Open, 
FileAccess.Read);
+               stream = new CryptoStream (stream, des.CreateDecryptor (), 
CryptoStreamMode.Read);
+               bformatter = new BinaryFormatter ();
+               data = (string) bformatter.Deserialize (stream);
+               stream.Close ();
+
+               //----------- CHECK RESULTS ----------------
+               if (data != "this is sensitive data")
+                       return 1;
+
+               return 0;
+       }
+}


Property changes on: trunk/gert/standalone/bug82428/test.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/gert/standalone/bug82498/default.build
===================================================================
--- trunk/gert/standalone/bug82498/default.build        2007-08-28 17:01:29 UTC 
(rev 84964)
+++ trunk/gert/standalone/bug82498/default.build        2007-08-28 17:36:25 UTC 
(rev 84965)
@@ -0,0 +1,58 @@
+<project name="bug82498" default="rebuild">
+       <target name="mono-2.0">
+               <property name="csc.defines" 
value="NET_1_0,NET_1_1,NET_2_0,ONLY_2_0,MONO" />
+       </target>
+
+       <target name="net-2.0">
+               <property name="csc.defines" 
value="NET_1_0,NET_1_1,NET_2_0,ONLY_2_0" />
+       </target>
+
+       <property name="frameworks" value="mono-2.0,net-2.0" />
+
+       <target name="clean">
+               <delete>
+                       <fileset>
+                               <include name="out" />
+                               <include name="test1.exe" />
+                               <include name="test2.exe" />
+                       </fileset>
+               </delete>
+       </target>
+
+       <target name="build">
+               <property name="original.targetframework" 
value="${nant.settings.currentframework}" />
+
+               <foreach property="framework" item="String" in="${frameworks}" 
delim=",">
+                       <if test="${framework::exists(framework)}">
+                               <property name="nant.settings.currentframework" 
value="${framework}" />
+                               <call 
target="${nant.settings.currentframework}" />
+                               <call target="run" />
+                               <call target="clean" />
+                       </if>
+               </foreach>
+
+               <property name="nant.settings.currentframework" 
value="${original.targetframework}" />
+       </target>
+
+       <target name="compile">
+               <csc target="exe" define="${csc.defines}" output="test1.exe" 
warnaserror="true" warninglevel="4">
+                       <sources>
+                               <include name="test1.cs" />
+                       </sources>
+               </csc>
+               <csc target="exe" define="${csc.defines}" output="test2.exe" 
warnaserror="true" warninglevel="4">
+                       <sources>
+                               <include name="test2.cs" />
+                       </sources>
+               </csc>
+       </target>
+
+       <target name="run" depends="compile">
+               <exec program="test1.exe" managed="true" output="out" />
+               <fail if="${file::exists('out')}">#1</fail>
+               <exec program="test2.exe" managed="true" output="out" />
+               <fail if="${file::exists('out')}">#2</fail>
+       </target>
+
+       <target name="rebuild" depends="clean, build" />
+</project>


Property changes on: trunk/gert/standalone/bug82498/default.build
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/gert/standalone/bug82498/test1.cs
===================================================================
--- trunk/gert/standalone/bug82498/test1.cs     2007-08-28 17:01:29 UTC (rev 
84964)
+++ trunk/gert/standalone/bug82498/test1.cs     2007-08-28 17:36:25 UTC (rev 
84965)
@@ -0,0 +1,28 @@
+using System;
+
+public abstract class BusinessBase<TYPE, KEY> where TYPE : BusinessBase<TYPE, 
KEY>, new ()
+{
+       public static void Load (KEY id)
+       {
+               TYPE instance = new TYPE ();
+               instance = instance.DataSelect (id);
+       }
+
+       protected abstract TYPE DataSelect (KEY id);
+}
+
+public class Page : BusinessBase<Page, Guid>
+{
+       protected override Page DataSelect (Guid k)
+       {
+               return new Page ();
+       }
+}
+
+class D
+{
+       static void Main ()
+       {
+               Page.Load (new Guid ());
+       }
+}


Property changes on: trunk/gert/standalone/bug82498/test1.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/gert/standalone/bug82498/test2.cs
===================================================================
--- trunk/gert/standalone/bug82498/test2.cs     2007-08-28 17:01:29 UTC (rev 
84964)
+++ trunk/gert/standalone/bug82498/test2.cs     2007-08-28 17:36:25 UTC (rev 
84965)
@@ -0,0 +1,28 @@
+using System;
+
+public abstract class BusinessBase<TYPE> where TYPE : BusinessBase<TYPE>, new 
()
+{
+       public static void Load<KEY> (KEY id)
+       {
+               TYPE instance = new TYPE ();
+               instance = instance.DataSelect<KEY> (id);
+       }
+
+       protected abstract TYPE DataSelect<KEY> (KEY id);
+}
+
+public class Page : BusinessBase<Page>
+{
+       protected override Page DataSelect<Guid> (Guid k)
+       {
+               return new Page ();
+       }
+}
+
+class D
+{
+       static void Main ()
+       {
+               Page.Load<Guid> (new Guid ());
+       }
+}


Property changes on: trunk/gert/standalone/bug82498/test2.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/gert/standalone/bug82595/default.build
===================================================================
--- trunk/gert/standalone/bug82595/default.build        2007-08-28 17:01:29 UTC 
(rev 84964)
+++ trunk/gert/standalone/bug82595/default.build        2007-08-28 17:36:25 UTC 
(rev 84965)
@@ -0,0 +1,53 @@
+<project name="bug82595" default="rebuild">
+       <target name="mono-2.0">
+               <property name="csc.defines" 
value="NET_1_0,NET_1_1,NET_2_0,ONLY_2_0,MONO" />
+       </target>
+
+       <target name="net-2.0">
+               <property name="csc.defines" 
value="NET_1_0,NET_1_1,NET_2_0,ONLY_2_0" />
+       </target>
+
+       <property name="frameworks" value="mono-2.0,net-2.0" />
+
+       <target name="clean">
+               <delete>
+                       <fileset>
+                               <include name="out" />
+                               <include name="test.exe" />
+                       </fileset>
+               </delete>
+       </target>
+
+       <target name="build">
+               <property name="original.targetframework" 
value="${nant.settings.currentframework}" />
+
+               <foreach property="framework" item="String" in="${frameworks}" 
delim=",">
+                       <if test="${framework::exists(framework)}">
+                               <property name="nant.settings.currentframework" 
value="${framework}" />
+                               <call 
target="${nant.settings.currentframework}" />
+                               <call target="run" />
+                               <call target="clean" />
+                       </if>
+               </foreach>
+
+               <property name="nant.settings.currentframework" 
value="${original.targetframework}" />
+       </target>
+
+       <target name="compile">
+               <csc target="exe" define="${csc.defines}" output="test.exe" 
warnaserror="true" warninglevel="4">
+                       <sources>
+                               <include name="test.cs" />
+                       </sources>
+               </csc>
+       </target>
+
+       <target name="run" depends="compile">
+               <exec program="test.exe" managed="true" 
resultproperty="test.result" output="out" failonerror="false" />
+               <fail if="${int::parse(test.result) == 0}">#1</fail>
+               <fail unless="${file::exists('out')}">#2</fail>
+               <loadfile file="out" property="out" />
+               <fail unless="${string::index-of(out,'Unhandled Exception: 
System.TypeLoadException: Context-bound objects with generic methods are not 
supported.') != -1}">#3</fail>
+       </target>
+
+       <target name="rebuild" depends="clean, build" />
+</project>


Property changes on: trunk/gert/standalone/bug82595/default.build
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/gert/standalone/bug82595/test.cs
===================================================================
--- trunk/gert/standalone/bug82595/test.cs      2007-08-28 17:01:29 UTC (rev 
84964)
+++ trunk/gert/standalone/bug82595/test.cs      2007-08-28 17:36:25 UTC (rev 
84965)
@@ -0,0 +1,14 @@
+using System;
+
+class C : ContextBoundObject
+{
+       public virtual T Q<T> (T t)
+       {
+               return t;
+       }
+
+       static void Main ()
+       {
+//                     new C ();
+       }
+}


Property changes on: trunk/gert/standalone/bug82595/test.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/gert/standalone/known-issues
===================================================================
--- trunk/gert/standalone/known-issues  2007-08-28 17:01:29 UTC (rev 84964)
+++ trunk/gert/standalone/known-issues  2007-08-28 17:36:25 UTC (rev 84965)
@@ -74,5 +74,7 @@
 bug82443/**
 bug82461/**
 bug82465/**
+bug82498/**
 bug82545/**
 bug82550/**
+bug82595/**

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to