Author: mritvik
Date: 2005-04-05 01:28:55 -0400 (Tue, 05 Apr 2005)
New Revision: 42548
Added:
trunk/mcs/mbas/Test/errors/AttributesArguments1.vb
trunk/mcs/mbas/Test/errors/AttributesArguments2.vb
trunk/mcs/mbas/Test/errors/AttributesArguments3.vb
trunk/mcs/mbas/Test/errors/AttributesArguments4.vb
trunk/mcs/mbas/Test/errors/AttributesClassC1.vb
trunk/mcs/mbas/Test/errors/AttributesClassUseA1.vb
trunk/mcs/mbas/Test/errors/AttributesClassUseADate1.vb
trunk/mcs/mbas/Test/errors/AttributesClassUseADecimal1.vb
trunk/mcs/mbas/Test/errors/AttributesClassUseNoSingle1.vb
trunk/mcs/mbas/Test/errors/AttributesMustInheritClassA1.vb
trunk/mcs/mbas/Test/errors/TypeValRefVoidA1.vb
trunk/mcs/mbas/Test/rerrors/Scope1.vb
trunk/mcs/mbas/Test/tests/attributes/AttributesClassA.vb
trunk/mcs/mbas/Test/tests/attributes/AttributesClassB.vb
trunk/mcs/mbas/Test/tests/attributes/AttributesClassBothSuffixA.vb
trunk/mcs/mbas/Test/tests/attributes/AttributesClassC.vb
trunk/mcs/mbas/Test/tests/attributes/AttributesClassNoparameterA.vb
trunk/mcs/mbas/Test/tests/attributes/AttributesClassUseA.vb
trunk/mcs/mbas/Test/tests/attributes/AttributesClassUseB.vb
trunk/mcs/mbas/Test/tests/attributes/AttributesClassUseC.vb
trunk/mcs/mbas/Test/tests/attributes/AttributesClassUseD.vb
trunk/mcs/mbas/Test/tests/attributes/AttributesNewA.vb
trunk/mcs/mbas/Test/tests/attributes/AttributesNewB.vb
trunk/mcs/mbas/Test/tests/attributes/ChangeLog
trunk/mcs/mbas/Test/tests/types/ChangeLog
trunk/mcs/mbas/Test/tests/types/TypeObjectA.vb
trunk/mcs/mbas/Test/tests/types/TypeStructureA.vb
trunk/mcs/mbas/Test/tests/types/TypeValRefA.vb
trunk/mcs/mbas/Test/tests/types/TypeValRefArrayA.vb
trunk/mcs/mbas/Test/tests/types/TypeValRefB.vb
trunk/mcs/mbas/Test/tests/types/TypeValRefC.vb
trunk/mcs/mbas/Test/tests/types/TypeValRefStringA.vb
trunk/mcs/mbas/Test/tests/types/TypeValRefVoidA1.vb
Modified:
trunk/mcs/mbas/Test/errors/ChangeLog
trunk/mcs/mbas/Test/tests/ChangeLog
Log:
In tests/attributes:
2005-04-05 Ritvik Mayank <[EMAIL PROTECTED]>
* AttributesClassNoparameterA.vb
* AttributesClassA.vb
* AttributesClassB.vb
* AttributesClassBothSuffixA.vb
* AttributesClassC.vb
* AttributesClassUseA.vb
* AttributesClassUseB.vb
* AttributesClassUseC.vb
* AttributesClassUseD.vb
* AttributesNewA.vb
* AttributesNewB.vb
Added the above test cases
2005-04-04 Ritvik Mayank <[EMAIL PROTECTED]>
* Moved all the Attribute Test Cases to this folder
In tests:
2005-04-04 Ritvik Mayank <[EMAIL PROTECTED]>
* Moved the test cases to respective directories
In errors:
2005-04-05 Ritvik Mayank <[EMAIL PROTECTED]>
* AttributesMustInheritClassA1.vb
* AttributesClassC1.vb
* AttributesArguments1.vb
* AttributesClassUseADecimal1.vb
* AttributesClassUseADate1.vb
* AttributesArguments2.vb
* AttributesArguments3.vb
* AttributesClassUseNoSingle1.vb
* AttributesArguments4.vb
* TypeValRefVoidA1.vb
* AttributesClassUseA1.vb
Added the above test cases
2005-04-04 Ritvik Mayank <[EMAIL PROTECTED]>
Moved All the 'types' Test Cases to this directory
In tests/types:
2005-04-05 Ritvik Mayank <[EMAIL PROTECTED]>
* TypeValRefStringA.vb
* TypeValRefArrayA.vb
* TypeValRefC.vb
* TypeValRefB.vb
* TypeValRefVoidA1.vb
* TypeObjectA.vb
* TypeValRefA.vb
* TypeStructureA.vb
Added the above Test Cases
Added: trunk/mcs/mbas/Test/errors/AttributesArguments1.vb
===================================================================
--- trunk/mcs/mbas/Test/errors/AttributesArguments1.vb 2005-04-05 05:19:03 UTC
(rev 42547)
+++ trunk/mcs/mbas/Test/errors/AttributesArguments1.vb 2005-04-05 05:28:55 UTC
(rev 42548)
@@ -0,0 +1,33 @@
+REM LineNo: 21
+REM ExpectedError: BC30060
+REM ErrorMessage: Conversion from 'Integer' to 'String' cannot occur in a
constant expression.
+
+Imports System
+<AttributeUsage(AttributeTargets.All)> _
+Public Class GeneralAttribute
+ Inherits Attribute
+ Public Sub New(ByVal x As string)
+ End Sub
+ Public y As Type
+ Public Property z As Integer
+ Get
+ End Get
+ Set
+ End Set
+ End Property
+End Class
+
+
+<General(10, z := 30, y := GetType(Integer))> _
+Class Foo
+End Class
+
+<General(10.5, z := 10)> _
+Class Bar
+End Class
+
+
+Module Test
+Sub Main ()
+End Sub
+End Module
\ No newline at end of file
Property changes on: trunk/mcs/mbas/Test/errors/AttributesArguments1.vb
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/mcs/mbas/Test/errors/AttributesArguments2.vb
===================================================================
--- trunk/mcs/mbas/Test/errors/AttributesArguments2.vb 2005-04-05 05:19:03 UTC
(rev 42547)
+++ trunk/mcs/mbas/Test/errors/AttributesArguments2.vb 2005-04-05 05:28:55 UTC
(rev 42548)
@@ -0,0 +1,34 @@
+REM LineNo: 22
+REM ExpectedError: BC30390
+REM ErrorMessage: 'GeneralAttribute.Private Sub New(x As Integer)' is not
accessible in this context because it is 'Private'.
+
+
+Imports System
+<AttributeUsage(AttributeTargets.All)> _
+Public Class GeneralAttribute
+ Inherits Attribute
+ Private Sub New(ByVal x As Integer)
+ End Sub
+ Public y As Type
+ Public Property z As Integer
+ Get
+ End Get
+ Set
+ End Set
+ End Property
+End Class
+
+
+<General(10, z := 30, y := GetType(Integer))> _
+Class Foo
+End Class
+
+<General(10.5, z := 10)> _
+Class Bar
+End Class
+
+
+Module Test
+Sub Main ()
+End Sub
+End Module
\ No newline at end of file
Property changes on: trunk/mcs/mbas/Test/errors/AttributesArguments2.vb
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/mcs/mbas/Test/errors/AttributesArguments3.vb
===================================================================
--- trunk/mcs/mbas/Test/errors/AttributesArguments3.vb 2005-04-05 05:19:03 UTC
(rev 42547)
+++ trunk/mcs/mbas/Test/errors/AttributesArguments3.vb 2005-04-05 05:28:55 UTC
(rev 42548)
@@ -0,0 +1,33 @@
+REM LineNo: 21
+REM ExpectedError: BC30455
+REM ErrorMessage: Argument not specified for parameter 'y' of 'Public Sub
New(x As Integer, y As Decimal)
+
+Imports System
+<AttributeUsage(AttributeTargets.All)> _
+Public Class GeneralAttribute
+ Inherits Attribute
+ Public Sub New(ByVal x As Integer,ByVal y As decimal )
+ End Sub
+ Public y As Type
+ Public Property z As Integer
+ Get
+ End Get
+ Set
+ End Set
+ End Property
+End Class
+
+
+<General(10, z := 30, y := GetType(Integer))> _
+Class Foo
+End Class
+
+<General(10.5, z := 10)> _
+Class Bar
+End Class
+
+
+Module Test
+Sub Main ()
+End Sub
+End Module
\ No newline at end of file
Property changes on: trunk/mcs/mbas/Test/errors/AttributesArguments3.vb
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/mcs/mbas/Test/errors/AttributesArguments4.vb
===================================================================
--- trunk/mcs/mbas/Test/errors/AttributesArguments4.vb 2005-04-05 05:19:03 UTC
(rev 42547)
+++ trunk/mcs/mbas/Test/errors/AttributesArguments4.vb 2005-04-05 05:28:55 UTC
(rev 42548)
@@ -0,0 +1,24 @@
+REM LineNo: 15
+REM ExpectedError: BC30661
+REM ErrorMessage: Field or property 'z' is not found.
+
+Imports System
+<AttributeUsage(AttributeTargets.All)> _
+Public Class GeneralAttribute
+ Inherits Attribute
+ Public Sub New(ByVal A As Type)
+ End Sub
+ Public y As Type
+End Class
+
+
+<General(GetType(GeneralAttribute), z := 10)> _
+Class Bar
+End Class
+
+
+Module Test
+ Sub Main ()
+ Dim x
+ End Sub
+End Module
\ No newline at end of file
Property changes on: trunk/mcs/mbas/Test/errors/AttributesArguments4.vb
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/mcs/mbas/Test/errors/AttributesClassC1.vb
===================================================================
--- trunk/mcs/mbas/Test/errors/AttributesClassC1.vb 2005-04-05 05:19:03 UTC
(rev 42547)
+++ trunk/mcs/mbas/Test/errors/AttributesClassC1.vb 2005-04-05 05:28:55 UTC
(rev 42548)
@@ -0,0 +1,30 @@
+REM LineNo: 20
+REM ExpectedError: BC30663
+REM ErrorMessage: Attribute 'AuthorAttribute' cannot be applied multiple times.
+
+Imports System
+
+<AttributeUsage(AttributeTargets.Class, AllowMultiple := False)> _
+Public Class AuthorAttribute
+ Inherits System.Attribute
+
+ Public Sub New(ByVal Value As String)
+ End Sub
+
+ Public ReadOnly Property Value() As String
+ Get
+ End Get
+ End Property
+End Class
+
+<Author("A"), Author("B")> _
+Public Class Class1
+ shared Sub Main()
+ Dim type As Type = GetType(Class1)
+ Dim arr() As Object = _
+ type.GetCustomAttributes(GetType(AuthorAttribute), True)
+ If arr.Length <> 2 Then
+ Throw New Exception ("Class1 should get NewAttribute.
Lenght of the array should not be 0 but got " & arr.Length)
+ End If
+ End Sub
+End Class
Property changes on: trunk/mcs/mbas/Test/errors/AttributesClassC1.vb
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/mcs/mbas/Test/errors/AttributesClassUseA1.vb
===================================================================
--- trunk/mcs/mbas/Test/errors/AttributesClassUseA1.vb 2005-04-05 05:19:03 UTC
(rev 42547)
+++ trunk/mcs/mbas/Test/errors/AttributesClassUseA1.vb 2005-04-05 05:28:55 UTC
(rev 42548)
@@ -0,0 +1,41 @@
+REM LineNo: 25
+REM ExpectedError: BC30045
+REM ErrorMessage: Positional parameters must be ByVal and may not specify
ByRef,
+
+
+Imports System
+
+<AttributeUsage(AttributeTargets.Class, AllowMultiple := True, _
+ Inherited := True )> _
+Class MultiUseAttribute
+ Inherits System.Attribute
+
+ Public Sub New(ByRef Value As Integer)
+ End Sub
+End Class
+
+<AttributeUsage(AttributeTargets.Class, Inherited := True)> _
+Class SingleUseAttribute
+ Inherits Attribute
+
+ Public Sub New(ByRef Value As Integer)
+ End Sub
+End Class
+
+<SingleUse(1), MultiUse(1)> Class Base
+End Class
+
+
+
+<SingleUse(0), MultiUse(0)> _
+Class Derived
+ Inherits Base
+End Class
+
+Module Test
+ Sub Main()
+ Dim type As Type = GetType(Base)
+ Dim arr() As Object = _
+ type.GetCustomAttributes(GetType(SingleUseAttribute), True)
+ End Sub
+End Module
Property changes on: trunk/mcs/mbas/Test/errors/AttributesClassUseA1.vb
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/mcs/mbas/Test/errors/AttributesClassUseADate1.vb
===================================================================
--- trunk/mcs/mbas/Test/errors/AttributesClassUseADate1.vb 2005-04-05
05:19:03 UTC (rev 42547)
+++ trunk/mcs/mbas/Test/errors/AttributesClassUseADate1.vb 2005-04-05
05:28:55 UTC (rev 42548)
@@ -0,0 +1,47 @@
+REM LineNo: 31
+REM ExpectedError: BC30659
+REM ErrorMessage: 'A' does not have a valid attribute type
+
+
+Imports System
+
+<AttributeUsage(AttributeTargets.Class, AllowMultiple := True, _
+ Inherited := True )> _
+Class MultiUseAttribute
+ Inherits System.Attribute
+
+ Public Sub New(ByVal Value As Integer)
+ End Sub
+End Class
+
+<AttributeUsage(AttributeTargets.Class, Inherited := True)> _
+Class SingleUseAttribute
+ Inherits Attribute
+ Property A () As Date
+ Get
+ End Get
+ Set
+ End Set
+ End Property
+
+ Public Sub New(ByVal Value As Integer)
+ End Sub
+End Class
+
+<SingleUse(1,A:=1.1), MultiUse(1)> Class Base
+End Class
+
+<SingleUse(0,A:=1.1), MultiUse(0)> _
+Class Derived
+ Inherits Base
+End Class
+
+Module Test
+ Sub Main()
+ Dim type As Type = GetType(Base)
+ Dim arr() As Object = _
+ type.GetCustomAttributes(GetType(SingleUseAttribute), True)
+ End Sub
+End Module
+
+
Property changes on: trunk/mcs/mbas/Test/errors/AttributesClassUseADate1.vb
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/mcs/mbas/Test/errors/AttributesClassUseADecimal1.vb
===================================================================
--- trunk/mcs/mbas/Test/errors/AttributesClassUseADecimal1.vb 2005-04-05
05:19:03 UTC (rev 42547)
+++ trunk/mcs/mbas/Test/errors/AttributesClassUseADecimal1.vb 2005-04-05
05:28:55 UTC (rev 42548)
@@ -0,0 +1,46 @@
+REM LineNo: 31
+REM ExpectedError: BC30659
+REM ErrorMessage: 'A' does not have a valid attribute type
+
+
+Imports System
+
+<AttributeUsage(AttributeTargets.Class, AllowMultiple := True, _
+ Inherited := True )> _
+Class MultiUseAttribute
+ Inherits System.Attribute
+
+ Public Sub New(ByVal Value As Integer)
+ End Sub
+End Class
+
+<AttributeUsage(AttributeTargets.Class, Inherited := True)> _
+Class SingleUseAttribute
+ Inherits Attribute
+ Property A () As Decimal
+ Get
+ End Get
+ Set
+ End Set
+ End Property
+
+ Public Sub New(ByVal Value As Integer)
+ End Sub
+End Class
+
+<SingleUse(1,A:=1.1), MultiUse(1)> Class Base
+End Class
+
+<SingleUse(0,A:=1.1), MultiUse(0)> _
+Class Derived
+ Inherits Base
+End Class
+
+Module Test
+ Sub Main()
+ Dim type As Type = GetType(Base)
+ Dim arr() As Object = _
+ type.GetCustomAttributes(GetType(SingleUseAttribute), True)
+ 'Console.WriteLine(arr.Length)
+ End Sub
+End Module
Property changes on: trunk/mcs/mbas/Test/errors/AttributesClassUseADecimal1.vb
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/mcs/mbas/Test/errors/AttributesClassUseNoSingle1.vb
===================================================================
--- trunk/mcs/mbas/Test/errors/AttributesClassUseNoSingle1.vb 2005-04-05
05:19:03 UTC (rev 42547)
+++ trunk/mcs/mbas/Test/errors/AttributesClassUseNoSingle1.vb 2005-04-05
05:28:55 UTC (rev 42548)
@@ -0,0 +1,40 @@
+REM LineNo: 29
+REM ExpectedError: BC30663
+REM ErrorMessage: Attribute 'SingleUseAttribute' cannot be applied multiple
times.
+
+Imports System
+
+<AttributeUsage(AttributeTargets.Class, AllowMultiple := True, _
+ Inherited := True )> _
+Class MultiUseAttribute
+ Inherits System.Attribute
+
+ Public Sub New(ByVal Value As Boolean)
+ End Sub
+End Class
+
+<AttributeUsage(AttributeTargets.Class, Inherited := True)> _
+Class SingleUseAttribute
+ Inherits Attribute
+
+ Public Sub New(ByVal Value As Boolean)
+ End Sub
+End Class
+
+<SingleUse(True), MultiUse(True)> Class Base
+End Class
+
+
+
+<SingleUse(False), SingleUse(False)> _
+Class Derived
+ Inherits Base
+End Class
+
+Module Test
+ Sub Main()
+ Dim type As Type = GetType(Base)
+ Dim arr() As Object = _
+ type.GetCustomAttributes(GetType(SingleUseAttribute), True)
+ End Sub
+End Module
Property changes on: trunk/mcs/mbas/Test/errors/AttributesClassUseNoSingle1.vb
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/mcs/mbas/Test/errors/AttributesMustInheritClassA1.vb
===================================================================
--- trunk/mcs/mbas/Test/errors/AttributesMustInheritClassA1.vb 2005-04-05
05:19:03 UTC (rev 42547)
+++ trunk/mcs/mbas/Test/errors/AttributesMustInheritClassA1.vb 2005-04-05
05:28:55 UTC (rev 42548)
@@ -0,0 +1,35 @@
+REM LineNo: 25
+REM ExpectedError: BC31506
+REM ErrorMessage: 'NewAttribute' cannot be used as an attribute because it is
declared 'MustInherit'.
+
+Imports System
+
+<AttributeUsage(AttributeTargets.All)> _
+MustInherit Class NewAttribute
+ Inherits Attribute
+
+ Public Sub New(ByVal A As String)
+ Me.A = A
+ End Sub
+
+ Public B As String
+ Private A As String
+
+ Public ReadOnly Property A1() As String
+ Get
+ Return A
+ End Get
+ End Property
+End Class
+
+<NewAttribute("hello")> _
+public Class Class1
+ shared Sub Main()
+ Dim type As Type = GetType(Class1)
+ Dim arr() As Object = _
+ type.GetCustomAttributes(GetType(NewAttribute), True)
+ If arr.Length <> 1 Then
+ Throw New Exception ("Class1 should get NewAttribute.
Lenght of the array should not be 0 but got " & arr.Length)
+ End If
+ End Sub
+End Class
Property changes on: trunk/mcs/mbas/Test/errors/AttributesMustInheritClassA1.vb
___________________________________________________________________
Name: svn:executable
+ *
Modified: trunk/mcs/mbas/Test/errors/ChangeLog
===================================================================
--- trunk/mcs/mbas/Test/errors/ChangeLog 2005-04-05 05:19:03 UTC (rev
42547)
+++ trunk/mcs/mbas/Test/errors/ChangeLog 2005-04-05 05:28:55 UTC (rev
42548)
@@ -1,3 +1,17 @@
+2005-04-05 Ritvik Mayank <[EMAIL PROTECTED]>
+ * AttributesMustInheritClassA1.vb
+ * AttributesClassC1.vb
+ * AttributesArguments1.vb
+ * AttributesClassUseADecimal1.vb
+ * AttributesClassUseADate1.vb
+ * AttributesArguments2.vb
+ * AttributesArguments3.vb
+ * AttributesClassUseNoSingle1.vb
+ * AttributesArguments4.vb
+ * TypeValRefVoidA1.vb
+ * AttributesClassUseA1.vb
+ Added the above test cases
+
2005-04-04 Ritvik Mayank <[EMAIL PROTECTED]>
* ConditionalStatementsC10.vb
* ConstructorC1.vb
Added: trunk/mcs/mbas/Test/errors/TypeValRefVoidA1.vb
===================================================================
--- trunk/mcs/mbas/Test/errors/TypeValRefVoidA1.vb 2005-04-05 05:19:03 UTC
(rev 42547)
+++ trunk/mcs/mbas/Test/errors/TypeValRefVoidA1.vb 2005-04-05 05:28:55 UTC
(rev 42548)
@@ -0,0 +1,12 @@
+REM LineNo: 8
+REM ExpectedError: BC30649
+REM ErrorMessage: Void is an unsupported type
+
+Imports System
+Module Test
+Sub main ()
+Dim A = GetType(System.Void)
+Console.WriteLine(A)
+End Sub
+End Module
+
\ No newline at end of file
Property changes on: trunk/mcs/mbas/Test/errors/TypeValRefVoidA1.vb
___________________________________________________________________
Name: svn:executable
+ *
Copied: trunk/mcs/mbas/Test/rerrors/Scope1.vb (from rev 42487,
trunk/mcs/mbas/Test/tests/Scope1.vb)
===================================================================
--- trunk/mcs/mbas/Test/tests/Scope1.vb 2005-04-02 00:29:07 UTC (rev 42487)
+++ trunk/mcs/mbas/Test/rerrors/Scope1.vb 2005-04-05 05:28:55 UTC (rev
42548)
@@ -0,0 +1,35 @@
+'Author:
+' V. Sudharsan ([EMAIL PROTECTED])
+'
+' (C) 2005 Novell, Inc.
+
+'Unhandled Exception: System.InvalidCastException: Cast from string "Hello" to
type 'Integer' is not valid.
+
+Imports System
+Class A
+ Shared Sub fun(i as Integer)
+ System.Console.WriteLine("Outer Integer {0}",i)
+ End Sub
+ Shared Sub fun(i as String)
+ System.Console.WriteLine("Outer String {0}",i)
+ End Sub
+ Class AB
+ Sub gun()
+ Try
+ fun(1)
+ fun("Hello")
+ Catch e As Exception
+ Throw New Exception (e.Message)
+ End Try
+ End Sub
+ Shared Sub fun(i as Integer)
+ End Sub
+ End Class
+End Class
+
+Module ScopeA
+ Sub Main()
+ Dim a as A.AB=new A.AB()
+ a.gun()
+ End Sub
+End Module
Modified: trunk/mcs/mbas/Test/tests/ChangeLog
===================================================================
--- trunk/mcs/mbas/Test/tests/ChangeLog 2005-04-05 05:19:03 UTC (rev 42547)
+++ trunk/mcs/mbas/Test/tests/ChangeLog 2005-04-05 05:28:55 UTC (rev 42548)
@@ -1,3 +1,6 @@
+2005-04-04 Ritvik Mayank <[EMAIL PROTECTED]>
+ * Moved the test cases to respective directories
+
2005-03-24 Manjula GHM <[EMAIL PROTECTED]>
* Corrected GotoStatementA.vb and removed ^M in all tests
2005-03-24 Manjula GHM <[EMAIL PROTECTED]>
Added: trunk/mcs/mbas/Test/tests/attributes/AttributesClassA.vb
===================================================================
--- trunk/mcs/mbas/Test/tests/attributes/AttributesClassA.vb 2005-04-05
05:19:03 UTC (rev 42547)
+++ trunk/mcs/mbas/Test/tests/attributes/AttributesClassA.vb 2005-04-05
05:28:55 UTC (rev 42548)
@@ -0,0 +1,36 @@
+'Author: Ritvik Mayank <[EMAIL PROTECTED]>
+'Copyright (C) 2005 Novell Inc. (http://www.novell.com)
+'use of Simple instead of SimpleAttribute for Class
+
+Imports System
+
+<AttributeUsage(AttributeTargets.Class)> _
+Public Class SimpleAttribute
+ Inherits System.Attribute
+
+ Public Sub New(ByVal A As String)
+ Me.A = A
+ End Sub
+
+ Public B As String
+ Private A As String
+
+ Public ReadOnly Property A1() As String
+ Get
+ Return A
+ End Get
+ End Property
+End Class
+
+<Simple("hello")> _
+public Class Class1
+ shared Sub Main()
+ Dim type As Type = GetType(Class1)
+ Dim arr() As Object = _
+ type.GetCustomAttributes(GetType(SimpleAttribute), True)
+ If arr.Length <> 1 Then
+ Throw New Exception ("Class1 should get
SimpleAttribute. Lenght of the array should be 1 but got " & arr.Length)
+ End If
+ End Sub
+
+End Class
Added: trunk/mcs/mbas/Test/tests/attributes/AttributesClassB.vb
===================================================================
--- trunk/mcs/mbas/Test/tests/attributes/AttributesClassB.vb 2005-04-05
05:19:03 UTC (rev 42547)
+++ trunk/mcs/mbas/Test/tests/attributes/AttributesClassB.vb 2005-04-05
05:28:55 UTC (rev 42548)
@@ -0,0 +1,36 @@
+'Author: Ritvik Mayank <[EMAIL PROTECTED]>
+'Copyright (C) 2005 Novell Inc. (http://www.novell.com)
+' use of Simple instead of SimpleAttribute for Interface
+
+Imports System
+
+<AttributeUsage(AttributeTargets.Class Or AttributeTargets.Interface)> _
+Public Class SimpleAttribute
+ Inherits System.Attribute
+
+ Public Sub New(ByVal A As String)
+ Me.A = A
+ End Sub
+
+ Public B As String
+ Private A As String
+
+ Public ReadOnly Property A1() As String
+ Get
+ Return A
+ End Get
+ End Property
+End Class
+
+<Simple("hello")> _
+Class Class1
+End Class
+
+<Simple("hello")> _
+public Interface Interface1
+End Interface
+
+Module Test
+ Sub Main()
+ End Sub
+End Module
Added: trunk/mcs/mbas/Test/tests/attributes/AttributesClassBothSuffixA.vb
===================================================================
--- trunk/mcs/mbas/Test/tests/attributes/AttributesClassBothSuffixA.vb
2005-04-05 05:19:03 UTC (rev 42547)
+++ trunk/mcs/mbas/Test/tests/attributes/AttributesClassBothSuffixA.vb
2005-04-05 05:28:55 UTC (rev 42548)
@@ -0,0 +1,37 @@
+'Author: Ritvik Mayank <[EMAIL PROTECTED]>
+'Copyright (C) 2005 Novell Inc. (http://www.novell.com)
+'Both Simple and SimpleAttribute is defined
+
+Imports System
+
+<AttributeUsage(AttributeTargets.Class)> _
+Public Class SimpleAttribute
+ Inherits System.Attribute
+
+ Public Sub New(ByVal A As String)
+ Me.A = A
+ End Sub
+
+ Public B As String
+ Private A As String
+
+ Public ReadOnly Property A1() As String
+ Get
+ Return A
+ End Get
+ End Property
+End Class
+
+<SimpleAttribute("string")> _
+public Class Class2
+End Class
+
+
+<Simple("hello")> _
+public Class Class1
+ shared Sub Main()
+ Dim type As Type = GetType(Class1)
+ Dim arr() As Object = _
+ type.GetCustomAttributes(GetType(simpleAttribute), True)
+ End Sub
+End Class
\ No newline at end of file
Added: trunk/mcs/mbas/Test/tests/attributes/AttributesClassC.vb
===================================================================
--- trunk/mcs/mbas/Test/tests/attributes/AttributesClassC.vb 2005-04-05
05:19:03 UTC (rev 42547)
+++ trunk/mcs/mbas/Test/tests/attributes/AttributesClassC.vb 2005-04-05
05:28:55 UTC (rev 42548)
@@ -0,0 +1,30 @@
+'Author: Ritvik Mayank <[EMAIL PROTECTED]>
+'Copyright (C) 2005 Novell Inc. (http://www.novell.com)
+'this checks for the AllowMultiple, if true <Author("A"), Author("B")> should
not throw any error
+
+Imports System
+
+<AttributeUsage(AttributeTargets.Class, AllowMultiple := True)> _
+Public Class AuthorAttribute
+ Inherits System.Attribute
+
+ Public Sub New(ByVal Value As String)
+ End Sub
+
+ Public ReadOnly Property Value() As String
+ Get
+ End Get
+ End Property
+End Class
+
+<Author("A"), Author("B")> _
+Public Class Class1
+ shared Sub Main()
+ Dim type As Type = GetType(Class1)
+ Dim arr() As Object = _
+ type.GetCustomAttributes(GetType(AuthorAttribute), True)
+ If arr.Length <> 2 Then
+ Throw New Exception ("Class1 should get the Author
Attributes. Lenght of the array should be 2 but got " & arr.Length)
+ End If
+ End Sub
+End Class
Added: trunk/mcs/mbas/Test/tests/attributes/AttributesClassNoparameterA.vb
===================================================================
--- trunk/mcs/mbas/Test/tests/attributes/AttributesClassNoparameterA.vb
2005-04-05 05:19:03 UTC (rev 42547)
+++ trunk/mcs/mbas/Test/tests/attributes/AttributesClassNoparameterA.vb
2005-04-05 05:28:55 UTC (rev 42548)
@@ -0,0 +1,34 @@
+'Author: Ritvik Mayank <[EMAIL PROTECTED]>
+'Copyright (C) 2005 Novell Inc. (http://www.novell.com)
+' Passing No parameter for Attributes
+Imports System
+
+<AttributeUsage(AttributeTargets.Class Or AttributeTargets.Interface)> _
+Public Class SimpleAttribute
+ Inherits System.Attribute
+
+ Public Sub New()
+ Me.A = A
+ End Sub
+
+ Public B As String
+ Private A As String
+
+ Public ReadOnly Property A1() As String
+ Get
+ Return A
+ End Get
+ End Property
+End Class
+
+<Simple> _
+Class Class1
+End Class
+
+<Simple()> _
+public Interface Interface1
+End Interface
+Module Test
+ Sub Main()
+ End Sub
+End Module
Added: trunk/mcs/mbas/Test/tests/attributes/AttributesClassUseA.vb
===================================================================
--- trunk/mcs/mbas/Test/tests/attributes/AttributesClassUseA.vb 2005-04-05
05:19:03 UTC (rev 42547)
+++ trunk/mcs/mbas/Test/tests/attributes/AttributesClassUseA.vb 2005-04-05
05:28:55 UTC (rev 42548)
@@ -0,0 +1,39 @@
+'Author: Ritvik Mayank <[EMAIL PROTECTED]>
+'Copyright (C) 2005 Novell Inc. (http://www.novell.com)
+'Base All Attributes
+
+Imports System
+
+<AttributeUsage(AttributeTargets.Class, AllowMultiple := True, _
+ Inherited := True )> _
+Class MultiUseAttribute
+ Inherits System.Attribute
+ Public Sub New(ByVal Value As Boolean)
+ End Sub
+End Class
+
+<AttributeUsage(AttributeTargets.Class, Inherited := True)> _
+Class SingleUseAttribute
+ Inherits Attribute
+ Public Sub New(ByVal Value As Boolean)
+ End Sub
+End Class
+
+<SingleUse(True), MultiUse(True)> Class Base
+End Class
+
+<SingleUse(False), MultiUse(False)> _
+Class Derived
+ Inherits Base
+End Class
+
+Module Test
+ Sub Main()
+ Dim type As Type = GetType(Base)
+ Dim arr() As Object = _
+ type.GetCustomAttributes(GetType(Attribute), True)
+ if arr.Length <> 2 Then
+ Throw New Exception ("The Base Class should get
single-use multi-use attribute .Expected 2 but got " & arr.Length)
+ End If
+ End Sub
+End Module
Added: trunk/mcs/mbas/Test/tests/attributes/AttributesClassUseB.vb
===================================================================
--- trunk/mcs/mbas/Test/tests/attributes/AttributesClassUseB.vb 2005-04-05
05:19:03 UTC (rev 42547)
+++ trunk/mcs/mbas/Test/tests/attributes/AttributesClassUseB.vb 2005-04-05
05:28:55 UTC (rev 42548)
@@ -0,0 +1,39 @@
+'Author: Ritvik Mayank <[EMAIL PROTECTED]>
+'Copyright (C) 2005 Novell Inc. (http://www.novell.com)
+'Base single-use
+
+Imports System
+
+<AttributeUsage(AttributeTargets.Class, AllowMultiple := True, _
+ Inherited := True )> _
+Class MultiUseAttribute
+ Inherits System.Attribute
+ Public Sub New(ByVal Value As Boolean)
+ End Sub
+End Class
+
+<AttributeUsage(AttributeTargets.Class, Inherited := True)> _
+Class SingleUseAttribute
+ Inherits Attribute
+ Public Sub New(ByVal Value As Boolean)
+ End Sub
+End Class
+
+<SingleUse(True), MultiUse(True)> Class Base
+End Class
+
+<SingleUse(False), MultiUse(False)> _
+Class Derived
+ Inherits Base
+End Class
+
+Module Test
+ Sub Main()
+ Dim type As Type = GetType(Base)
+ Dim arr() As Object = _
+ type.GetCustomAttributes(GetType(SingleuseAttribute), True)
+ if arr.Length <> 1 Then
+ Throw New Exception ("The Base Class should get one
attribute . but got " & arr.Length)
+ End If
+ End Sub
+End Module
Added: trunk/mcs/mbas/Test/tests/attributes/AttributesClassUseC.vb
===================================================================
--- trunk/mcs/mbas/Test/tests/attributes/AttributesClassUseC.vb 2005-04-05
05:19:03 UTC (rev 42547)
+++ trunk/mcs/mbas/Test/tests/attributes/AttributesClassUseC.vb 2005-04-05
05:28:55 UTC (rev 42548)
@@ -0,0 +1,39 @@
+'Author: Ritvik Mayank <[EMAIL PROTECTED]>
+'Copyright (C) 2005 Novell Inc. (http://www.novell.com)
+' multiple-use for derived takes both the attributes
+
+Imports System
+
+<AttributeUsage(AttributeTargets.Class, AllowMultiple := True, _
+ Inherited := True )> _
+Class MultiUseAttribute
+ Inherits System.Attribute
+ Public Sub New(ByVal Value As Boolean)
+ End Sub
+End Class
+
+<AttributeUsage(AttributeTargets.Class, Inherited := True)> _
+Class SingleUseAttribute
+ Inherits Attribute
+ Public Sub New(ByVal Value As Boolean)
+ End Sub
+End Class
+
+<SingleUse(True), MultiUse(True)> Class Base
+End Class
+
+<SingleUse(False), MultiUse(False)> _
+Class Derived
+ Inherits Base
+End Class
+
+Module Test
+ Sub Main()
+ Dim type As Type = GetType(Derived)
+ Dim arr() As Object = _
+ type.GetCustomAttributes(GetType(Attribute), True)
+ If arr.Length <> 3 Then
+ Throw New Exception ("multiple-use attribute is
inherited on a derived type can take both attributes. expected total attributes
= 3 but got " & arr.Length)
+ End If
+ End Sub
+End Module
Added: trunk/mcs/mbas/Test/tests/attributes/AttributesClassUseD.vb
===================================================================
--- trunk/mcs/mbas/Test/tests/attributes/AttributesClassUseD.vb 2005-04-05
05:19:03 UTC (rev 42547)
+++ trunk/mcs/mbas/Test/tests/attributes/AttributesClassUseD.vb 2005-04-05
05:28:55 UTC (rev 42548)
@@ -0,0 +1,39 @@
+'Author: Ritvik Mayank <[EMAIL PROTECTED]>
+'Copyright (C) 2005 Novell Inc. (http://www.novell.com)
+'Derived multi-use
+
+Imports System
+
+<AttributeUsage(AttributeTargets.Class, AllowMultiple := True, _
+ Inherited := True )> _
+Class MultiUseAttribute
+ Inherits System.Attribute
+ Public Sub New(ByVal Value As Boolean)
+ End Sub
+End Class
+
+<AttributeUsage(AttributeTargets.Class, Inherited := True)> _
+Class SingleUseAttribute
+ Inherits Attribute
+ Public Sub New(ByVal Value As Boolean)
+ End Sub
+End Class
+
+<SingleUse(True), MultiUse(True)> Class Base
+End Class
+
+<SingleUse(False), MultiUse(False)> _
+Class Derived
+ Inherits Base
+End Class
+
+Module Test
+ Sub Main()
+ Dim type As Type = GetType(Derived)
+ Dim arr() As Object = _
+ type.GetCustomAttributes(GetType(MultiUseAttribute), True)
+ if arr.Length <> 2 Then
+ Throw New Exception ("The Base Class should get
single-use multiuse attribute .Expected 2 but got " & arr.Length)
+ End If
+ End Sub
+End Module
Added: trunk/mcs/mbas/Test/tests/attributes/AttributesNewA.vb
===================================================================
--- trunk/mcs/mbas/Test/tests/attributes/AttributesNewA.vb 2005-04-05
05:19:03 UTC (rev 42547)
+++ trunk/mcs/mbas/Test/tests/attributes/AttributesNewA.vb 2005-04-05
05:28:55 UTC (rev 42548)
@@ -0,0 +1,35 @@
+'Author: Ritvik Mayank <[EMAIL PROTECTED]>
+'Copyright (C) 2005 Novell Inc. (http://www.novell.com)
+
+Imports System
+
+<AttributeUsage(AttributeTargets.All)> _
+Public Class NewAttribute
+ Inherits Attribute
+
+ Public Sub New(ByVal A As String)
+ Me.A = A
+ End Sub
+
+ Public B As String
+ Private A As String
+
+ Public ReadOnly Property A1() As String
+ Get
+ Return A
+ End Get
+ End Property
+End Class
+
+<NewAttribute("hello")> _
+public Class Class1
+ shared Sub Main()
+ Dim type As Type = GetType(Class1)
+ Dim arr() As Object = _
+ type.GetCustomAttributes(GetType(NewAttribute), True)
+ If arr.Length <> 1 Then
+ Throw New Exception ("Class1 should get NewAttribute.
Lenght of the array should not be 0 but got " & arr.Length)
+ End If
+
+ End Sub
+End Class
Added: trunk/mcs/mbas/Test/tests/attributes/AttributesNewB.vb
===================================================================
--- trunk/mcs/mbas/Test/tests/attributes/AttributesNewB.vb 2005-04-05
05:19:03 UTC (rev 42547)
+++ trunk/mcs/mbas/Test/tests/attributes/AttributesNewB.vb 2005-04-05
05:28:55 UTC (rev 42548)
@@ -0,0 +1,34 @@
+'Author: Ritvik Mayank <[EMAIL PROTECTED]>
+'Copyright (C) 2005 Novell Inc. (http://www.novell.com)
+
+Imports System
+
+<AttributeUsage(AttributeTargets.Class)> _
+Public Class NewAttribute
+ Inherits Attribute
+
+ Public Sub New(ByVal A As String)
+ Me.A = A
+ End Sub
+
+ Public B As String
+ Private A As String
+
+ Public ReadOnly Property A1() As String
+ Get
+ Return A
+ End Get
+ End Property
+End Class
+
+public Class Class1
+ shared Sub Main()
+ Dim type As Type = GetType(Class1)
+ Dim arr() As Object = _
+ type.GetCustomAttributes(GetType(NewAttribute), True)
+ If arr.Length <> 0 Then
+ Throw New Exception ("Class1 should not get any
Attribute. Lenght of the array should be 0 but got " & arr.Length)
+ End If
+ End Sub
+
+End Class
Added: trunk/mcs/mbas/Test/tests/attributes/ChangeLog
===================================================================
--- trunk/mcs/mbas/Test/tests/attributes/ChangeLog 2005-04-05 05:19:03 UTC
(rev 42547)
+++ trunk/mcs/mbas/Test/tests/attributes/ChangeLog 2005-04-05 05:28:55 UTC
(rev 42548)
@@ -0,0 +1,16 @@
+2005-04-05 Ritvik Mayank <[EMAIL PROTECTED]>
+ * AttributesClassNoparameterA.vb
+ * AttributesClassA.vb
+ * AttributesClassB.vb
+ * AttributesClassBothSuffixA.vb
+ * AttributesClassC.vb
+ * AttributesClassUseA.vb
+ * AttributesClassUseB.vb
+ * AttributesClassUseC.vb
+ * AttributesClassUseD.vb
+ * AttributesNewA.vb
+ * AttributesNewB.vb
+ Added the above test cases
+
+2005-04-04 Ritvik Mayank <[EMAIL PROTECTED]>
+ * Moved all the Attribute Test Cases to this folder
Added: trunk/mcs/mbas/Test/tests/types/ChangeLog
===================================================================
--- trunk/mcs/mbas/Test/tests/types/ChangeLog 2005-04-05 05:19:03 UTC (rev
42547)
+++ trunk/mcs/mbas/Test/tests/types/ChangeLog 2005-04-05 05:28:55 UTC (rev
42548)
@@ -0,0 +1,13 @@
+2005-04-05 Ritvik Mayank <[EMAIL PROTECTED]>
+ * TypeValRefStringA.vb
+ * TypeValRefArrayA.vb
+ * TypeValRefC.vb
+ * TypeValRefB.vb
+ * TypeValRefVoidA1.vb
+ * TypeObjectA.vb
+ * TypeValRefA.vb
+ * TypeStructureA.vb
+ Added the above Test Cases
+
+2005-04-04 Ritvik Mayank <[EMAIL PROTECTED]>
+ Moved All the 'types' Test Cases to this directory
Added: trunk/mcs/mbas/Test/tests/types/TypeObjectA.vb
===================================================================
--- trunk/mcs/mbas/Test/tests/types/TypeObjectA.vb 2005-04-05 05:19:03 UTC
(rev 42547)
+++ trunk/mcs/mbas/Test/tests/types/TypeObjectA.vb 2005-04-05 05:28:55 UTC
(rev 42548)
@@ -0,0 +1,32 @@
+'Author: Ritvik Mayank <[EMAIL PROTECTED]>
+'Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+
+Imports System
+
+ Public Class ValueReference
+ Public AgeClass As Integer
+ End Class
+
+ Structure SomeStruct
+ Public AgeStruct As Integer
+ End Structure
+
+Module Test
+ Sub Main()
+ Dim objVal1 As Object = New SomeStruct()
+ objval1.AgeStruct = 50
+ Dim objval2 As Object = objval1
+ objval2.AgeStruct = 100
+ if (objval1.AgeStruct <> 50 or objval2.AgeStruct <> 100) then
+ Throw New Exception ("objval1.AgeStruct should be 50,
but got " & objval1.AgeStruct & " and objval2.AgeStruct should be , but got " &
objval2.AgeStruct)
+ End if
+
+ Dim Objref1 As Object = New ValueReference()
+ objref1.AgeClass = 50
+ Dim objref2 As Object = objref1
+ objref2.AgeClass = 100
+ if (objref2.AgeClass <>objref2.AgeClass or objref2.AgeClass <>
100) then
+ Throw New Exception ("objref1.AgeClass should be 100,
but got " & objref1.AgeClass & "and objref2.AgeClass should be , but got " &
objref2.AgeClass)
+ End if
+ End Sub
+End Module
Added: trunk/mcs/mbas/Test/tests/types/TypeStructureA.vb
===================================================================
--- trunk/mcs/mbas/Test/tests/types/TypeStructureA.vb 2005-04-05 05:19:03 UTC
(rev 42547)
+++ trunk/mcs/mbas/Test/tests/types/TypeStructureA.vb 2005-04-05 05:28:55 UTC
(rev 42548)
@@ -0,0 +1,28 @@
+'Author: Ritvik Mayank <[EMAIL PROTECTED]>
+'Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+
+Imports System
+
+Structure Somestruct
+ Dim a as String
+ Const b as integer = 25
+End Structure
+
+
+Module M
+ Sub Main()
+ dim x as Somestruct
+
+ x.a = 10
+ If x.a <> 10 then
+ Throw new Exception ("Expected x.a = 10 but got " & x.a)
+ End If
+
+ dim y as Somestruct = x
+
+ x.a = 20
+ If y.a <> 10 then
+ Throw new Exception ("Expected y.a = 10 but got " & y.a)
+ End If
+ End Sub
+End Module
Added: trunk/mcs/mbas/Test/tests/types/TypeValRefA.vb
===================================================================
--- trunk/mcs/mbas/Test/tests/types/TypeValRefA.vb 2005-04-05 05:19:03 UTC
(rev 42547)
+++ trunk/mcs/mbas/Test/tests/types/TypeValRefA.vb 2005-04-05 05:28:55 UTC
(rev 42548)
@@ -0,0 +1,39 @@
+'Author: Ritvik Mayank <[EMAIL PROTECTED]>
+'Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+
+Imports System
+Module TypeValRef
+
+ Public Class ValueReference
+ Public Age As Short
+ End Class
+
+ Structure MyStruct
+ Public Age As Short
+ End Structure
+
+ Sub Main()
+ Dim objRef1 As ValueReference
+ Dim objRef2 As ValueReference
+
+ Dim objValue1 As MyStruct
+ Dim objValue2 As MyStruct
+
+ objRef1 = New ValueReference( )
+ objRef1.Age = 20
+ objRef2 = objRef1
+ objRef2.Age = 30
+
+ If ((objRef1.Age <> objRef2.Age) or (objRef1.Age <> 30) )
+ Throw New Exception ("Unexpected behavior objRef1.Age
and objRef2.Age should return the same value Expected 30 but got = " &
objRef2.Age)
+ End if
+
+ objValue1 = New MyStruct( )
+ objValue1.Age = 20
+ objValue2 = objValue1
+ objValue2.Age = 30
+ If (objValue1.Age <> 20) or (objValue2.Age <> 30) then
+ Throw New Exception ("Unexpected behavior. Expected
objValue1.Age = 20 and objValue2.Age = 30 but got objValue1.Age = " &
objValue1.Age & " objValue2.Age = " & objValue2.Age)
+ End if
+ End Sub
+End Module
Added: trunk/mcs/mbas/Test/tests/types/TypeValRefArrayA.vb
===================================================================
--- trunk/mcs/mbas/Test/tests/types/TypeValRefArrayA.vb 2005-04-05 05:19:03 UTC
(rev 42547)
+++ trunk/mcs/mbas/Test/tests/types/TypeValRefArrayA.vb 2005-04-05 05:28:55 UTC
(rev 42548)
@@ -0,0 +1,16 @@
+'Author: Ritvik Mayank <[EMAIL PROTECTED]>
+'Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+
+Imports System
+Module TypeValRefArray
+
+ Sub Main()
+ Dim SomeArray1( ) As Integer = {1, 2, 3}
+ Dim SomeArray2( ) As Integer
+ SomeArray2 = SomeArray1
+ SomeArray1(0) = 100
+ if SomeArray2(0) <> 100 then
+ Throw New Exception ("Unexpected Behavior
SomeArray2(0) refers to SomeArray1(0) value should be 100 but got SomeArray2(0)
= " & SomeArray2(0))
+ End if
+ End Sub
+End Module
\ No newline at end of file
Added: trunk/mcs/mbas/Test/tests/types/TypeValRefB.vb
===================================================================
--- trunk/mcs/mbas/Test/tests/types/TypeValRefB.vb 2005-04-05 05:19:03 UTC
(rev 42547)
+++ trunk/mcs/mbas/Test/tests/types/TypeValRefB.vb 2005-04-05 05:28:55 UTC
(rev 42548)
@@ -0,0 +1,22 @@
+'Author: Ritvik Mayank <[EMAIL PROTECTED]>
+'Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+
+Imports System
+
+Class Class1
+ Public Value As Integer = 0
+End Class
+
+Module Test
+ Sub Main()
+ Dim val1 As Integer = 0
+ Dim val2 As Integer = val1
+ val2 = 123
+ Dim ref1 As Class1 = New Class1()
+ Dim ref2 As Class1 = ref1
+ ref2.Value = 123
+ if val1 <> 0 and val2 <> 123 then
+ Throw New Exception ("Expected was val1 = 0 and val2 =
123 .")
+ End if
+ End Sub
+End Module
\ No newline at end of file
Added: trunk/mcs/mbas/Test/tests/types/TypeValRefC.vb
===================================================================
--- trunk/mcs/mbas/Test/tests/types/TypeValRefC.vb 2005-04-05 05:19:03 UTC
(rev 42547)
+++ trunk/mcs/mbas/Test/tests/types/TypeValRefC.vb 2005-04-05 05:28:55 UTC
(rev 42548)
@@ -0,0 +1,19 @@
+Imports System
+
+Class Class1
+ Public Value As Integer = 0
+End Class
+
+Module Test
+ Sub Main()
+ Dim val1 As Integer = 0
+ Dim val2 As Integer = val1
+ val2 = 123
+ Dim ref1 As Class1 = New Class1()
+ Dim ref2 As Class1 = ref1
+ ref2.Value = 123
+ if ref1.value <> 123 and ref2.value <> 123 then
+ Throw New Exception ("Expected was val1 = 0 and val2 =
123 .")
+ End if
+ End Sub
+End Module
\ No newline at end of file
Added: trunk/mcs/mbas/Test/tests/types/TypeValRefStringA.vb
===================================================================
--- trunk/mcs/mbas/Test/tests/types/TypeValRefStringA.vb 2005-04-05
05:19:03 UTC (rev 42547)
+++ trunk/mcs/mbas/Test/tests/types/TypeValRefStringA.vb 2005-04-05
05:28:55 UTC (rev 42548)
@@ -0,0 +1,19 @@
+'Author: Ritvik Mayank <[EMAIL PROTECTED]>
+'Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+
+Imports System
+Module TypeValRefString
+ Sub Main()
+ Dim str1, str2 As String
+ str1 = "String 1"
+ str2 = str1
+ if String.Compare(str2,"String 1")<>0
+ Throw New Exception ("str2 Should be String1")
+ End if
+ str2 = "String 2"
+ str1 = Nothing
+ if (String.Compare(str1,Nothing) <> 0) or
(String.Compare(str1,Nothing) <> 0)
+ Throw New Exception ("Str1 should be nothing
and Str2 should be String 2 but got Str1 = " & Str1 &" Str2 = " & str2 )
+ End if
+ End Sub
+End Module
\ No newline at end of file
Added: trunk/mcs/mbas/Test/tests/types/TypeValRefVoidA1.vb
===================================================================
--- trunk/mcs/mbas/Test/tests/types/TypeValRefVoidA1.vb 2005-04-05 05:19:03 UTC
(rev 42547)
+++ trunk/mcs/mbas/Test/tests/types/TypeValRefVoidA1.vb 2005-04-05 05:28:55 UTC
(rev 42548)
@@ -0,0 +1,12 @@
+REM LineNo: 8
+REM ExpectedError: BC30649
+REM ErrorMessage: Void is an unsupported type
+
+Imports System
+Module Test
+Sub main ()
+Dim A = GetType(System.Void)
+Console.WriteLine(A)
+End Sub
+End Module
+
\ No newline at end of file
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches