2004-08-26 Anirban Bhattacharjee <banirban@novell.com>
authorAnirban Bhattacharjee <anirban@mono-cvs.ximian.com>
Thu, 26 Aug 2004 03:27:30 +0000 (03:27 -0000)
committerAnirban Bhattacharjee <anirban@mono-cvs.ximian.com>
Thu, 26 Aug 2004 03:27:30 +0000 (03:27 -0000)
        Following tests are submtted by Manish Sinha <manishkumarsinha@sify.com>
        * Arguments_ByValueA:
        * Arguments_ByValueB:
        * Arguments_ByValueC:
        * Arguments_ByValueD:
        * Arguments_ByReferenceA:
        * Arguments_ByReferenceB:
        * Arguments_ByReferenceC:
        * Arguments_ByReferenceD:
        * Function_ArguByValueA:
        * Function_ArguByValueB:
        * Function_ArguByValueC:
        * Function_ArguByValueD:
        * Function_ArguByReferenceA:
        * Function_ArguByReferenceB:
        * Function_ArguByReferenceC:
        * Function_ArguByReferenceD:
        * ParamArrayA:
        * ParamArrayB:
        * Function_ParamArrayA:
        * Function_ParamArrayB:
        * Function_ParamArrayc:
        * ParamArrayC2:
        * Function_ParamArrayC1:
        * Function_ParamArrayC2:
        * Function_ParamArrayC3:
        * Function_ParamArrayC4i:
        * Test.Sources: Included new test

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

28 files changed:
mcs/btests/Arguments_ByReferenceA.vb [new file with mode: 0644]
mcs/btests/Arguments_ByReferenceB.vb [new file with mode: 0644]
mcs/btests/Arguments_ByReferenceC.vb [new file with mode: 0644]
mcs/btests/Arguments_ByReferenceD.vb [new file with mode: 0644]
mcs/btests/Arguments_ByValueA.vb [new file with mode: 0644]
mcs/btests/Arguments_ByValueB.vb [new file with mode: 0644]
mcs/btests/Arguments_ByValueC.vb [new file with mode: 0644]
mcs/btests/Arguments_ByValueD.vb [new file with mode: 0644]
mcs/btests/ChangeLog
mcs/btests/FunctionArgu_ByReferenceA.vb [new file with mode: 0644]
mcs/btests/FunctionArgu_ByReferenceB.vb [new file with mode: 0644]
mcs/btests/FunctionArgu_ByReferenceC.vb [new file with mode: 0644]
mcs/btests/FunctionArgu_ByReferenceD.vb [new file with mode: 0644]
mcs/btests/FunctionArgu_ByValueA.vb [new file with mode: 0644]
mcs/btests/FunctionArgu_ByValueB.vb [new file with mode: 0644]
mcs/btests/FunctionArgu_ByValueC.vb [new file with mode: 0644]
mcs/btests/FunctionArgu_ByValueD.vb [new file with mode: 0644]
mcs/btests/Function_ParamArrayA.vb [new file with mode: 0644]
mcs/btests/Function_ParamArrayB.vb [new file with mode: 0644]
mcs/btests/Function_ParamArrayC.vb [new file with mode: 0644]
mcs/btests/Function_ParamArrayC1.vb [new file with mode: 0644]
mcs/btests/Function_ParamArrayC2.vb [new file with mode: 0644]
mcs/btests/Function_ParamArrayC3.vb [new file with mode: 0644]
mcs/btests/Function_ParamArrayC4.vb [new file with mode: 0644]
mcs/btests/ParamArrayA.vb [new file with mode: 0644]
mcs/btests/ParamArrayB.vb [new file with mode: 0644]
mcs/btests/ParamArrayC2.vb [new file with mode: 0644]
mcs/btests/Test.Sources

diff --git a/mcs/btests/Arguments_ByReferenceA.vb b/mcs/btests/Arguments_ByReferenceA.vb
new file mode 100644 (file)
index 0000000..90e9916
--- /dev/null
@@ -0,0 +1,24 @@
+'==========================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Argument passing by Reference:\r
+'APR-1.0.0: Argument Passing by Reference, which means the procedure can modify the variable\r
+'              itself.\r
+'===========================================================================================\r
+\r
+Imports System\r
+Module APR_1_0_0\r
+       Sub F(ByRef p As Integer)\r
+      p += 1\r
+       End Sub \r
+   \r
+   Sub Main()\r
+      Dim a As Integer = 1\r
+      F(a)\r
+       if (a=1)\r
+               Throw New System.Exception("#A1, Unexcepted Behaviour in Arguments_ByReferenceA.vb")\r
+       end if\r
+   End Sub \r
+End Module\r
+\r
+'============================================================================================
\ No newline at end of file
diff --git a/mcs/btests/Arguments_ByReferenceB.vb b/mcs/btests/Arguments_ByReferenceB.vb
new file mode 100644 (file)
index 0000000..159e77d
--- /dev/null
@@ -0,0 +1,25 @@
+'=============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Argument passing by Reference:\r
+'APR-1.4.0: If procedure is define by passing argument by reference and while calling the\r
+'               procedure it is passes by giving parentheses around the variable then it protect\r
+'               it from change \r
+'=============================================================================================\r
+\r
+Imports System\r
+Module APR_1_4_0\r
+       Sub F(ByRef p As Integer)\r
+      p += 1\r
+   End Sub \r
+   \r
+   Sub Main()\r
+      Dim a As Integer = 1\r
+      F((a))\r
+               if(a<>1)\r
+               Throw new System.Exception ("#A1, Unexpected behavior in Arguments_ByReferenceB.vb")\r
+               end if\r
+   End Sub \r
+End Module\r
+\r
+'==============================================================================================
\ No newline at end of file
diff --git a/mcs/btests/Arguments_ByReferenceC.vb b/mcs/btests/Arguments_ByReferenceC.vb
new file mode 100644 (file)
index 0000000..9bc3990
--- /dev/null
@@ -0,0 +1,23 @@
+'=============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Argument passing by Reference:\r
+'APR-1.1.0: If variable elements is of value type, i.e. it contains only a value then procedure '              can change the variable or any of its members\r
+'=============================================================================================\r
\r
+Imports System\r
+Module APR_1_1_0\r
+       Sub F(ByRef p As String)\r
+               p = "Sinha"\r
+       End Sub \r
+   \r
+       Sub Main()\r
+       Dim a As String = "Manish"\r
+       F(a)\r
+               if (a="Manish")\r
+               Throw New System.Exception("#A1, Unexcepted behaviour of ByRef of String Datatype")\r
+               end if\r
+       End Sub \r
+End Module\r
+\r
+'=============================================================================================
\ No newline at end of file
diff --git a/mcs/btests/Arguments_ByReferenceD.vb b/mcs/btests/Arguments_ByReferenceD.vb
new file mode 100644 (file)
index 0000000..7d829ef
--- /dev/null
@@ -0,0 +1,51 @@
+'==============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Argument passing by Reference:\r
+'APR-1.3.0: If the variable elements is of reference type i.e. it contain a pointers to a class\r
+'              then procedure can change the members of instance to which it points  \r
+'==============================================================================================\r
+\r
+Imports System\r
+Imports System.Array\r
+Module APR_1_3_0\r
+\r
+       Public Sub Increase(ByRef A() As Long)\r
+               Dim J As Integer\r
+               For J = 0 To 3\r
+                       A(J) = A(J) + 1\r
+               Next J\r
+       End Sub\r
+   ' ...\r
+       Public Sub Replace(ByRef A() As Long)\r
+               Dim J As Integer\r
+               Dim K() As Long = {100, 200, 300,400}\r
+               A = K\r
+               For J = 0 To 3\r
+               A(J) = A(J) + 1\r
+               Next J\r
+       End Sub\r
+ ' ...\r
+       \r
+   Sub Main()\r
+      Dim N() As Long = {10, 20, 30, 40}\r
+       Dim N1() As Long = {11, 21, 31, 41}\r
+       Dim N2() As Long = {101, 201, 301, 401}\r
+       Dim i As Integer\r
+       Increase(N)\r
+       For i = 0 to 3\r
+       if (N(i) <> N1(i))\r
+               Throw New System.Exception("#A1, Unexception Behaviour in Increase Function")\r
+       end if\r
+       Next i\r
+       Replace(N)\r
+       For i= 0 to 3\r
+       if ( N(i) <> N2(i))\r
+               Throw New System.Exception("#A2, Unexception Behaviour in Increase Function")\r
+       end if\r
+       Next i\r
+\r
+   End Sub \r
+End Module\r
+\r
+'==============================================================================================
\ No newline at end of file
diff --git a/mcs/btests/Arguments_ByValueA.vb b/mcs/btests/Arguments_ByValueA.vb
new file mode 100644 (file)
index 0000000..8636a87
--- /dev/null
@@ -0,0 +1,22 @@
+'==========================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Argument passing by Value:\r
+'APV-1.0.0: Argument Passing by value, which means the procedure cannot modify the variable\r
+'              itself.\r
+'==========================================================================================\r
+Imports System\r
+Module APV1_0\r
+       Sub F(ByVal p As Integer)\r
+      p += 1\r
+   End Sub \r
+   \r
+   Sub Main()\r
+      Dim a As Integer = 1\r
+      F(a)\r
+       if a<>1\r
+               Throw new System.Exception("#A1, Unexcepted behaviour")\r
+       end if\r
+   End Sub \r
+End Module\r
+'============================================================================================
\ No newline at end of file
diff --git a/mcs/btests/Arguments_ByValueB.vb b/mcs/btests/Arguments_ByValueB.vb
new file mode 100644 (file)
index 0000000..ee60cb0
--- /dev/null
@@ -0,0 +1,22 @@
+'=============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Argument passing by Value:\r
+'APV-1.4.0: By Default VB pass arguments by values, i.e if procedure is pass without mentioning\r
+'              type then it take as ByVal type\r
+'=============================================================================================\r
+Imports System\r
+Module APV1_4_0\r
+       Sub F(p As Integer)\r
+      p += 1\r
+   End Sub \r
+   \r
+   Sub Main()\r
+      Dim a As Integer = 1\r
+      F(a)\r
+       if a<>1\r
+               Throw new System.Exception("#A1, uncexcepted behaviour of Default VB pass arguments")\r
+       end if\r
+   End Sub \r
+End Module\r
+'=============================================================================================
\ No newline at end of file
diff --git a/mcs/btests/Arguments_ByValueC.vb b/mcs/btests/Arguments_ByValueC.vb
new file mode 100644 (file)
index 0000000..1707e9c
--- /dev/null
@@ -0,0 +1,22 @@
+'=============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Argument passing by Value:\r
+'APV-1.1.0: If variable elements is of value type, i.e. it contains only a value then procedure '              cannot change the variable or any of its members\r
+'=============================================================================================\r
+\r
+Imports System\r
+Module APV1_1_0\r
+       Sub F(p As String)\r
+       p = "Sinha"\r
+   End Sub \r
+   \r
+   Sub Main()\r
+      Dim a As String = "Manish"\r
+      F(a)\r
+       if a<>"Manish"\r
+               Throw New System.Exception("#A1, Unexcepted behaviour in string of APV1_1_0")\r
+       end if\r
+   End Sub \r
+End Module\r
+'=============================================================================================
\ No newline at end of file
diff --git a/mcs/btests/Arguments_ByValueD.vb b/mcs/btests/Arguments_ByValueD.vb
new file mode 100644 (file)
index 0000000..1608661
--- /dev/null
@@ -0,0 +1,50 @@
+'=============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Argument passing by Value:\r
+'APV-1.0.0: If the variable elements is of reference type i.e. it contain a pointers to a class\r
+'              then procedure can change the members of instance to which it points  \r
+'==============================================================================================\r
+\r
+Imports System\r
+Imports System.Array\r
+Module APV1_0\r
+\r
+       Public Sub Increase(ByVal A() As Long)\r
+               Dim J As Integer\r
+               For J = 0 To 3\r
+                       A(J) = A(J) + 1\r
+               Next J\r
+       End Sub\r
+   ' ...\r
+       Public Sub Replace(ByVal A() As Long)\r
+               Dim J As Integer\r
+               Dim K() As Long = {100, 200, 300, 400}\r
+               A = K\r
+               For J = 0 To 3\r
+               A(J) = A(J) + 1\r
+               Next J\r
+       End Sub\r
+ ' ...\r
+       \r
+   Sub Main()\r
+      Dim N() As Long = {10, 20, 30, 40}\r
+       Dim N1() As Long = {11, 21, 31, 41}\r
+       Dim N2() As Long = {100, 200, 300, 400}\r
+       Dim i As Integer\r
+       Increase(N)\r
+       For i=0 To 3\r
+               if(N(i)<>N1(i))\r
+               Throw new System.Exception ("#A1, Unexpected behavior in Increase function")\r
+               end if\r
+       Next i\r
+       i=0     \r
+       Replace(N)\r
+       For i=0 To 3\r
+               if(N(i)=N2(i))\r
+               Throw new System.Exception ("#A2, Unexpected behavior in Replace function")\r
+               end if\r
+       Next i\r
+   End Sub \r
+End Module\r
+'============================================================================================
\ No newline at end of file
index da69c4bdaad2df5ba69cf552c9cecf55bec5d179..b3e80d54f56c2983b969275b63bbaf8165b72ec0 100644 (file)
@@ -1,3 +1,33 @@
+2004-08-26 Anirban Bhattacharjee <banirban@novell.com>
+       Following tests are submtted by Manish Sinha <manishkumarsinha@sify.com>
+       * Arguments_ByValueA:
+       * Arguments_ByValueB:
+       * Arguments_ByValueC:
+       * Arguments_ByValueD:
+       * Arguments_ByReferenceA:
+       * Arguments_ByReferenceB:
+       * Arguments_ByReferenceC:
+       * Arguments_ByReferenceD:
+       * Function_ArguByValueA:
+       * Function_ArguByValueB:
+       * Function_ArguByValueC:
+       * Function_ArguByValueD:
+       * Function_ArguByReferenceA:
+       * Function_ArguByReferenceB:
+       * Function_ArguByReferenceC:
+       * Function_ArguByReferenceD:
+       * ParamArrayA:
+       * ParamArrayB:
+       * Function_ParamArrayA:
+       * Function_ParamArrayB:
+       * Function_ParamArrayc:
+       * ParamArrayC2:
+       * Function_ParamArrayC1:
+       * Function_ParamArrayC2:
+       * Function_ParamArrayC3:
+       * Function_ParamArrayC4i:
+       * Test.Sources: Included new test
+
 2004-08-25 Sachin Kumar <skumar1@novell.com>
        * ConditionalStatementsC.vb: 
                Added small test for nested Select Case Statement 
