Changeset 491 for trunk/TestCase
- Timestamp:
- Mar 22, 2008, 2:00:18 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/TestCase/SimpleTestCase/DelegateTest.ab
r356 r491 1 1 Namespace DelegateTest 2 3 Class StringEx 4 Inherits String 5 Public 6 Sub StringEx( str As String ) 7 String( str ) 8 End Sub 9 End Class 2 10 3 11 Delegate Sub Callback1() 4 12 Delegate Function Callback2() As Long 5 13 Delegate Sub Callback3( a As Long ) 6 Delegate Sub Callback4( a As String )14 Delegate Sub Callback4( a As StringEx ) 7 15 Delegate Function Callback7( str As String ) As String 8 9 16 10 17 Class TestClass … … 61 68 End Sub 62 69 63 Static Function Proc7( str As String ) As String 64 Return "Proc7 result[" + str + "]"70 Static Function Proc7( str As String ) As StringEx 71 Return New StringEx( "Proc7 result[" + str + "]" ) 65 72 End Function 66 73 … … 84 91 dg2() 85 92 dg3( 100 ) 86 dg4( "Proc4 calling" )93 dg4( New StringEx( "Proc4 calling" ) ) ' 反変引数サポートのテスト 87 94 88 95 UnitTest( "Delegate1", testObj.CheckFlags() ) 89 96 90 Dim dg7 = New Callback7( AddressOf(TestClass.Proc7) ) 97 Dim dg7 = New Callback7( AddressOf(TestClass.Proc7) ) ' 共変戻り値サポートのテスト 91 98 UnitTest( "Delegate2", dg7( "test value" ) = "Proc7 result[test value]" ) 92 99
Note:
See TracChangeset
for help on using the changeset viewer.