2004-09-23 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mcs / btests / Function_ParamArrayA.vb
1 '============================================================================================\r
2 'Name:Manish Kumar Sinha \r
3 'Email Address: manishkumarsinha@sify.com\r
4 'Test Case Name: Param Array:\r
5 'APR-1.2.1: If ParamArray modifier is precied by ByVal modifier the it produces doesn't\r
6 '               produces compiler error\r
7 '============================================================================================\r
8 Imports System\r
9 Module PA_1_2_1\r
10    Function F(ParamArray ByVal args() As Integer)As Integer\r
11      Dim a as integer\r
12         a = args.Length\r
13         return a\r
14    End Function\r
15    Sub Main()\r
16       Dim a As Integer() = { 1, 2, 3 }\r
17      Dim b as Integer\r
18         b= F(a)\r
19         if b<>3\r
20                 Throw New System.Exception("#A1, Unexcepted Behaviour in F(a)")\r
21         end if\r
22 \r
23       b = F(10, 20, 30, 40)\r
24         if b<>4\r
25                 Throw New System.Exception("#A2, Unexcepted Behaviour in F(10,20,30,40)")\r
26         end if\r
27       b = F()\r
28         if b<>0\r
29                 Throw New System.Exception("#A3, Unexcepted Behaviour in F()")\r
30         end if\r
31    End Sub\r
32 End Module\r
33 \r
34 '============================================================================================