In tests/attributes:
authorRitvik Mayank <mritvik@mono-cvs.ximian.com>
Tue, 5 Apr 2005 05:28:55 +0000 (05:28 -0000)
committerRitvik Mayank <mritvik@mono-cvs.ximian.com>
Tue, 5 Apr 2005 05:28:55 +0000 (05:28 -0000)
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
In tests:
2005-04-04 Ritvik Mayank <mritvik@novell.com>
* Moved the test cases to respective directories

In errors:
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>
Moved All the 'types' Test Cases to this directory
In tests/types:
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

svn path=/trunk/mcs/; revision=42548

35 files changed:
1  2 
mcs/mbas/Test/errors/AttributesArguments1.vb
mcs/mbas/Test/errors/AttributesArguments2.vb
mcs/mbas/Test/errors/AttributesArguments3.vb
mcs/mbas/Test/errors/AttributesArguments4.vb
mcs/mbas/Test/errors/AttributesClassC1.vb
mcs/mbas/Test/errors/AttributesClassUseA1.vb
mcs/mbas/Test/errors/AttributesClassUseADate1.vb
mcs/mbas/Test/errors/AttributesClassUseADecimal1.vb
mcs/mbas/Test/errors/AttributesClassUseNoSingle1.vb
mcs/mbas/Test/errors/AttributesMustInheritClassA1.vb
mcs/mbas/Test/errors/ChangeLog
mcs/mbas/Test/errors/TypeValRefVoidA1.vb
mcs/mbas/Test/rerrors/Scope1.vb
mcs/mbas/Test/tests/ChangeLog
mcs/mbas/Test/tests/attributes/AttributesClassA.vb
mcs/mbas/Test/tests/attributes/AttributesClassB.vb
mcs/mbas/Test/tests/attributes/AttributesClassBothSuffixA.vb
mcs/mbas/Test/tests/attributes/AttributesClassC.vb
mcs/mbas/Test/tests/attributes/AttributesClassNoparameterA.vb
mcs/mbas/Test/tests/attributes/AttributesClassUseA.vb
mcs/mbas/Test/tests/attributes/AttributesClassUseB.vb
mcs/mbas/Test/tests/attributes/AttributesClassUseC.vb
mcs/mbas/Test/tests/attributes/AttributesClassUseD.vb
mcs/mbas/Test/tests/attributes/AttributesNewA.vb
mcs/mbas/Test/tests/attributes/AttributesNewB.vb
mcs/mbas/Test/tests/attributes/ChangeLog
mcs/mbas/Test/tests/types/ChangeLog
mcs/mbas/Test/tests/types/TypeObjectA.vb
mcs/mbas/Test/tests/types/TypeStructureA.vb
mcs/mbas/Test/tests/types/TypeValRefA.vb
mcs/mbas/Test/tests/types/TypeValRefArrayA.vb
mcs/mbas/Test/tests/types/TypeValRefB.vb
mcs/mbas/Test/tests/types/TypeValRefC.vb
mcs/mbas/Test/tests/types/TypeValRefStringA.vb
mcs/mbas/Test/tests/types/TypeValRefVoidA1.vb

index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..3de7a442a3ba46c10c34b0c135c78a1ee1b9dcdc
new file mode 100755 (executable)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,33 @@@
++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 
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..fd4c06e736a4cc93c272869a0594d1a4616793b1
new file mode 100755 (executable)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,34 @@@
++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 
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..4a3ef0ee8b18f00c47b6747b5e35d3334bc35b9b
new file mode 100755 (executable)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,33 @@@
++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 
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..95fe83683afb83af94322803ee495e25e5fcc50b
new file mode 100755 (executable)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,24 @@@
++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 
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..0f5eb0338e6fed74d2d8c40e6b099be67b60d1ff
new file mode 100755 (executable)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,30 @@@
++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
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..1f2e3c0e055c0a03603ea7a7ea8a02ce4622fb67
new file mode 100755 (executable)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,41 @@@
++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
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..159e043f3dfd7d1eecf796b2c89aca3fe50b5b05
new file mode 100755 (executable)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,47 @@@
++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
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..1f36d4beef30ac34831ccffec5b7e02a1555a38b
new file mode 100755 (executable)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,46 @@@
++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
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..a3b1a653d1968084ddd5add4f8e4c39fb811519e
new file mode 100755 (executable)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,40 @@@
++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
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..2b3bd27abd38dbf0e6cbad17c52fc2e4d81a7766
new file mode 100755 (executable)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,35 @@@
++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
index bb0d5613eb2776d2ad1d2bcb9ed6311590d8507d,23490c6b1acdf05d7baeea7e256cad26cb46727e..b09385969fc33a0c1717a288d85ba6e88f811e45
@@@ -1,15 -1,3 +1,29 @@@
++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
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..a4ad180cf1866832eeed89eed44940b2082b0ced
new file mode 100755 (executable)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,12 @@@
++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
++ 
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..41b860741c7a6ae21ec3a9d9798ab342d2898acd
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,35 @@@
++'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
index b03e26fd2136b61e177e0b9d3355cea1d4819c2a,b03e26fd2136b61e177e0b9d3355cea1d4819c2a..32963d38f04eec7b90aa14760da26c12ec4ea1e6
@@@ -1,3 -1,3 +1,6 @@@
++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>
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..14e95e43cefd34b656c8cf054b9a08cd78919f8a
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,36 @@@
++'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
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..36eb191fe5e9cffd04ed6fe46b9d67e0c98381e7
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,36 @@@
++'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
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..833cac4ca10d2f5c34315ccb3f527667680e3c40
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,37 @@@
++'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
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..7c352a2f9d8e5f968e15e0fde957c50b56cadd7e
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,30 @@@
++'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
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..de159360e6813fa074f5a263ab1363a3181f2bd4
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,34 @@@
++'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
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..c121fb94ae9203a558474fff5f6e3814cef29ab9
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,39 @@@
++'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 
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..c1ae5ede18945f521fb7b46d89f688afc78e992e
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,39 @@@
++'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 
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..0e12473309f7cf19655ee994c835b49efeb9fdd6
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,39 @@@
++'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 
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..627f7b96acaeb8437ad4045fcb38a838bef683b7
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,39 @@@
++'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 
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..fa72074f117970b48483f5834e15b381802a5049
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,35 @@@
++'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
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..915bb885c8ce4b745e56ff6af8435cbc57e40f50
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,34 @@@
++'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
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..c6fb7c3299c6ecc9138dc07a6294fd6066f0a928
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,16 @@@
++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
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..0f55b5816acd68e5bf7be477c095ac346af7b5d8
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,13 @@@
++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 
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..96ef21aa4fd67562ac7636dbe0a921cc02d31c08
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,32 @@@
++'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
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..3acdfac3c45f273339d9142f96842e77b398454e
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,28 @@@
++'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
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..805778e5018f0fd585ee64fbe7dd8f397b3c73b6
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,39 @@@
++'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
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..2175e714e1ccd413f553a4ee155215747446ac24
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,16 @@@
++'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
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..a9401df176e561c27af43d339b21271033eb53fe
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,22 @@@
++'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
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..a5e862d19560e64843170ad4cafd21c7323bc9dd
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,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
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..534885230ee00d4b7c4ac099f97d802873bccf20
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,19 @@@
++'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
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..0b065e2fb70ff872a91ddad40b7c430f3bdd0271
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,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
++