Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
abaeff6a
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
abaeff6a
编写于
11月 20, 2015
作者:
J
Jared Parsons
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #6916 from TyOverby/6744-no-copy-fuzz
Don't copy a massive byte-array for fuzz testing
上级
9bb8aab9
f9d2867d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
19 addition
and
10 deletion
+19
-10
src/Compilers/CSharp/Test/Syntax/CSharpCompilerSyntaxTest.csproj
...pilers/CSharp/Test/Syntax/CSharpCompilerSyntaxTest.csproj
+3
-2
src/Compilers/CSharp/Test/Syntax/Parsing/ParserRegressionTests.cs
...ilers/CSharp/Test/Syntax/Parsing/ParserRegressionTests.cs
+16
-8
未找到文件。
src/Compilers/CSharp/Test/Syntax/CSharpCompilerSyntaxTest.csproj
浏览文件 @
abaeff6a
...
...
@@ -61,6 +61,7 @@
</ItemGroup>
<PropertyGroup
Condition=
" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "
>
<CodeAnalysisRuleSet>
..\..\..\..\..\build\TestProjectRules.ruleset
</CodeAnalysisRuleSet>
<AllowUnsafeBlocks>
true
</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup
Condition=
" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "
>
<CodeAnalysisRuleSet>
..\..\..\..\..\build\TestProjectRules.ruleset
</CodeAnalysisRuleSet>
...
...
@@ -102,7 +103,7 @@
<Compile
Include=
"Parsing\CrefParsingTests.cs"
/>
<Compile
Include=
"Parsing\DeclarationParsingTests.cs"
/>
<Compile
Include=
"Parsing\ExpressionParsingTests.cs"
/>
<Compile
Include=
"Parsing\
FuzzTesting
.cs"
/>
<Compile
Include=
"Parsing\
ParserRegressionTests
.cs"
/>
<Compile
Include=
"Parsing\ScriptParsingTests.cs"
/>
<Compile
Include=
"Parsing\LambdaParameterParsingTests.cs"
/>
<Compile
Include=
"Parsing\NameAttributeValueParsingTests.cs"
/>
...
...
@@ -171,4 +172,4 @@
<Import
Project=
"..\..\..\..\..\build\Targets\VSL.Imports.targets"
/>
<Import
Project=
"..\..\..\..\..\build\Targets\Roslyn.Toolsets.Xunit.targets"
/>
</ImportGroup>
</Project>
</Project>
\ No newline at end of file
src/Compilers/CSharp/Test/Syntax/Parsing/
FuzzTesting
.cs
→
src/Compilers/CSharp/Test/Syntax/Parsing/
ParserRegressionTests
.cs
浏览文件 @
abaeff6a
...
...
@@ -9,7 +9,7 @@
namespace
Microsoft.CodeAnalysis.CSharp.UnitTests.Parsing
{
public
class
FuzzTesting
:
CSharpTestBase
public
class
ParserRegressionTests
:
CSharpTestBase
{
[
WorkItem
(
540005
,
"DevDiv"
)]
[
Fact
]
...
...
@@ -83,16 +83,24 @@ public void c024928()
[
Fact
]
public
void
TestBinary
()
{
//
use a fixed seed so the test is reproducible
//
Apparently this fixed seed exposed a bug at some point
var
random
=
new
System
.
Random
(
12345
);
const
int
n
=
40
*
1000
*
1000
;
// 40 million "character"s
var
builder
=
new
StringBuilder
(
n
+
10
);
for
(
int
i
=
0
;
i
<
n
;
i
++)
// 40 million "character"s
const
int
n
=
40
*
1000
*
1000
;
var
str
=
new
string
(
' '
,
n
);
unsafe
{
builder
.
Append
((
char
)
random
.
Next
(
0xffff
));
fixed
(
char
*
chars
=
str
)
{
for
(
int
i
=
0
;
i
<
n
;
i
++)
{
chars
[
i
]
=
(
char
)
random
.
Next
(
char
.
MaxValue
);
}
}
}
var
source
=
builder
.
ToString
();
var
tree
=
CSharpSyntaxTree
.
ParseText
(
s
ource
);
var
tree
=
CSharpSyntaxTree
.
ParseText
(
s
tr
);
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录