Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Unity
提交
54aa838c
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看板
提交
54aa838c
编写于
8月 27, 2016
作者:
J
jsalling
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Change the fallback isinf() macro to NOT need f_zero defined
Delete old comments from before math.h was the default isinf() method
上级
028ca953
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
4 addition
and
14 deletion
+4
-14
src/unity.c
src/unity.c
+0
-12
src/unity_internals.h
src/unity_internals.h
+4
-2
未找到文件。
src/unity.c
浏览文件 @
54aa838c
...
...
@@ -52,12 +52,6 @@ static const char UnityStrResultsIgnored[] = " Ignored ";
static
const
char
UnityStrDetail1Name
[]
=
UNITY_DETAIL1_NAME
" "
;
static
const
char
UnityStrDetail2Name
[]
=
" "
UNITY_DETAIL2_NAME
" "
;
#ifdef UNITY_FLOAT_NEEDS_ZERO
/* Dividing by these constants produces +/- infinity.
* The rationale is given in UnityAssertFloatIsInf's body. */
static
const
_UF
f_zero
=
0
.
0
f
;
#endif
/* compiler-generic print formatting masks */
static
const
_U_UINT
UnitySizeMask
[]
=
{
...
...
@@ -718,8 +712,6 @@ void UnityAssertFloatSpecial(const _UF actual,
switch
(
style
)
{
/* To determine Inf / Neg Inf, we compare to an Inf / Neg Inf value we create on the fly
* We are using a variable to hold the zero value because some compilers complain about dividing by zero otherwise */
case
UNITY_FLOAT_IS_INF
:
case
UNITY_FLOAT_IS_NOT_INF
:
is_trait
=
isinf
(
actual
)
&
ispos
(
actual
);
...
...
@@ -729,7 +721,6 @@ void UnityAssertFloatSpecial(const _UF actual,
is_trait
=
isinf
(
actual
)
&
isneg
(
actual
);
break
;
/* NaN is the only floating point value that does NOT equal itself. Therefore if Actual == Actual, then it is NOT NaN. */
case
UNITY_FLOAT_IS_NAN
:
case
UNITY_FLOAT_IS_NOT_NAN
:
is_trait
=
isnan
(
actual
);
...
...
@@ -864,8 +855,6 @@ void UnityAssertDoubleSpecial(const _UD actual,
switch
(
style
)
{
/* To determine Inf / Neg Inf, we compare to an Inf / Neg Inf value we create on the fly
* We are using a variable to hold the zero value because some compilers complain about dividing by zero otherwise */
case
UNITY_FLOAT_IS_INF
:
case
UNITY_FLOAT_IS_NOT_INF
:
is_trait
=
isinf
(
actual
)
&
ispos
(
actual
);
...
...
@@ -875,7 +864,6 @@ void UnityAssertDoubleSpecial(const _UD actual,
is_trait
=
isinf
(
actual
)
&
isneg
(
actual
);
break
;
/* NaN is the only floating point value that does NOT equal itself. Therefore if Actual == Actual, then it is NOT NaN. */
case
UNITY_FLOAT_IS_NAN
:
case
UNITY_FLOAT_IS_NOT_NAN
:
is_trait
=
isnan
(
actual
);
...
...
src/unity_internals.h
浏览文件 @
54aa838c
...
...
@@ -225,11 +225,13 @@ typedef _US64 _U_SINT;
typedef
UNITY_FLOAT_TYPE
_UF
;
#ifndef isinf
#define isinf(n) (((1.0f / f_zero) == n) ? 1 : 0) || (((-1.0f / f_zero) == n) ? 1 : 0)
#define
UNITY_FLOAT_NEEDS_ZERO
/* The value of Inf - Inf is NaN */
#define
isinf(n) (isnan((n) - (n)) && !isnan(n))
#endif
#ifndef isnan
/* NaN is the only floating point value that does NOT equal itself.
* Therefore if n != n, then it is NaN. */
#define isnan(n) ((n != n) ? 1 : 0)
#endif
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录