Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Unity
提交
96127581
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看板
未验证
提交
96127581
编写于
10月 31, 2018
作者:
K
Kochise
提交者:
GitHub
10月 31, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Some cleanup
上级
7d2bf62b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
24 addition
and
1 deletion
+24
-1
src/unity.c
src/unity.c
+24
-1
未找到文件。
src/unity.c
浏览文件 @
96127581
...
...
@@ -67,6 +67,7 @@ static const char UnityStrDetail2Name[] = " " UNITY_DETAIL2_NAME " ";
* Pretty Printers & Test Result Output Handlers
*-----------------------------------------------*/
/*-----------------------------------------------*/
void
UnityPrint
(
const
char
*
string
)
{
const
char
*
pch
=
string
;
...
...
@@ -116,6 +117,7 @@ void UnityPrint(const char* string)
}
}
/*-----------------------------------------------*/
void
UnityPrintLen
(
const
char
*
string
,
const
UNITY_UINT32
length
)
{
const
char
*
pch
=
string
;
...
...
@@ -479,6 +481,7 @@ static void UnityPrintExpectedAndActualStringsLen(const char* expected,
* Assertion & Control Helpers
*-----------------------------------------------*/
/*-----------------------------------------------*/
static
int
UnityIsOneArrayNull
(
UNITY_INTERNAL_PTR
expected
,
UNITY_INTERNAL_PTR
actual
,
const
UNITY_LINE_TYPE
lineNumber
,
...
...
@@ -511,6 +514,7 @@ static int UnityIsOneArrayNull(UNITY_INTERNAL_PTR expected,
* Assertion Functions
*-----------------------------------------------*/
/*-----------------------------------------------*/
void
UnityAssertBits
(
const
UNITY_INT
mask
,
const
UNITY_INT
expected
,
const
UNITY_INT
actual
,
...
...
@@ -704,12 +708,14 @@ void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected,
UnityPrint(UnityStrDelta)
#endif
/* UNITY_EXCLUDE_FLOAT_PRINT */
/*-----------------------------------------------*/
static
int
UnityFloatsWithin
(
UNITY_FLOAT
delta
,
UNITY_FLOAT
expected
,
UNITY_FLOAT
actual
)
{
UNITY_FLOAT
diff
;
UNITY_FLOAT_OR_DOUBLE_WITHIN
(
delta
,
expected
,
actual
,
diff
);
}
/*-----------------------------------------------*/
void
UnityAssertEqualFloatArray
(
UNITY_PTR_ATTRIBUTE
const
UNITY_FLOAT
*
expected
,
UNITY_PTR_ATTRIBUTE
const
UNITY_FLOAT
*
actual
,
const
UNITY_UINT32
num_elements
,
...
...
@@ -840,6 +846,7 @@ static int UnityDoublesWithin(UNITY_DOUBLE delta, UNITY_DOUBLE expected, UNITY_D
UNITY_FLOAT_OR_DOUBLE_WITHIN
(
delta
,
expected
,
actual
,
diff
);
}
/*-----------------------------------------------*/
void
UnityAssertEqualDoubleArray
(
UNITY_PTR_ATTRIBUTE
const
UNITY_DOUBLE
*
expected
,
UNITY_PTR_ATTRIBUTE
const
UNITY_DOUBLE
*
actual
,
const
UNITY_UINT32
num_elements
,
...
...
@@ -900,7 +907,6 @@ void UnityAssertDoublesWithin(const UNITY_DOUBLE delta,
}
/*-----------------------------------------------*/
void
UnityAssertDoubleSpecial
(
const
UNITY_DOUBLE
actual
,
const
char
*
msg
,
const
UNITY_LINE_TYPE
lineNumber
,
...
...
@@ -1259,6 +1265,7 @@ UNITY_INTERNAL_PTR UnityNumToPtr(const UNITY_INT num, const UNITY_UINT8 size)
}
#ifndef UNITY_EXCLUDE_FLOAT
/*-----------------------------------------------*/
UNITY_INTERNAL_PTR
UnityFloatToPtr
(
const
float
num
)
{
UnityQuickCompare
.
f
=
num
;
...
...
@@ -1267,6 +1274,7 @@ UNITY_INTERNAL_PTR UnityFloatToPtr(const float num)
#endif
#ifndef UNITY_EXCLUDE_DOUBLE
/*-----------------------------------------------*/
UNITY_INTERNAL_PTR
UnityDoubleToPtr
(
const
double
num
)
{
UnityQuickCompare
.
d
=
num
;
...
...
@@ -1278,6 +1286,7 @@ UNITY_INTERNAL_PTR UnityDoubleToPtr(const double num)
* Control Functions
*-----------------------------------------------*/
/*-----------------------------------------------*/
void
UnityFail
(
const
char
*
msg
,
const
UNITY_LINE_TYPE
line
)
{
RETURN_IF_FAIL_OR_IGNORE
;
...
...
@@ -1402,6 +1411,7 @@ char* UnityOptionIncludeNamed = NULL;
char
*
UnityOptionExcludeNamed
=
NULL
;
int
UnityVerbosity
=
1
;
/*-----------------------------------------------*/
int
UnityParseOptions
(
int
argc
,
char
**
argv
)
{
UnityOptionIncludeNamed
=
NULL
;
...
...
@@ -1458,6 +1468,7 @@ int UnityParseOptions(int argc, char** argv)
return
0
;
}
/*-----------------------------------------------*/
int
IsStringInBiggerString
(
const
char
*
longstring
,
const
char
*
shortstring
)
{
const
char
*
lptr
=
longstring
;
...
...
@@ -1496,9 +1507,11 @@ int IsStringInBiggerString(const char* longstring, const char* shortstring)
lptr
=
lnext
;
sptr
=
shortstring
;
}
return
0
;
}
/*-----------------------------------------------*/
int
UnityStringArgumentMatches
(
const
char
*
str
)
{
int
retval
;
...
...
@@ -1522,24 +1535,33 @@ int UnityStringArgumentMatches(const char* str)
if
((
ptr2
[
0
]
==
':'
)
&&
(
ptr2
[
1
]
!=
0
)
&&
(
ptr2
[
0
]
!=
'\''
)
&&
(
ptr2
[
0
]
!=
'"'
)
&&
(
ptr2
[
0
]
!=
','
))
ptrf
=
&
ptr2
[
1
];
}
while
((
ptr2
[
0
]
!=
0
)
&&
(
ptr2
[
0
]
!=
'\''
)
&&
(
ptr2
[
0
]
!=
'"'
)
&&
(
ptr2
[
0
]
!=
','
));
while
((
ptr2
[
0
]
!=
0
)
&&
((
ptr2
[
0
]
==
':'
)
||
(
ptr2
[
0
]
==
'\''
)
||
(
ptr2
[
0
]
==
'"'
)
||
(
ptr2
[
0
]
==
','
)))
{
ptr2
++
;
}
/* done if complete filename match */
retval
=
IsStringInBiggerString
(
Unity
.
TestFile
,
ptr1
);
if
(
retval
==
1
)
{
return
retval
;
}
/* done if testname match after filename partial match */
if
((
retval
==
2
)
&&
(
ptrf
!=
0
))
{
if
(
IsStringInBiggerString
(
Unity
.
CurrentTestName
,
ptrf
))
{
return
1
;
}
}
/* done if complete testname match */
if
(
IsStringInBiggerString
(
Unity
.
CurrentTestName
,
ptr1
)
==
1
)
{
return
1
;
}
ptr1
=
ptr2
;
}
...
...
@@ -1548,6 +1570,7 @@ int UnityStringArgumentMatches(const char* str)
return
0
;
}
/*-----------------------------------------------*/
int
UnityTestMatches
(
void
)
{
/* Check if this test name matches the included test pattern */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录