--- /dev/null
--- /dev/null
++REM LineNo: 21\r
++REM ExpectedError: BC30060 \r
++REM ErrorMessage: Conversion from 'Integer' to 'String' cannot occur in a constant expression.\r
++\r
++Imports System\r
++<AttributeUsage(AttributeTargets.All)> _\r
++Public Class GeneralAttribute\r
++ Inherits Attribute\r
++ Public Sub New(ByVal x As string)\r
++ End Sub\r
++ Public y As Type\r
++ Public Property z As Integer\r
++ Get\r
++ End Get\r
++ Set\r
++ End Set\r
++ End Property\r
++End Class\r
++\r
++\r
++<General(10, z := 30, y := GetType(Integer))> _\r
++Class Foo\r
++End Class\r
++\r
++<General(10.5, z := 10)> _\r
++Class Bar\r
++End Class\r
++\r
++\r
++Module Test\r
++Sub Main ()\r
++End Sub\r
++End Module
--- /dev/null
--- /dev/null
++REM LineNo: 22\r
++REM ExpectedError: BC30390 \r
++REM ErrorMessage: 'GeneralAttribute.Private Sub New(x As Integer)' is not accessible in this context because it is 'Private'.\r
++\r
++\r
++Imports System\r
++<AttributeUsage(AttributeTargets.All)> _\r
++Public Class GeneralAttribute\r
++ Inherits Attribute\r
++ Private Sub New(ByVal x As Integer)\r
++ End Sub\r
++ Public y As Type\r
++ Public Property z As Integer\r
++ Get\r
++ End Get\r
++ Set\r
++ End Set \r
++ End Property\r
++End Class\r
++\r
++\r
++<General(10, z := 30, y := GetType(Integer))> _\r
++Class Foo\r
++End Class\r
++\r
++<General(10.5, z := 10)> _\r
++Class Bar\r
++End Class\r
++\r
++\r
++Module Test\r
++Sub Main ()\r
++End Sub\r
++End Module
--- /dev/null
--- /dev/null
++REM LineNo: 21\r
++REM ExpectedError: BC30455 \r
++REM ErrorMessage: Argument not specified for parameter 'y' of 'Public Sub New(x As Integer, y As Decimal) \r
++\r
++Imports System\r
++<AttributeUsage(AttributeTargets.All)> _\r
++Public Class GeneralAttribute\r
++ Inherits Attribute\r
++ Public Sub New(ByVal x As Integer,ByVal y As decimal )\r
++ End Sub\r
++ Public y As Type\r
++ Public Property z As Integer\r
++ Get\r
++ End Get\r
++ Set\r
++ End Set\r
++ End Property\r
++End Class\r
++\r
++\r
++<General(10, z := 30, y := GetType(Integer))> _\r
++Class Foo\r
++End Class\r
++\r
++<General(10.5, z := 10)> _\r
++Class Bar\r
++End Class\r
++\r
++\r
++Module Test\r
++Sub Main ()\r
++End Sub\r
++End Module
--- /dev/null
--- /dev/null
++REM LineNo: 15\r
++REM ExpectedError: BC30661 \r
++REM ErrorMessage: Field or property 'z' is not found.\r
++\r
++Imports System\r
++<AttributeUsage(AttributeTargets.All)> _\r
++Public Class GeneralAttribute\r
++ Inherits Attribute\r
++ Public Sub New(ByVal A As Type)\r
++ End Sub\r
++ Public y As Type\r
++End Class\r
++\r
++\r
++<General(GetType(GeneralAttribute), z := 10)> _\r
++Class Bar\r
++End Class\r
++\r
++\r
++Module Test\r
++ Sub Main ()\r
++ Dim x \r
++ End Sub\r
++End Module
--- /dev/null
--- /dev/null
++REM LineNo: 20\r
++REM ExpectedError: BC30663\r
++REM ErrorMessage: Attribute 'AuthorAttribute' cannot be applied multiple times.\r
++\r
++Imports System\r
++\r
++<AttributeUsage(AttributeTargets.Class, AllowMultiple := False)> _\r
++Public Class AuthorAttribute\r
++ Inherits System.Attribute\r
++\r
++ Public Sub New(ByVal Value As String)\r
++ End Sub\r
++\r
++ Public ReadOnly Property Value() As String\r
++ Get\r
++ End Get\r
++ End Property\r
++End Class\r
++\r
++<Author("A"), Author("B")> _\r
++Public Class Class1\r
++ shared Sub Main()\r
++ Dim type As Type = GetType(Class1)\r
++ Dim arr() As Object = _\r
++ type.GetCustomAttributes(GetType(AuthorAttribute), True)\r
++ If arr.Length <> 2 Then\r
++ Throw New Exception ("Class1 should get NewAttribute. Lenght of the array should not be 0 but got " & arr.Length) \r
++ End If\r
++ End Sub\r
++End Class\r
--- /dev/null
--- /dev/null
++REM LineNo: 25\r
++REM ExpectedError: BC30045\r
++REM ErrorMessage: Positional parameters must be ByVal and may not specify ByRef,\r
++\r
++\r
++Imports System\r
++\r
++<AttributeUsage(AttributeTargets.Class, AllowMultiple := True, _\r
++ Inherited := True )> _\r
++Class MultiUseAttribute \r
++ Inherits System.Attribute\r
++\r
++ Public Sub New(ByRef Value As Integer)\r
++ End Sub\r
++End Class\r
++\r
++<AttributeUsage(AttributeTargets.Class, Inherited := True)> _\r
++Class SingleUseAttribute\r
++ Inherits Attribute\r
++\r
++ Public Sub New(ByRef Value As Integer)\r
++ End Sub\r
++End Class\r
++\r
++<SingleUse(1), MultiUse(1)> Class Base\r
++End Class\r
++\r
++\r
++\r
++<SingleUse(0), MultiUse(0)> _\r
++Class Derived\r
++ Inherits Base\r
++End Class\r
++\r
++Module Test \r
++ Sub Main()\r
++ Dim type As Type = GetType(Base)\r
++ Dim arr() As Object = _\r
++ type.GetCustomAttributes(GetType(SingleUseAttribute), True)\r
++ End Sub\r
++End Module \r
--- /dev/null
--- /dev/null
++REM LineNo: 31 \r
++REM ExpectedError: BC30659\r
++REM ErrorMessage: 'A' does not have a valid attribute type\r
++\r
++\r
++Imports System\r
++\r
++<AttributeUsage(AttributeTargets.Class, AllowMultiple := True, _\r
++ Inherited := True )> _\r
++Class MultiUseAttribute \r
++ Inherits System.Attribute\r
++\r
++ Public Sub New(ByVal Value As Integer)\r
++ End Sub\r
++End Class\r
++\r
++<AttributeUsage(AttributeTargets.Class, Inherited := True)> _\r
++Class SingleUseAttribute\r
++ Inherits Attribute\r
++ Property A () As Date\r
++ Get\r
++ End Get\r
++ Set\r
++ End Set\r
++ End Property\r
++\r
++ Public Sub New(ByVal Value As Integer)\r
++ End Sub\r
++End Class\r
++\r
++<SingleUse(1,A:=1.1), MultiUse(1)> Class Base\r
++End Class\r
++\r
++<SingleUse(0,A:=1.1), MultiUse(0)> _\r
++Class Derived\r
++ Inherits Base\r
++End Class\r
++\r
++Module Test \r
++ Sub Main()\r
++ Dim type As Type = GetType(Base)\r
++ Dim arr() As Object = _\r
++ type.GetCustomAttributes(GetType(SingleUseAttribute), True)\r
++ End Sub\r
++End Module \r
++\r
++\r
--- /dev/null
--- /dev/null
++REM LineNo: 31 \r
++REM ExpectedError: BC30659\r
++REM ErrorMessage: 'A' does not have a valid attribute type\r
++\r
++\r
++Imports System\r
++\r
++<AttributeUsage(AttributeTargets.Class, AllowMultiple := True, _\r
++ Inherited := True )> _\r
++Class MultiUseAttribute \r
++ Inherits System.Attribute\r
++\r
++ Public Sub New(ByVal Value As Integer)\r
++ End Sub\r
++End Class\r
++\r
++<AttributeUsage(AttributeTargets.Class, Inherited := True)> _\r
++Class SingleUseAttribute\r
++ Inherits Attribute\r
++ Property A () As Decimal\r
++ Get\r
++ End Get\r
++ Set\r
++ End Set\r
++ End Property\r
++\r
++ Public Sub New(ByVal Value As Integer)\r
++ End Sub\r
++End Class\r
++\r
++<SingleUse(1,A:=1.1), MultiUse(1)> Class Base\r
++End Class\r
++\r
++<SingleUse(0,A:=1.1), MultiUse(0)> _\r
++Class Derived\r
++ Inherits Base\r
++End Class\r
++\r
++Module Test \r
++ Sub Main()\r
++ Dim type As Type = GetType(Base)\r
++ Dim arr() As Object = _\r
++ type.GetCustomAttributes(GetType(SingleUseAttribute), True)\r
++ 'Console.WriteLine(arr.Length)\r
++ End Sub\r
++End Module \r
--- /dev/null
--- /dev/null
++REM LineNo: 29\r
++REM ExpectedError: BC30663 \r
++REM ErrorMessage: Attribute 'SingleUseAttribute' cannot be applied multiple times.\r
++\r
++Imports System\r
++\r
++<AttributeUsage(AttributeTargets.Class, AllowMultiple := True, _\r
++ Inherited := True )> _\r
++Class MultiUseAttribute \r
++ Inherits System.Attribute\r
++\r
++ Public Sub New(ByVal Value As Boolean)\r
++ End Sub\r
++End Class\r
++\r
++<AttributeUsage(AttributeTargets.Class, Inherited := True)> _\r
++Class SingleUseAttribute\r
++ Inherits Attribute\r
++\r
++ Public Sub New(ByVal Value As Boolean)\r
++ End Sub\r
++End Class\r
++\r
++<SingleUse(True), MultiUse(True)> Class Base\r
++End Class\r
++\r
++\r
++\r
++<SingleUse(False), SingleUse(False)> _\r
++Class Derived\r
++ Inherits Base\r
++End Class\r
++\r
++Module Test \r
++ Sub Main()\r
++ Dim type As Type = GetType(Base)\r
++ Dim arr() As Object = _\r
++ type.GetCustomAttributes(GetType(SingleUseAttribute), True)\r
++ End Sub\r
++End Module \r
--- /dev/null
--- /dev/null
++REM LineNo: 25\r
++REM ExpectedError: BC31506\r
++REM ErrorMessage: 'NewAttribute' cannot be used as an attribute because it is declared 'MustInherit'.\r
++\r
++Imports System\r
++\r
++<AttributeUsage(AttributeTargets.All)> _\r
++MustInherit Class NewAttribute\r
++ Inherits Attribute\r
++\r
++ Public Sub New(ByVal A As String)\r
++ Me.A = A\r
++ End Sub\r
++\r
++ Public B As String\r
++ Private A As String\r
++\r
++ Public ReadOnly Property A1() As String\r
++ Get\r
++ Return A\r
++ End Get\r
++ End Property\r
++End Class\r
++\r
++<NewAttribute("hello")> _\r
++public Class Class1\r
++ shared Sub Main()\r
++ Dim type As Type = GetType(Class1)\r
++ Dim arr() As Object = _\r
++ type.GetCustomAttributes(GetType(NewAttribute), True)\r
++ If arr.Length <> 1 Then\r
++ Throw New Exception ("Class1 should get NewAttribute. Lenght of the array should not be 0 but got " & arr.Length) \r
++ End If\r
++ End Sub\r
++End Class\r
++2005-04-05 Ritvik Mayank <mritvik@novell.com>
++ * 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 <mritvik@novell.com>
+ * ConditionalStatementsC10.vb
+ * ConstructorC1.vb
+ * ExceptionHandlingC4.vb
+ * MustInheritC3.vb
+ * ExceptionHandlingC6.vb
+ * ModuleTestC4.vb
+ * InterfaceC6.vb
+ * ExternalSourceDirectivesC2.vb
+ * EnumC4.vb
+ Correction in Line No.
+
2005-03-18 Manjula GHM <mmanjula@novell.com>
Sudharsan V <vsudharsan@novell.com>
* Test cases for Type members and Like operator
--- /dev/null
--- /dev/null
++REM LineNo: 8\r
++REM ExpectedError: BC30649 \r
++REM ErrorMessage: Void is an unsupported type\r
++\r
++Imports System\r
++Module Test \r
++Sub main () \r
++Dim A = GetType(System.Void)\r
++Console.WriteLine(A)\r
++End Sub\r
++End Module\r
++
--- /dev/null
--- /dev/null
++'Author:
++' V. Sudharsan (vsudharsan@novell.com)
++'
++' (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
++2005-04-04 Ritvik Mayank <mritvik@novell.com>
++ * Moved the test cases to respective directories
++
2005-03-24 Manjula GHM <mmanjula@novell.com>
* Corrected GotoStatementA.vb and removed ^M in all tests
2005-03-24 Manjula GHM <mmanjula@novell.com>
--- /dev/null
--- /dev/null
++'Author: Ritvik Mayank <mritvik@novell.com>
++'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
--- /dev/null
--- /dev/null
++'Author: Ritvik Mayank <mritvik@novell.com>
++'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
--- /dev/null
--- /dev/null
++'Author: Ritvik Mayank <mritvik@novell.com>
++'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
--- /dev/null
--- /dev/null
++'Author: Ritvik Mayank <mritvik@novell.com>
++'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
--- /dev/null
--- /dev/null
++'Author: Ritvik Mayank <mritvik@novell.com>
++'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
--- /dev/null
--- /dev/null
++'Author: Ritvik Mayank <mritvik@novell.com>
++'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
--- /dev/null
--- /dev/null
++'Author: Ritvik Mayank <mritvik@novell.com>
++'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
--- /dev/null
--- /dev/null
++'Author: Ritvik Mayank <mritvik@novell.com>
++'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
--- /dev/null
--- /dev/null
++'Author: Ritvik Mayank <mritvik@novell.com>
++'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
--- /dev/null
--- /dev/null
++'Author: Ritvik Mayank <mritvik@novell.com>
++'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
--- /dev/null
--- /dev/null
++'Author: Ritvik Mayank <mritvik@novell.com>
++'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
--- /dev/null
--- /dev/null
++2005-04-05 Ritvik Mayank <mritvik@novell.com>
++ * 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 <mritvik@novell.com>
++ * Moved all the Attribute Test Cases to this folder
--- /dev/null
--- /dev/null
++2005-04-05 Ritvik Mayank <mritvik@novell.com>
++ * 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 <mritvik@novell.com>
++ Moved All the 'types' Test Cases to this directory
--- /dev/null
--- /dev/null
++'Author: Ritvik Mayank <mritvik@novell.com>
++'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
--- /dev/null
--- /dev/null
++'Author: Ritvik Mayank <mritvik@novell.com>
++'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
--- /dev/null
--- /dev/null
++'Author: Ritvik Mayank <mritvik@novell.com>
++'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
--- /dev/null
--- /dev/null
++'Author: Ritvik Mayank <mritvik@novell.com>
++'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
--- /dev/null
--- /dev/null
++'Author: Ritvik Mayank <mritvik@novell.com>
++'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
--- /dev/null
--- /dev/null
++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
--- /dev/null
--- /dev/null
++'Author: Ritvik Mayank <mritvik@novell.com>
++'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
--- /dev/null
--- /dev/null
++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
++