diff --git a/mcs/btests/FunctionArgu_ByReferenceA.vb b/mcs/btests/FunctionArgu_ByReferenceA.vb
new file mode 100644 (file)
index 0000000..28e47d2
--- /dev/null
@@ -0,0 +1,26 @@
+'==========================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Argument passing by Reference:\r
+'APR-1.0.0: Argument Passing by Reference, which means the procedure can modify the variable\r
+'              itself.\r
+'===========================================================================================\r
+\r
+Imports System\r
+Module APR_1_0_0\r
+       Function F(ByRef p As Integer) as Integer\r
+      p += 1\r
+       return p\r
+       End Function\r
+   \r
+   Sub Main()\r
+      Dim a As Integer = 1\r
+       Dim b as Integer = 0\r
+      b=F(a)\r
+       if (b<>a)\r
+               Throw New System.Exception("#A1, Unexcepted Behaviour in Arguments_ByReferenceA.vb")\r
+       end if\r
+   End Sub \r
+End Module\r
+\r
+'============================================================================================
\ No newline at end of file
diff --git a/mcs/btests/FunctionArgu_ByReferenceB.vb b/mcs/btests/FunctionArgu_ByReferenceB.vb
new file mode 100644 (file)
index 0000000..33c4396
--- /dev/null
@@ -0,0 +1,26 @@
+'=============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Argument passing by Reference:\r
+'APR-1.4.0: If procedure is define by passing argument by reference and while calling the\r
+'               procedure it is passes by giving parentheses around the variable then it protect\r
+'               it from change \r
+'=============================================================================================\r
+\r
+Imports System\r
+Module APR_1_4_0\r
+       Function F(ByRef p As Integer) as Integer\r
+      p += 1\r
+       return p\r
+   End Function \r
+   \r
+   Sub Main()\r
+      Dim a As Integer = 1\r
+       Dim b As Integer = 0\r
+      b=F((a))\r
+               if(b=a)\r
+               Throw new System.Exception ("#A1, Unexpected behavior in Arguments_ByReferenceB.vb")\r
+               end if\r
+   End Sub \r
+End Module\r
+'=============================================================================================
\ No newline at end of file
diff --git a/mcs/btests/FunctionArgu_ByReferenceC.vb b/mcs/btests/FunctionArgu_ByReferenceC.vb
new file mode 100644 (file)
index 0000000..603e6d4
--- /dev/null
@@ -0,0 +1,25 @@
+'=============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Argument passing by Reference:\r
+'APR-1.1.0: If variable elements is of value type, i.e. it contains only a value then procedure '              can change the variable or any of its members\r
+'=============================================================================================\r
\r
+Imports System\r
+Module APR_1_1_0\r
+       Function F(ByRef p As String) as String\r
+               p = "Sinha"\r
+               return p\r
+       End Function \r
+   \r
+       Sub Main()\r
+       Dim a As String = "Manish"\r
+       Dim b As String = ""\r
+       b=F(a)\r
+               if (b<>a)\r
+               Throw New System.Exception("#A1, Unexcepted behaviour of ByRef of String Datatype")\r
+               end if\r
+       End Sub \r
+End Module\r
+\r
+'=============================================================================================
\ No newline at end of file
diff --git a/mcs/btests/FunctionArgu_ByReferenceD.vb b/mcs/btests/FunctionArgu_ByReferenceD.vb
new file mode 100644 (file)
index 0000000..c0455cf
--- /dev/null
@@ -0,0 +1,53 @@
+'==============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Argument passing by Reference:\r
+'APR-1.3.0: If the variable elements is of reference type i.e. it contain a pointers to a class\r
+'              then procedure can change the members of instance to which it points  \r
+'==============================================================================================\r
+\r
+Imports System\r
+Imports System.Array\r
+Module APR_1_3_0\r
+\r
+       Public Function Increase(ByRef A() As Long) As Long()\r
+               Dim J As Integer\r
+               For J = 0 To 3\r
+                       A(J) = A(J) + 1\r
+               Next J\r
+               return A\r
+       End Function\r
+   ' ...\r
+       Public Function Replace(ByRef A() As Long) As Long()\r
+               Dim J As Integer\r
+               Dim K() As Long = {100, 200, 300,400}\r
+               A = K\r
+               For J = 0 To 3\r
+               A(J) = A(J) + 1\r
+               Next J\r
+               return A\r
+       End Function\r
+ ' ...\r
+       \r
+   Sub Main()\r
+      Dim N() As Long = {10, 20, 30, 40}\r
+       Dim N1(3) As Long\r
+       Dim N2(3) As Long \r
+       Dim i As Integer\r
+       N1=Increase(N)\r
+       For i = 0 to 3\r
+       if (N(i) <> N1(i))\r
+               Throw New System.Exception("#A1, Unexception Behaviour in Increase Function")\r
+       end if\r
+       Next i\r
+       N2=Replace(N)\r
+       For i= 0 to 3\r
+       if ( N(i) <> N2(i))\r
+               Throw New System.Exception("#A2, Unexception Behaviour in Increase Function")\r
+       end if\r
+       Next i\r
+\r
+   End Sub \r
+End Module\r
+\r
+'==============================================================================================
\ No newline at end of file
diff --git a/mcs/btests/FunctionArgu_ByValueA.vb b/mcs/btests/FunctionArgu_ByValueA.vb
new file mode 100644 (file)
index 0000000..05703df
--- /dev/null
@@ -0,0 +1,24 @@
+'==========================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Argument passing by Value:\r
+'APV-1.0.0: Argument Passing by value, which means the procedure cannot modify the variable\r
+'              itself.\r
+'==========================================================================================\r
+Imports System\r
+Module APV1_0\r
+       Function  F(ByVal p As Integer) As Integer\r
+               p += 1\r
+               return p\r
+       End Function \r
+   \r
+   Sub Main()\r
+      Dim a As Integer = 1\r
+      Dim b As Integer = 0 \r
+       b = F(a)\r
+       if b=a\r
+               Throw new System.Exception("#A1, Unexcepted behaviour")\r
+       end if\r
+   End Sub \r
+End Module\r
+'==========================================================================================
\ No newline at end of file
diff --git a/mcs/btests/FunctionArgu_ByValueB.vb b/mcs/btests/FunctionArgu_ByValueB.vb
new file mode 100644 (file)
index 0000000..251f9f6
--- /dev/null
@@ -0,0 +1,24 @@
+'=============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Argument passing by Value:\r
+'APV-1.4.0: By Default VB pass arguments by values, i.e if procedure is pass without mentioning\r
+'              type then it take as ByVal type\r
+'=============================================================================================\r
+Imports System\r
+Module APV1_4_0\r
+       Function F(p As Integer) as Integer\r
+      p += 1\r
+       return p\r
+   End Function\r
+   \r
+   Sub Main()\r
+      Dim a As Integer = 1\r
+       Dim b as Integer = 0\r
+      b = F(a)\r
+       if b=a\r
+               Throw new System.Exception("#A1, uncexcepted behaviour of Default VB pass arguments")\r
+       end if\r
+   End Sub \r
+End Module\r
+'============================================================================================
\ No newline at end of file
diff --git a/mcs/btests/FunctionArgu_ByValueC.vb b/mcs/btests/FunctionArgu_ByValueC.vb
new file mode 100644 (file)
index 0000000..1c8f845
--- /dev/null
@@ -0,0 +1,24 @@
+'=============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Argument passing by Value:\r
+'APV-1.1.0: If variable elements is of value type, i.e. it contains only a value then procedure '              cannot change the variable or any of its members\r
+'=============================================================================================\r
+\r
+Imports System\r
+Module APV1_1_0\r
+       Function F(p As String) As String\r
+       p = "Sinha"\r
+       return p\r
+   End Function\r
+   \r
+   Sub Main()\r
+      Dim a As String = "Manish"\r
+       Dim b as String = ""\r
+      b = F(a)\r
+       if a=b\r
+               Throw New System.Exception("#A1, Unexcepted behaviour in string of APV1_1_0")\r
+       end if\r
+   End Sub \r
+End Module\r
+'===========================================================================================
\ No newline at end of file
diff --git a/mcs/btests/FunctionArgu_ByValueD.vb b/mcs/btests/FunctionArgu_ByValueD.vb
new file mode 100644 (file)
index 0000000..d0cd427
--- /dev/null
@@ -0,0 +1,51 @@
+'=============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Argument passing by Value:\r
+'APV-1.0.0: If the variable elements is of reference type i.e. it contain a pointers to a class\r
+'              then procedure can change the members of instance to which it points  \r
+'==============================================================================================\r
+\r
+Imports System\r
+Imports System.Array\r
+Module APV1_0\r
+\r
+        Function Increase(ByVal A() As Long) As Long()\r
+               Dim J As Integer\r
+               For J = 0 To 3\r
+                       A(J) = A(J) + 1\r
+               Next J\r
+               return A\r
+       End Function\r
+   ' ...\r
+        Function Replace(ByVal A() As Long) As Long()\r
+               Dim J As Integer\r
+               Dim K() As Long = {100, 200, 300, 400}\r
+               A = K\r
+               For J = 0 To 3\r
+               A(J) = A(J) + 1\r
+               Next J\r
+               return A\r
+       End Function\r
+ ' ...\r
+       \r
+   Sub Main()\r
+      Dim N() As Long = {10, 20, 30, 40}\r
+       Dim N1() As Long = {0,0,0,0}\r
+       Dim N2(3) As Long \r
+       Dim i As Integer\r
+       N1=Increase(N)\r
+       For i=0 To 3\r
+               if(N(i)<>N1(i))\r
+               Throw new System.Exception ("#A1, Unexpected behavior in Increase function")\r
+               end if\r
+       Next i  \r
+       N2=Replace(N)\r
+       For i=0 To 3\r
+               if(N(i)=N2(i))\r
+               Throw new System.Exception ("#A2, Unexpected behavior in Replace function")\r
+               end if\r
+       Next i\r
+   End Sub \r
+End Module\r
+'===========================================================================================
\ No newline at end of file
diff --git a/mcs/btests/Function_ParamArrayA.vb b/mcs/btests/Function_ParamArrayA.vb
new file mode 100644 (file)
index 0000000..591be48
--- /dev/null
@@ -0,0 +1,34 @@
+'============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Param Array:\r
+'APR-1.2.1: If ParamArray modifier is precied by ByVal modifier the it produces doesn't\r
+'              produces compiler error\r
+'============================================================================================\r
+Imports System\r
+Module PA_1_2_1\r
+   Function F(ParamArray ByVal args() As Integer)As Integer\r
+     Dim a as integer\r
+       a = args.Length\r
+       return a\r
+   End Function\r
+   Sub Main()\r
+      Dim a As Integer() = { 1, 2, 3 }\r
+     Dim b as Integer\r
+       b= F(a)\r
+       if b<>3\r
+               Throw New System.Exception("#A1, Unexcepted Behaviour in F(a)")\r
+       end if\r
+\r
+      b = F(10, 20, 30, 40)\r
+       if b<>4\r
+               Throw New System.Exception("#A2, Unexcepted Behaviour in F(10,20,30,40)")\r
+       end if\r
+      b = F()\r
+       if b<>0\r
+               Throw New System.Exception("#A3, Unexcepted Behaviour in F()")\r
+       end if\r
+   End Sub\r
+End Module\r
+\r
+'============================================================================================
\ No newline at end of file
diff --git a/mcs/btests/Function_ParamArrayB.vb b/mcs/btests/Function_ParamArrayB.vb
new file mode 100644 (file)
index 0000000..ea2d544
--- /dev/null
@@ -0,0 +1,32 @@
+'============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: ParamArray:\r
+'APR-1.0.0: ParamArray can be used only on the last argument of argument list. it allows us to 'pass an arbitrary list. It allows us to pass an arbitrary number of argument to the procedure \r
+'=============================================================================================\r
+Imports System\r
+Module PA_1_0_0\r
+   Function F(ParamArray args() As Integer)as Integer\r
+      Dim a as integer\r
+       a = args.Length\r
+       return a\r
+   End Function\r
+   Sub Main()\r
+      Dim a As Integer() = { 1, 2, 3 }\r
+      Dim b as Integer\r
+       b= F(a)\r
+       if b<>3\r
+               Throw New System.Exception("#A1, Unexcepted Behaviour in F(a)")\r
+       end if\r
+\r
+      b = F(10, 20, 30, 40)\r
+       if b<>4\r
+               Throw New System.Exception("#A2, Unexcepted Behaviour in F(10,20,30,40)")\r
+       end if\r
+      b = F()\r
+       if b<>0\r
+               Throw New System.Exception("#A3, Unexcepted Behaviour in F()")\r
+       end if\r
+   End Sub\r
+End Module\r
+'=============================================================================================
\ No newline at end of file
diff --git a/mcs/btests/Function_ParamArrayC.vb b/mcs/btests/Function_ParamArrayC.vb
new file mode 100644 (file)
index 0000000..be00e17
--- /dev/null
@@ -0,0 +1,29 @@
+'============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: ParamArray:\r
+'APR-1.0.0: ParamArray can be used only on the last argument of argument list. it allows us to 'pass an arbitrary list. It allows us to pass an arbitrary number of argument to the procedure \r
+'=============================================================================================\r
+Imports System\r
+Module PA_1_0_0\r
+   Function F(ByVal b as Integer ,ParamArray args() As Integer)as Boolean\r
+      Dim a as integer\r
+       a = args.Length\r
+       if a=b\r
+       return true\r
+       else \r
+       return false\r
+       end if\r
+   End Function\r
+   Sub Main()\r
+      Dim a As Integer() = { 1, 2, 3 }\r
+       Dim c as Integer\r
+       c = a.Length\r
+      Dim b as Boolean\r
+       b= F(c,a)\r
+       if b<>true\r
+               Throw New System.Exception("#A1, Unexcepted Behaviour in F(a)")\r
+       end if\r
+   End Sub\r
+End Module\r
+'=============================================================================================
\ No newline at end of file
diff --git a/mcs/btests/Function_ParamArrayC1.vb b/mcs/btests/Function_ParamArrayC1.vb
new file mode 100644 (file)
index 0000000..301c228
--- /dev/null
@@ -0,0 +1,30 @@
+'============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: ParamArray:\r
+'APR-1.0.0: ParamArray can be used only on the last argument of argument list. it allows us to 'pass an arbitrary list. It allows us to pass an arbitrary number of argument to the procedure \r
+'=============================================================================================\r
+Imports System\r
+Module PA_1_0_0\r
+   Function F(ParamArray args() As Integer,ParamArray args1() As Integer)as Boolean\r
+      Dim a as integer\r
+       Dim b as integer\r
+       a = args.Length\r
+       b = args1.Length\r
+       if a<>b\r
+       return true\r
+       else \r
+       return false\r
+       end if\r
+   End Function\r
+   Sub Main()\r
+      Dim a As Integer() = { 1, 2, 3 }\r
+       Dim b As Integer() = { 1, 2, 3,4 }\r
+      Dim e as Boolean\r
+       e= F(a,b)\r
+       if e<>true\r
+               Throw New System.Exception("#A1, Unexcepted Behaviour in F(a,b)")\r
+       end if\r
+   End Sub\r
+End Module\r
+'=============================================================================================
\ No newline at end of file
diff --git a/mcs/btests/Function_ParamArrayC2.vb b/mcs/btests/Function_ParamArrayC2.vb
new file mode 100644 (file)
index 0000000..f741396
--- /dev/null
@@ -0,0 +1,24 @@
+'=============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Param Array:\r
+'APR-1.1.1:If ParamArray modifier is precied by ByRef modifier the it produces compiler error \r
+'=============================================================================================\r
+Imports System\r
+Module PA_1_1_1\r
+   Function F(ParamArray ByRef args() As Integer) As Integer()\r
+      Dim i As Integer\r
+      For Each i In args\r
+         Console.Write(" " & i)\r
+      Next i\r
+      Console.WriteLine()\r
+   End Function\r
+   Sub Main()\r
+      Dim a As Integer() = { 1, 2, 3 }\r
+\r
+      F(a)\r
+      F(10, 20, 30, 40)\r
+      F()\r
+   End Sub\r
+End Module\r
+'================================================================================
\ No newline at end of file
diff --git a/mcs/btests/Function_ParamArrayC3.vb b/mcs/btests/Function_ParamArrayC3.vb
new file mode 100644 (file)
index 0000000..1a57a0d
--- /dev/null
@@ -0,0 +1,29 @@
+'============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: ParamArray:\r
+'APR-1.0.0: ParamArray can be used only on the last argument of argument list. it allows us to 'pass an arbitrary list. It allows us to pass an arbitrary number of argument to the procedure \r
+'=============================================================================================\r
+Imports System\r
+Module PA_1_0_0\r
+   Function F(ParamArray args() As Integer, ByVal b as Integer)as Boolean\r
+      Dim a as integer\r
+       a = args.Length\r
+       if a=b\r
+       return true\r
+       else \r
+       return false\r
+       end if\r
+   End Function\r
+   Sub Main()\r
+      Dim a As Integer() = { 1, 2, 3 }\r
+       Dim c as Integer\r
+       c = a.Length\r
+      Dim b as Boolean\r
+       b= F(a,c)\r
+       if b<>true\r
+               Throw New System.Exception("#A1, Unexcepted Behaviour in F(a,c)")\r
+       end if\r
+   End Sub\r
+End Module\r
+'=============================================================================================
\ No newline at end of file
diff --git a/mcs/btests/Function_ParamArrayC4.vb b/mcs/btests/Function_ParamArrayC4.vb
new file mode 100644 (file)
index 0000000..22c8c60
--- /dev/null
@@ -0,0 +1,34 @@
+'============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: ParamArray:\r
+'APR-1.0.0: ParamArray can be used only on the last argument of argument list. it allows us to 'pass an arbitrary list. It allows us to pass an arbitrary number of argument to the procedure \r
+'=============================================================================================\r
+Imports System\r
+Module PA_1_0_0\r
+   Function F(ParamArray args() As Integer,ParamArray args1() As Integer, ByVal a as Integer, ByVal b as Integer)as Boolean\r
+      Dim a as integer\r
+       Dim b as integer\r
+       a = args.Length\r
+       b = args1.Length\r
+       if a<>b\r
+       return true\r
+       else \r
+       return false\r
+       end if\r
+   End Function\r
+   Sub Main()\r
+      Dim a As Integer() = { 1, 2, 3 }\r
+       Dim b As Integer() = { 1, 2, 3,4 }\r
+       Dim c as Integer = 0\r
+       Dim d as Integer = 0\r
+       c = a.Length\r
+       d = b.Length\r
+      Dim e as Boolean\r
+       e= F(a,b,c,d)\r
+       if e<>true\r
+               Throw New System.Exception("#A1, Unexcepted Behaviour in F(a)")\r
+       end if\r
+   End Sub\r
+End Module\r
+'=============================================================================================
\ No newline at end of file
diff --git a/mcs/btests/ParamArrayA.vb b/mcs/btests/ParamArrayA.vb
new file mode 100644 (file)
index 0000000..cc68616
--- /dev/null
@@ -0,0 +1,25 @@
+'============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Param Array:\r
+'APR-1.2.1: If ParamArray modifier is precied by ByVal modifier the it produces doesn't\r
+'              produces compiler error\r
+'============================================================================================\r
+Imports System\r
+Module PA_1_2_1\r
+   Sub F(ParamArray ByVal args() As Integer)\r
+       Dim a as Integer\r
+       a = args.Length\r
+       if a=0\r
+               Throw New System.Exception("#A1, Unexcepted behavoiur of PARAM ARRAY")\r
+       end if\r
+\r
+   End Sub\r
+   Sub Main()\r
+      Dim a As Integer() = { 1, 2, 3 }\r
+      F(a)\r
+      F(10, 20, 30, 40)\r
+   End Sub\r
+End Module\r
+\r
+'=================================================================================
\ No newline at end of file
diff --git a/mcs/btests/ParamArrayB.vb b/mcs/btests/ParamArrayB.vb
new file mode 100644 (file)
index 0000000..b1d3c5f
--- /dev/null
@@ -0,0 +1,22 @@
+'============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: ParamArray:\r
+'APR-1.0.0: ParamArray can be used only on the last argument of argument list. it allows us to 'pass an arbitrary list. It allows us to pass an arbitrary number of argument to the procedure \r
+'=============================================================================================\r
+Imports System\r
+Module PA_1_0_0\r
+   Sub F(ParamArray args() As Integer)\r
+       Dim a as Integer\r
+       a=args.Length\r
+       if a=0\r
+               Throw New System.Exception("#A1, Unexcepted behavoiur of PARAM ARRAY")\r
+       end if\r
+   End Sub\r
+   Sub Main()\r
+      Dim a As Integer() = { 1, 2, 3 }\r
+      F(a)\r
+      F(10, 20, 30, 40)\r
+   End Sub\r
+End Module\r
+'=============================================================================================
\ No newline at end of file
diff --git a/mcs/btests/ParamArrayC2.vb b/mcs/btests/ParamArrayC2.vb
new file mode 100644 (file)
index 0000000..5cf23d0
--- /dev/null
@@ -0,0 +1,23 @@
+'=============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Param Array:\r
+'APR-1.1.1:If ParamArray modifier is precied by ByRef modifier the it produces compiler error \r
+'=============================================================================================\r
+Imports System\r
+Module PA_1_1_1\r
+   Sub F(ParamArray ByRef args() As Integer)\r
+       Dim a as Integer\r
+       a = args.Length\r
+       if a=0\r
+               Throw New System.Exception("#A1, Unexcepted behavoiur of PARAM ARRAY")\r
+       end if\r
+\r
+   End Sub\r
+   Sub Main()\r
+      Dim a As Integer() = { 1, 2, 3 }\r
+      F(a)\r
+      F(10, 20, 30, 40)\r
+   End Sub\r
+End Module\r
+'================================================================================
\ No newline at end of file
index 6ba2ca157ae4b727f8457a5323964530943eea45..51d97adaf5577d94c646087517d2c53cbff91504 100644 (file)
@@ -13,6 +13,7 @@ Event_dll \
 #
 
 TEST_SOURCES = \
