Skip to content

Commit 4575a35

Browse files
Timur KelmanTimur Kelman
authored andcommitted
adjust other tests
1 parent 0e79753 commit 4575a35

3 files changed

Lines changed: 155 additions & 9 deletions

File tree

Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/CSharpRefReturn/RefReturnList.vb

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ Namespace CSharpRefReturn
33
Public Class RefReturnList(Of T)
44
Private dummy As T
55
''' Cannot convert IndexerDeclarationSyntax, System.InvalidCastException: Unable to cast object of type 'Microsoft.CodeAnalysis.VisualBasic.Syntax.EmptyStatementSyntax' to type 'Microsoft.CodeAnalysis.VisualBasic.Syntax.TypeSyntax'.
6-
''' at ICSharpCode.CodeConverter.VB.NodesVisitor.<>c__DisplayClass53_0.<ConvertPropertyBlock>b__1()
7-
''' at ICSharpCode.CodeConverter.VB.NodesVisitor.ConvertPropertyBlock(BasePropertyDeclarationSyntax node, SyntaxToken id, SyntaxTokenList modifiers, ParameterListSyntax parameterListSyntax, ArrowExpressionClauseSyntax arrowExpressionClauseSyntax, EqualsValueSyntax initializerOrNull)
8-
''' at ICSharpCode.CodeConverter.VB.NodesVisitor.VisitIndexerDeclaration(IndexerDeclarationSyntax node)
6+
''' at ICSharpCode.CodeConverter.VB.NodesVisitor.<>c__DisplayClass53_0.<ConvertPropertyBlock>b__1() in C:\_Work\thirdPartyTools\CodeConverter\CodeConverter\VB\NodesVisitor.cs:line 543
7+
''' at ICSharpCode.CodeConverter.VB.NodesVisitor.ConvertPropertyBlock(BasePropertyDeclarationSyntax node, SyntaxToken id, SyntaxTokenList modifiers, ParameterListSyntax parameterListSyntax, ArrowExpressionClauseSyntax arrowExpressionClauseSyntax, EqualsValueSyntax initializerOrNull) in C:\_Work\thirdPartyTools\CodeConverter\CodeConverter\VB\NodesVisitor.cs:line 576
8+
''' at ICSharpCode.CodeConverter.VB.NodesVisitor.VisitIndexerDeclaration(IndexerDeclarationSyntax node) in C:\_Work\thirdPartyTools\CodeConverter\CodeConverter\VB\NodesVisitor.cs:line 526
99
''' at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor`1.Visit(SyntaxNode node)
10-
''' at ICSharpCode.CodeConverter.VB.CommentConvertingVisitorWrapper`1.Accept(SyntaxNode csNode, Boolean addSourceMapping)
10+
''' at ICSharpCode.CodeConverter.VB.CommentConvertingVisitorWrapper`1.Accept(SyntaxNode csNode, Boolean addSourceMapping) in C:\_Work\thirdPartyTools\CodeConverter\CodeConverter\VB\CommentConvertingVisitorWrapper.cs:line 20
1111
'''
1212
''' Input:
1313
''' public ref T this[int i] {
@@ -16,6 +16,24 @@ Namespace CSharpRefReturn
1616
''' }
1717
''' }
1818
'''
19+
'''
20+
''' Cannot convert PropertyDeclarationSyntax, System.InvalidCastException: Unable to cast object of type 'Microsoft.CodeAnalysis.VisualBasic.Syntax.EmptyStatementSyntax' to type 'Microsoft.CodeAnalysis.VisualBasic.Syntax.TypeSyntax'.
21+
''' at ICSharpCode.CodeConverter.VB.NodesVisitor.<>c__DisplayClass53_0.<ConvertPropertyBlock>b__1() in C:\_Work\thirdPartyTools\CodeConverter\CodeConverter\VB\NodesVisitor.cs:line 543
22+
''' at ICSharpCode.CodeConverter.VB.NodesVisitor.ConvertPropertyBlock(BasePropertyDeclarationSyntax node, SyntaxToken id, SyntaxTokenList modifiers, ParameterListSyntax parameterListSyntax, ArrowExpressionClauseSyntax arrowExpressionClauseSyntax, EqualsValueSyntax initializerOrNull) in C:\_Work\thirdPartyTools\CodeConverter\CodeConverter\VB\NodesVisitor.cs:line 576
23+
''' at ICSharpCode.CodeConverter.VB.NodesVisitor.VisitPropertyDeclaration(PropertyDeclarationSyntax node) in C:\_Work\thirdPartyTools\CodeConverter\CodeConverter\VB\NodesVisitor.cs:line 514
24+
''' at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor`1.Visit(SyntaxNode node)
25+
''' at ICSharpCode.CodeConverter.VB.CommentConvertingVisitorWrapper`1.Accept(SyntaxNode csNode, Boolean addSourceMapping) in C:\_Work\thirdPartyTools\CodeConverter\CodeConverter\VB\CommentConvertingVisitorWrapper.cs:line 20
26+
'''
27+
''' Input:
28+
'''
29+
''' public ref T RefProperty
30+
''' {
31+
''' get
32+
''' {
33+
''' return ref this.dummy;
34+
''' }
35+
''' }
36+
'''
1937
'''
2038
End Class
2139
End Namespace
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{6266982D-4807-4619-A71D-1440D0B6B6F4}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<RootNamespace>VisualBasicUsesCSharpRefReturn</RootNamespace>
10+
<AssemblyName>VisualBasicUsesCSharpRefReturn</AssemblyName>
11+
<FileAlignment>512</FileAlignment>
12+
<MyType>Windows</MyType>
13+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
14+
<Deterministic>true</Deterministic>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<DebugSymbols>true</DebugSymbols>
18+
<DebugType>full</DebugType>
19+
<DefineDebug>true</DefineDebug>
20+
<DefineTrace>true</DefineTrace>
21+
<OutputPath>bin\Debug\</OutputPath>
22+
<DocumentationFile>VisualBasicUsesCSharpRefReturn.xml</DocumentationFile>
23+
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
24+
</PropertyGroup>
25+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26+
<DebugType>pdbonly</DebugType>
27+
<DefineDebug>false</DefineDebug>
28+
<DefineTrace>true</DefineTrace>
29+
<Optimize>true</Optimize>
30+
<OutputPath>bin\Release\</OutputPath>
31+
<DocumentationFile>VisualBasicUsesCSharpRefReturn.xml</DocumentationFile>
32+
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
33+
</PropertyGroup>
34+
<PropertyGroup>
35+
<OptionExplicit>On</OptionExplicit>
36+
</PropertyGroup>
37+
<PropertyGroup>
38+
<OptionCompare>Binary</OptionCompare>
39+
</PropertyGroup>
40+
<PropertyGroup>
41+
<OptionStrict>Off</OptionStrict>
42+
</PropertyGroup>
43+
<PropertyGroup>
44+
<OptionInfer>On</OptionInfer>
45+
</PropertyGroup>
46+
<ItemGroup>
47+
<Reference Include="System" />
48+
<Reference Include="System.Data" />
49+
<Reference Include="System.Xml" />
50+
<Reference Include="System.Core" />
51+
<Reference Include="System.Xml.Linq" />
52+
<Reference Include="System.Data.DataSetExtensions" />
53+
<Reference Include="System.Net.Http" />
54+
</ItemGroup>
55+
<ItemGroup>
56+
<Import Include="Microsoft.VisualBasic" />
57+
<Import Include="System" />
58+
<Import Include="System.Collections" />
59+
<Import Include="System.Collections.Generic" />
60+
<Import Include="System.Data" />
61+
<Import Include="System.Diagnostics" />
62+
<Import Include="System.Linq" />
63+
<Import Include="System.Xml.Linq" />
64+
<Import Include="System.Threading.Tasks" />
65+
</ItemGroup>
66+
<ItemGroup>
67+
<Compile Include="ByRefArgument.vb" />
68+
<Compile Include="My Project\AssemblyInfo.vb" />
69+
<Compile Include="My Project\Application.Designer.vb">
70+
<AutoGen>True</AutoGen>
71+
<DependentUpon>Application.myapp</DependentUpon>
72+
</Compile>
73+
<Compile Include="My Project\Resources.Designer.vb">
74+
<AutoGen>True</AutoGen>
75+
<DesignTime>True</DesignTime>
76+
<DependentUpon>Resources.resx</DependentUpon>
77+
</Compile>
78+
<Compile Include="My Project\Settings.Designer.vb">
79+
<AutoGen>True</AutoGen>
80+
<DependentUpon>Settings.settings</DependentUpon>
81+
<DesignTimeSharedInput>True</DesignTimeSharedInput>
82+
</Compile>
83+
<Compile Include="WithRefReturnStructure.vb" />
84+
</ItemGroup>
85+
<ItemGroup>
86+
<EmbeddedResource Include="My Project\Resources.resx">
87+
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
88+
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
89+
<CustomToolNamespace>My.Resources</CustomToolNamespace>
90+
<SubType>Designer</SubType>
91+
</EmbeddedResource>
92+
</ItemGroup>
93+
<ItemGroup>
94+
<None Include="My Project\Application.myapp">
95+
<Generator>MyApplicationCodeGenerator</Generator>
96+
<LastGenOutput>Application.Designer.vb</LastGenOutput>
97+
</None>
98+
<None Include="My Project\Settings.settings">
99+
<Generator>SettingsSingleFileGenerator</Generator>
100+
<CustomToolNamespace>My</CustomToolNamespace>
101+
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
102+
</None>
103+
</ItemGroup>
104+
<ItemGroup>
105+
<ProjectReference Include="..\CSharpRefReturn\CSharpRefReturn.vbproj">
106+
<Project>{39A0B42C-38C5-0F53-0E16-D1FFBA52E129}</Project>
107+
<Name>CSharpRefReturn</Name>
108+
</ProjectReference>
109+
</ItemGroup>
110+
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
111+
</Project>

Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/VisualBasicUsesCSharpRefReturn/ByRefArgument.cs

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,35 @@
1-

1+
using Microsoft.VisualBasic.CompilerServices;
2+
23
namespace VisualBasicUsesCSharpRefReturn
34
{
45
public class ByRefArgument
56
{
67
public void UseArr()
78
{
8-
var arr = default(object[]);
9-
Modify(ref arr[0]);
9+
var arrObj = default(object[]);
10+
Modify(ref arrObj[0]);
11+
12+
var arrInt = default(int[]);
13+
var tmp = arrInt;
14+
object argo = tmp[0];
15+
Modify(ref argo);
16+
tmp[0] = Conversions.ToInteger(argo);
1017
}
1118

1219
public void UseRefReturn()
1320
{
14-
var lst = default(CSharpRefReturn.RefReturnList<object>);
15-
Modify(ref lst[0]);
21+
var lstObj = default(CSharpRefReturn.RefReturnList<object>);
22+
Modify(ref lstObj[0]);
23+
Modify(ref lstObj.RefProperty);
24+
25+
var lstInt = default(CSharpRefReturn.RefReturnList<int>);
26+
var tmp = lstInt;
27+
object argo = tmp[0];
28+
Modify(ref argo);
29+
tmp[0] = Conversions.ToInteger(argo);
30+
object argo1 = lstInt.RefProperty;
31+
Modify(ref argo1);
32+
lstInt.RefProperty = Conversions.ToInteger(argo1);
1633
}
1734

1835
public void Modify(ref object o)

0 commit comments

Comments
 (0)