Author: gert
Date: 2007-11-21 17:20:54 -0500 (Wed, 21 Nov 2007)
New Revision: 90112

Added:
   trunk/gert/standalone/bug343459/
   trunk/gert/standalone/bug343459/default.build
   trunk/gert/standalone/bug343459/test.cs
   trunk/gert/standalone/bug343459/test.exe.config
Log:
Added test for bug #343459.


Added: trunk/gert/standalone/bug343459/default.build
===================================================================
--- trunk/gert/standalone/bug343459/default.build       2007-11-21 21:49:07 UTC 
(rev 90111)
+++ trunk/gert/standalone/bug343459/default.build       2007-11-21 22:20:54 UTC 
(rev 90112)
@@ -0,0 +1,51 @@
+<project name="bug343459" 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="../../build/common/Assert.cs" />
+                               <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/bug343459/default.build
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/gert/standalone/bug343459/test.cs
===================================================================
--- trunk/gert/standalone/bug343459/test.cs     2007-11-21 21:49:07 UTC (rev 
90111)
+++ trunk/gert/standalone/bug343459/test.cs     2007-11-21 22:20:54 UTC (rev 
90112)
@@ -0,0 +1,44 @@
+using System;
+using System.Configuration;
+
+using MyApp.Windows.Forms.Properties;
+
+class Program
+{
+       static void Main ()
+       {
+               Settings settings = Settings.Default;
+               Assert.IsNotNull (settings.Server, "#1");
+               Assert.AreEqual ("home", settings.Server, "#2");
+               Assert.IsNull (settings.Properties ["User"], "#3");
+               Assert.IsNull (settings.Properties ["ConfigureOnRun"], "#4");
+               Assert.IsNull (settings.Properties ["AutoLogin"], "#5");
+               Assert.AreEqual (1, settings.Properties.Count, "#6");
+       }
+}
+
+namespace MyApp.Windows.Forms.Properties
+{
+       internal sealed partial class Settings : ApplicationSettingsBase
+       {
+               private static Settings defaultInstance = ((Settings)
+                       (ApplicationSettingsBase.Synchronized (new Settings 
())));
+
+               public static Settings Default {
+                       get {
+                               return defaultInstance;
+                       }
+               }
+
+               [UserScopedSettingAttribute]
+               [DefaultSettingValueAttribute ("localhost")]
+               public string Server {
+                       get {
+                               return ((string) (this ["Server"]));
+                       }
+                       set {
+                               this ["Server"] = value;
+                       }
+               }
+       }
+}


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

Added: trunk/gert/standalone/bug343459/test.exe.config
===================================================================
--- trunk/gert/standalone/bug343459/test.exe.config     2007-11-21 21:49:07 UTC 
(rev 90111)
+++ trunk/gert/standalone/bug343459/test.exe.config     2007-11-21 22:20:54 UTC 
(rev 90112)
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+<configuration>
+       <configSections>
+               <sectionGroup name="userSettings" 
type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, 
Culture=neutral, PublicKeyToken=b77a5c561934e089">
+                       <section
+                               name="MyApp.Windows.Forms.Properties.Settings"
+                               
type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, 
Culture=neutral, PublicKeyToken=b77a5c561934e089"
+                               allowExeDefinition="MachineToLocalUser"
+                               requirePermission="false" />
+               </sectionGroup>
+               <section name="log4net" 
type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
+       </configSections>
+       <userSettings>
+               <MyApp.Windows.Forms.Properties.Settings>
+                       <setting name="AutoLogin" serializeAs="String">
+                               <value>False</value>
+                       </setting>
+                       <setting name="Server" serializeAs="String">
+                               <value>home</value>
+                       </setting>
+                       <setting name="User" serializeAs="String">
+                               <value>admin</value>
+                       </setting>
+                       <setting name="ConfigureOnRun" serializeAs="String">
+                               <value>False</value>
+                       </setting>
+               </MyApp.Windows.Forms.Properties.Settings>
+       </userSettings>
+</configuration>


Property changes on: trunk/gert/standalone/bug343459/test.exe.config
___________________________________________________________________
Name: svn:eol-style
   + native

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

Reply via email to