+NameSpaceTest\* \
 LabelA \
 LabelB \
 LabelC \
@@ -160,6 +161,27 @@ EventF \
 EventG \
 EventH \
 Event_exe \
+Arguments_ByValueA \
+Arguments_ByValueB \
+Arguments_ByValueC \
+Arguments_ByValueD \
+Arguments_ByReferenceA \
+Arguments_ByReferenceB \
+Arguments_ByReferenceC \
+Arguments_ByReferenceD \
+Function_ArguByValueA \
+Function_ArguByValueB \
+Function_ArguByValueC \
+Function_ArguByValueD \
+Function_ArguByReferenceA \
+Function_ArguByReferenceB \
+Function_ArguByReferenceC \
+Function_ArguByReferenceD \
+ParamArrayA \
+ParamArrayB \
+Function_ParamArrayA \
+Function_ParamArrayB \
+Function_ParamArrayc \
 AssignmentOperators \
 RelationalOperators \
 RelationalOperatorsA \
@@ -365,6 +387,11 @@ PropertyC10 \
 PropertyC11 \
 DelegateC1 \
 DelegateC2 \
+ParamArrayC2 \
+Function_ParamArrayC1 \
+Function_ParamArrayC2 \
+Function_ParamArrayC3 \
+Function_ParamArrayC4 \
 ConcatenationOperatorC1 \
 LogicalOperatorsC1 \
 LogicalOperatorsC2 \