+2005-02-11 Manjula GHM <mmanjula@novell.com>
+ * Added tests for Statements - by Sudharsan V <vsudharsan@novell.com>
2005-02-07 Ritvik Mayank <mritvik@novell.com>
* InterfaceC11.vb
\r
End Sub\r
\r
-End Module
\ No newline at end of file
+End Module\r
--- /dev/null
+'Author:
+' V. Sudharsan (vsudharsan@novell.com)
+'
+' (C) 2005 Novell, Inc.
+
+REM LineNo: 18\r
+REM ExpectedError: BC30065\r
+REM ErrorMessage: 'Exit Sub' is not valid in a Function or Property.\r
+\r
+Module exitstmt\r
+ Public Dim i as integer\r
+ Function fun()\r
+ Exit Function\r
+ i = i + 1\r
+ End function\r
+ Function fun1()\r
+ i = i + 1\r
+ Exit Sub\r
+ End function\r
+ Sub Main()\r
+ fun() \r
+ fun1()\r
+ if i <> 1 then\r
+ Throw new System.Exception("Exit statement not working properly ")\r
+ End If\r
+ End Sub\r
+End Module
--- /dev/null
+'Author:
+' V. Sudharsan (vsudharsan@novell.com)
+'
+' (C) 2005 Novell, Inc.
+
+REM LineNo: 12\r
+REM ExpectedError: BC30205\r
+REM ErrorMessage: End of statement expected.\r
+\r
+Module retstmt\r
+ Sub fun()\r
+ Exit sub 10\r
+ End Sub\r
+ Sub Main()\r
+ fun() \r
+ End Sub\r
+End Module
--- /dev/null
+'Author:
+' V. Sudharsan (vsudharsan@novell.com)
+'
+' (C) 2005 Novell, Inc.
+
+REM LineNo: 13\r
+REM ExpectedError: BC30132\r
+REM ErrorMessage: Label 'a' is not defined.\r
+\r
+Module gotostmt\r
+ Sub Main()\r
+ Dim i as integer\r
+ goto a:\r
+ i = i + 1\r
+ a1:\r
+ i = i + 1\r
+ if i <> 1 then\r
+ Throw new System.Exception("Goto statement not working properly ")\r
+ End If\r
+ End Sub\r
+End Module
--- /dev/null
+'Author:
+' V. Sudharsan (vsudharsan@novell.com)
+'
+' (C) 2005 Novell, Inc.
+
+REM LineNo: 20\r
+REM ExpectedError: BC30456\r
+REM ErrorMessage: 'a1' is not a member of 'A'.\r
+\r
+class A\r
+ public dim i as integer\r
+End class\r
+\r
+Module gotostmt\r
+ Sub Main()\r
+ Dim a as A = new A()\r
+ With a\r
+ goto .a1\r
+ .i = .i + 1\r
+ .a1:\r
+ .i = .i + 1\r
+ if .i <> 1 then\r
+ Throw new System.Exception("Goto statement not working properly ")\r
+ End If\r
+ End With\r
+ End Sub\r
+End Module
--- /dev/null
+'Author:
+' V. Sudharsan (vsudharsan@novell.com)
+'
+' (C) 2005 Novell, Inc.
+
+REM LineNo: 24\r
+REM ExpectedError: BC30451\r
+REM ErrorMessage: Name 'fun1' is not declared.\r
+\r
+Imports A\r
+\r
+Namespace A\r
+ public Module Test\r
+ Public Function fun()\r
+ End Function\r
+ Private Function fun1()\r
+ End Function\r
+ End module\r
+End Namespace\r
+\r
+Module SyncLockB\r
+ Sub Main()\r
+ Call fun() 'This is correct \r
+ Call fun1() 'This is wrong\r
+ End Sub\r
+End Module
--- /dev/null
+'Author:
+' V. Sudharsan (vsudharsan@novell.com)
+'
+' (C) 2005 Novell, Inc.
+
+REM LineNo: 12\r
+REM ExpectedError: BC30235\r
+REM ErrorMessage: 'Static' is not valid on a member variable declaration.\r
+\r
+Module M\r
+ Structure fun\r
+ Static Dim y as Integer \r
+ end Structure\r
+\r
+ Sub Main() \r
+ End Sub\r
+End Module
--- /dev/null
+'Author:
+' V. Sudharsan (vsudharsan@novell.com)
+'
+' (C) 2005 Novell, Inc.
+
+REM LineNo: 13\r
+REM ExpectedError: BC30288\r
+REM ErrorMessage: Local variable 'y' is already declared in the current block..\r
+\r
+Module M\r
+ Sub fun()\r
+ Static Dim y as Integer = 10\r
+ Dim y as Char\r
+ end Sub\r
+ Sub Main() \r
+ End Sub\r
+End Module
--- /dev/null
+'Author:
+' V. Sudharsan (vsudharsan@novell.com)
+'
+' (C) 2005 Novell, Inc.
+
+REM LineNo: 13\r
+REM ExpectedError: BC30247\r
+REM ErrorMessage: 'Shared' is not valid on a local variable declaration.\r
+\r
+Module M\r
+ Sub fun()\r
+ Static Dim y as Integer = 10\r
+ Shared Dim y1 as Integer = 10\r
+ end Sub\r
+ Sub Main() \r
+ End Sub\r
+End Module
--- /dev/null
+'Author:
+' V. Sudharsan (vsudharsan@novell.com)
+'
+' (C) 2005 Novell, Inc.
+
+REM LineNo: 12\r
+REM ExpectedError: BC30311\r
+REM ErrorMessage: Value of type 'Integer' cannot be converted to 'Date'.\r
+\r
+Module retstmt\r
+ Function fun() As Date\r
+ return 10\r
+ End Function\r
+ Sub Main()\r
+ Dim s as String = fun()\r
+ if s<>10 then\r
+ Throw new System.Exception("Return not working")\r
+ End if\r
+ End Sub\r
+End Module
--- /dev/null
+'Author:
+' V. Sudharsan (vsudharsan@novell.com)
+'
+' (C) 2005 Novell, Inc.
+
+REM LineNo: 12\r
+REM ExpectedError: BC30647\r
+REM ErrorMessage: 'Return' statement in a Sub or a Set cannot return a value.\r
+\r
+Module retstmt\r
+ Sub fun()\r
+ return 10\r
+ End Sub\r
+ Sub Main()\r
+ fun() \r
+ End Sub\r
+End Module