Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
畅游知识海洋
json
提交
693bfe43
J
json
项目概览
畅游知识海洋
/
json
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
json
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
693bfe43
编写于
11月 16, 2016
作者:
N
Niels
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' into feature/emplace
上级
b0f89655
0d72767b
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
35 addition
and
17 deletion
+35
-17
LICENSE.MIT
LICENSE.MIT
+1
-1
test/src/catch.hpp
test/src/catch.hpp
+34
-16
未找到文件。
LICENSE.MIT
浏览文件 @
693bfe43
The library
is licensed under the MIT License
JSON for Modern C++
is licensed under the MIT License
<http://opensource.org/licenses/MIT>:
Copyright (c) 2013-2016 Niels Lohmann
...
...
test/src/catch.hpp
浏览文件 @
693bfe43
/*
* Catch v1.5.
6
* Generated: 2016-
06-09 19:20:41.460328
* Catch v1.5.
8
* Generated: 2016-
10-26 12:07:30.938259
* ----------------------------------------------------------
* This file has been merged from multiple headers. Please don't edit it directly
* Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved.
...
...
@@ -3223,10 +3223,11 @@ namespace Catch {
bool
matches
(
TestCaseInfo
const
&
testCase
)
const
{
// All patterns in a filter must match for the filter to be a match
for
(
std
::
vector
<
Ptr
<
Pattern
>
>::
const_iterator
it
=
m_patterns
.
begin
(),
itEnd
=
m_patterns
.
end
();
it
!=
itEnd
;
++
it
)
for
(
std
::
vector
<
Ptr
<
Pattern
>
>::
const_iterator
it
=
m_patterns
.
begin
(),
itEnd
=
m_patterns
.
end
();
it
!=
itEnd
;
++
it
)
{
if
(
!
(
*
it
)
->
matches
(
testCase
)
)
return
false
;
return
true
;
}
return
true
;
}
};
...
...
@@ -4719,8 +4720,11 @@ namespace Catch {
std
::
string
line
;
while
(
std
::
getline
(
f
,
line
)
)
{
line
=
trim
(
line
);
if
(
!
line
.
empty
()
&&
!
startsWith
(
line
,
"#"
)
)
addTestOrTags
(
config
,
"
\"
"
+
line
+
"
\"
,"
);
if
(
!
line
.
empty
()
&&
!
startsWith
(
line
,
"#"
)
)
{
if
(
!
startsWith
(
line
,
"
\"
"
)
)
line
=
"
\"
"
+
line
+
"
\"
"
;
addTestOrTags
(
config
,
line
+
","
);
}
}
}
...
...
@@ -5368,7 +5372,10 @@ namespace Catch {
++
it
)
{
matchedTests
++
;
TestCaseInfo
const
&
testCaseInfo
=
it
->
getTestCaseInfo
();
Catch
::
cout
()
<<
testCaseInfo
.
name
<<
std
::
endl
;
if
(
startsWith
(
testCaseInfo
.
name
,
"#"
)
)
Catch
::
cout
()
<<
"
\"
"
<<
testCaseInfo
.
name
<<
"
\"
"
<<
std
::
endl
;
else
Catch
::
cout
()
<<
testCaseInfo
.
name
<<
std
::
endl
;
}
return
matchedTests
;
}
...
...
@@ -6454,7 +6461,7 @@ namespace Catch {
namespace
Catch
{
struct
RandomNumberGenerator
{
typedef
in
t
result_type
;
typedef
std
::
ptrdiff_
t
result_type
;
result_type
operator
()(
result_type
n
)
const
{
return
std
::
rand
()
%
n
;
}
...
...
@@ -7571,7 +7578,7 @@ namespace Catch {
return
os
;
}
Version
libraryVersion
(
1
,
5
,
6
,
""
,
0
);
Version
libraryVersion
(
1
,
5
,
8
,
""
,
0
);
}
...
...
@@ -7802,8 +7809,11 @@ namespace Catch {
bool
contains
(
std
::
string
const
&
s
,
std
::
string
const
&
infix
)
{
return
s
.
find
(
infix
)
!=
std
::
string
::
npos
;
}
char
toLowerCh
(
char
c
)
{
return
static_cast
<
char
>
(
::
tolower
(
c
)
);
}
void
toLowerInPlace
(
std
::
string
&
s
)
{
std
::
transform
(
s
.
begin
(),
s
.
end
(),
s
.
begin
(),
::
tolower
);
std
::
transform
(
s
.
begin
(),
s
.
end
(),
s
.
begin
(),
toLowerCh
);
}
std
::
string
toLower
(
std
::
string
const
&
s
)
{
std
::
string
lc
=
s
;
...
...
@@ -8951,9 +8961,10 @@ namespace Catch {
break
;
default:
// Escape control chars - based on contribution by @espenalb in PR #465
// Escape control chars - based on contribution by @espenalb in PR #465 and
// by @mrpi PR #588
if
(
(
c
<
'\x09'
)
||
(
c
>
'\x0D'
&&
c
<
'\x20'
)
||
c
==
'\x7F'
)
os
<<
"&#x"
<<
std
::
uppercase
<<
std
::
hex
<<
st
atic_cast
<
int
>
(
c
)
;
os
<<
"&#x"
<<
std
::
uppercase
<<
std
::
hex
<<
st
d
::
setfill
(
'0'
)
<<
std
::
setw
(
2
)
<<
static_cast
<
int
>
(
c
)
<<
';'
;
else
os
<<
c
;
}
...
...
@@ -9008,13 +9019,20 @@ namespace Catch {
:
m_tagIsOpen
(
false
),
m_needsNewline
(
false
),
m_os
(
&
Catch
::
cout
()
)
{}
{
// We encode control characters, which requires
// XML 1.1
// see http://stackoverflow.com/questions/404107/why-are-control-characters-illegal-in-xml-1-0
*
m_os
<<
"<?xml version=
\"
1.1
\"
encoding=
\"
UTF-8
\"
?>
\n
"
;
}
XmlWriter
(
std
::
ostream
&
os
)
:
m_tagIsOpen
(
false
),
m_needsNewline
(
false
),
m_os
(
&
os
)
{}
{
*
m_os
<<
"<?xml version=
\"
1.1
\"
encoding=
\"
UTF-8
\"
?>
\n
"
;
}
~
XmlWriter
()
{
while
(
!
m_tags
.
empty
()
)
...
...
@@ -9181,7 +9199,7 @@ namespace Catch {
virtual
void
testCaseStarting
(
TestCaseInfo
const
&
testInfo
)
CATCH_OVERRIDE
{
StreamingReporterBase
::
testCaseStarting
(
testInfo
);
m_xml
.
startElement
(
"TestCase"
).
writeAttribute
(
"name"
,
t
rim
(
testInfo
.
name
)
);
m_xml
.
startElement
(
"TestCase"
).
writeAttribute
(
"name"
,
t
estInfo
.
name
);
if
(
m_config
->
showDurations
()
==
ShowDurations
::
Always
)
m_testCaseTimer
.
start
();
...
...
@@ -9243,7 +9261,7 @@ namespace Catch {
.
writeText
(
assertionResult
.
getMessage
()
);
break
;
case
ResultWas
::
FatalErrorCondition
:
m_xml
.
scopedElement
(
"Fatal
Error
Condition"
)
m_xml
.
scopedElement
(
"Fatal
Error
Condition"
)
.
writeAttribute
(
"filename"
,
assertionResult
.
getSourceInfo
().
file
)
.
writeAttribute
(
"line"
,
assertionResult
.
getSourceInfo
().
line
)
.
writeText
(
assertionResult
.
getMessage
()
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录