Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Unity
提交
03e2209e
T
Third Party Unity
项目概览
OpenHarmony
/
Third Party Unity
9 个月 前同步成功
通知
29
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看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
03e2209e
编写于
12月 03, 2016
作者:
J
jsalling
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename UNITY_SKIP_EXECUTION to RETURN_IF_FAIL_OR_IGNORE
上级
0603c1cf
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
20 deletion
+18
-20
src/unity.c
src/unity.c
+18
-20
未找到文件。
src/unity.c
浏览文件 @
03e2209e
...
...
@@ -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
)
{
...
...
@@ -583,7 +581,7 @@ void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected,
UNITY_INTERNAL_PTR
ptr_exp
=
(
UNITY_INTERNAL_PTR
)
expected
;
UNITY_INTERNAL_PTR
ptr_act
=
(
UNITY_INTERNAL_PTR
)
actual
;
UNITY_SKIP_EXECUTION
;
RETURN_IF_FAIL_OR_IGNORE
;
if
(
elements
==
0
)
{
...
...
@@ -731,7 +729,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
)
{
...
...
@@ -764,7 +762,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
))
...
...
@@ -787,7 +785,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
)
{
...
...
@@ -860,7 +858,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
)
{
...
...
@@ -893,7 +891,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
))
{
...
...
@@ -916,7 +914,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
)
{
...
...
@@ -980,7 +978,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
)
{
...
...
@@ -1019,7 +1017,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
)
...
...
@@ -1059,7 +1057,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
)
...
...
@@ -1100,7 +1098,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
)
...
...
@@ -1161,7 +1159,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
))
{
...
...
@@ -1206,7 +1204,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
();
...
...
@@ -1240,7 +1238,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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录