Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Unity
提交
85ef1092
T
Third Party Unity
项目概览
OpenHarmony
/
Third Party Unity
1 年多 前同步成功
通知
36
Star
144
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Unity
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
85ef1092
编写于
1月 13, 2017
作者:
M
Mark VanderVoord
提交者:
GitHub
1月 13, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #240 from jsalling/refactor/skip-exec
Rename UNITY_SKIP_EXECUTION to RETURN_IF_FAIL_OR_IGNORE
上级
6c0ca733
03e2209e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
20 deletion
+18
-20
src/unity.c
src/unity.c
+18
-20
未找到文件。
src/unity.c
浏览文件 @
85ef1092
...
...
@@ -12,12 +12,10 @@
void
UNITY_OUTPUT_CHAR
(
int
);
#endif
/* Helpful macros for us to use here */
/* Helpful macros for us to use here
in Assert functions
*/
#define UNITY_FAIL_AND_BAIL { Unity.CurrentTestFailed = 1; longjmp(Unity.AbortFrame, 1); }
#define UNITY_IGNORE_AND_BAIL { Unity.CurrentTestIgnored = 1; longjmp(Unity.AbortFrame, 1); }
/* return prematurely if we are already in failure or ignore state */
#define UNITY_SKIP_EXECUTION { if ((Unity.CurrentTestFailed != 0) || (Unity.CurrentTestIgnored != 0)) {return;} }
#define RETURN_IF_FAIL_OR_IGNORE if (Unity.CurrentTestFailed || Unity.CurrentTestIgnored) return
struct
UNITY_STORAGE_T
Unity
;
...
...
@@ -529,7 +527,7 @@ void UnityAssertBits(const UNITY_INT mask,
const
char
*
msg
,
const
UNITY_LINE_TYPE
lineNumber
)
{
UNITY_SKIP_EXECUTION
;
RETURN_IF_FAIL_OR_IGNORE
;
if
((
mask
&
expected
)
!=
(
mask
&
actual
))
{
...
...
@@ -550,7 +548,7 @@ void UnityAssertEqualNumber(const UNITY_INT expected,
const
UNITY_LINE_TYPE
lineNumber
,
const
UNITY_DISPLAY_STYLE_T
style
)
{
UNITY_SKIP_EXECUTION
;
RETURN_IF_FAIL_OR_IGNORE
;
if
(
expected
!=
actual
)
{
...
...
@@ -582,7 +580,7 @@ void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected,
UNITY_UINT32
elements
=
num_elements
;
unsigned
int
length
=
style
&
0xF
;
UNITY_SKIP_EXECUTION
;
RETURN_IF_FAIL_OR_IGNORE
;
if
(
num_elements
==
0
)
{
...
...
@@ -689,7 +687,7 @@ void UnityAssertEqualFloatArray(UNITY_PTR_ATTRIBUTE const UNITY_FLOAT* expected,
UNITY_PTR_ATTRIBUTE
const
UNITY_FLOAT
*
ptr_expected
=
expected
;
UNITY_PTR_ATTRIBUTE
const
UNITY_FLOAT
*
ptr_actual
=
actual
;
UNITY_SKIP_EXECUTION
;
RETURN_IF_FAIL_OR_IGNORE
;
if
(
elements
==
0
)
{
...
...
@@ -722,7 +720,7 @@ void UnityAssertFloatsWithin(const UNITY_FLOAT delta,
const
char
*
msg
,
const
UNITY_LINE_TYPE
lineNumber
)
{
UNITY_SKIP_EXECUTION
;
RETURN_IF_FAIL_OR_IGNORE
;
if
(
!
UnityFloatsWithin
(
delta
,
expected
,
actual
))
...
...
@@ -745,7 +743,7 @@ void UnityAssertFloatSpecial(const UNITY_FLOAT actual,
UNITY_INT
is_trait
=
!
should_be_trait
;
UNITY_INT
trait_index
=
(
UNITY_INT
)(
style
>>
1
);
UNITY_SKIP_EXECUTION
;
RETURN_IF_FAIL_OR_IGNORE
;
switch
(
style
)
{
...
...
@@ -818,7 +816,7 @@ void UnityAssertEqualDoubleArray(UNITY_PTR_ATTRIBUTE const UNITY_DOUBLE* expecte
UNITY_PTR_ATTRIBUTE
const
UNITY_DOUBLE
*
ptr_expected
=
expected
;
UNITY_PTR_ATTRIBUTE
const
UNITY_DOUBLE
*
ptr_actual
=
actual
;
UNITY_SKIP_EXECUTION
;
RETURN_IF_FAIL_OR_IGNORE
;
if
(
elements
==
0
)
{
...
...
@@ -851,7 +849,7 @@ void UnityAssertDoublesWithin(const UNITY_DOUBLE delta,
const
char
*
msg
,
const
UNITY_LINE_TYPE
lineNumber
)
{
UNITY_SKIP_EXECUTION
;
RETURN_IF_FAIL_OR_IGNORE
;
if
(
!
UnityDoublesWithin
(
delta
,
expected
,
actual
))
{
...
...
@@ -874,7 +872,7 @@ void UnityAssertDoubleSpecial(const UNITY_DOUBLE actual,
UNITY_INT
is_trait
=
!
should_be_trait
;
UNITY_INT
trait_index
=
(
UNITY_INT
)(
style
>>
1
);
UNITY_SKIP_EXECUTION
;
RETURN_IF_FAIL_OR_IGNORE
;
switch
(
style
)
{
...
...
@@ -938,7 +936,7 @@ void UnityAssertNumbersWithin( const UNITY_UINT delta,
const
UNITY_LINE_TYPE
lineNumber
,
const
UNITY_DISPLAY_STYLE_T
style
)
{
UNITY_SKIP_EXECUTION
;
RETURN_IF_FAIL_OR_IGNORE
;
if
((
style
&
UNITY_DISPLAY_RANGE_INT
)
==
UNITY_DISPLAY_RANGE_INT
)
{
...
...
@@ -977,7 +975,7 @@ void UnityAssertEqualString(const char* expected,
{
UNITY_UINT32
i
;
UNITY_SKIP_EXECUTION
;
RETURN_IF_FAIL_OR_IGNORE
;
/* if both pointers not null compare the strings */
if
(
expected
&&
actual
)
...
...
@@ -1017,7 +1015,7 @@ void UnityAssertEqualStringLen(const char* expected,
{
UNITY_UINT32
i
;
UNITY_SKIP_EXECUTION
;
RETURN_IF_FAIL_OR_IGNORE
;
/* if both pointers not null compare the strings */
if
(
expected
&&
actual
)
...
...
@@ -1058,7 +1056,7 @@ void UnityAssertEqualStringArray( const char** expected,
{
UNITY_UINT32
i
,
j
=
0
;
UNITY_SKIP_EXECUTION
;
RETURN_IF_FAIL_OR_IGNORE
;
/* if no elements, it's an error */
if
(
num_elements
==
0
)
...
...
@@ -1119,7 +1117,7 @@ void UnityAssertEqualMemory( UNITY_INTERNAL_PTR expected,
UNITY_UINT32
elements
=
num_elements
;
UNITY_UINT32
bytes
;
UNITY_SKIP_EXECUTION
;
RETURN_IF_FAIL_OR_IGNORE
;
if
((
elements
==
0
)
||
(
length
==
0
))
{
...
...
@@ -1164,7 +1162,7 @@ void UnityAssertEqualMemory( UNITY_INTERNAL_PTR expected,
void
UnityFail
(
const
char
*
msg
,
const
UNITY_LINE_TYPE
line
)
{
UNITY_SKIP_EXECUTION
;
RETURN_IF_FAIL_OR_IGNORE
;
UnityTestResultsBegin
(
Unity
.
TestFile
,
line
);
UnityPrintFail
();
...
...
@@ -1198,7 +1196,7 @@ void UnityFail(const char* msg, const UNITY_LINE_TYPE line)
/*-----------------------------------------------*/
void
UnityIgnore
(
const
char
*
msg
,
const
UNITY_LINE_TYPE
line
)
{
UNITY_SKIP_EXECUTION
;
RETURN_IF_FAIL_OR_IGNORE
;
UnityTestResultsBegin
(
Unity
.
TestFile
,
line
);
UnityPrint
(
UnityStrIgnore
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录