Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Unity
提交
fe2c691e
T
Third Party Unity
项目概览
OpenHarmony
/
Third Party Unity
接近 2 年 前同步成功
通知
38
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看板
提交
fe2c691e
编写于
5月 22, 2014
作者:
M
Mark VanderVoord
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Clean up many warnings. add clang_strict target to help uncover warnings
上级
1cf02f8b
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
184 addition
and
101 deletion
+184
-101
src/unity.c
src/unity.c
+11
-11
targets/clang_strict.yml
targets/clang_strict.yml
+83
-0
test/testunity.c
test/testunity.c
+90
-90
未找到文件。
src/unity.c
浏览文件 @
fe2c691e
...
...
@@ -92,7 +92,7 @@ void UnityPrint(const char* string)
else
{
UNITY_OUTPUT_CHAR
(
'\\'
);
UnityPrintNumberHex
((
_U_
S
INT
)
*
pch
,
2
);
UnityPrintNumberHex
((
_U_
U
INT
)
*
pch
,
2
);
}
pch
++
;
}
...
...
@@ -112,7 +112,7 @@ void UnityPrintNumberByStyle(const _U_SINT number, const UNITY_DISPLAY_STYLE_T s
}
else
{
UnityPrintNumberHex
((
_U_UINT
)
number
,
(
style
&
0x000F
)
<<
1
);
UnityPrintNumberHex
((
_U_UINT
)
number
,
(
char
)((
style
&
0x000F
)
<<
1
)
);
}
}
...
...
@@ -252,7 +252,7 @@ void UnityTestResultsBegin(const char* file, const UNITY_LINE_TYPE line)
UNITY_PRINT_EOL
;
UnityPrint
(
file
);
UNITY_OUTPUT_CHAR
(
':'
);
UnityPrintNumber
(
line
);
UnityPrintNumber
(
(
_U_SINT
)
line
);
UNITY_OUTPUT_CHAR
(
':'
);
UnityPrint
(
Unity
.
CurrentTestName
);
UNITY_OUTPUT_CHAR
(
':'
);
...
...
@@ -372,9 +372,9 @@ void UnityAssertBits(const _U_SINT mask,
{
UnityTestResultsFailBegin
(
lineNumber
);
UnityPrint
(
UnityStrExpected
);
UnityPrintMask
(
mask
,
expected
);
UnityPrintMask
(
(
_U_UINT
)
mask
,
(
_U_UINT
)
expected
);
UnityPrint
(
UnityStrWas
);
UnityPrintMask
(
mask
,
actual
);
UnityPrintMask
(
(
_U_UINT
)
mask
,
(
_U_UINT
)
actual
);
UnityAddMsgIfSpecified
(
msg
);
UNITY_FAIL_AND_BAIL
;
}
...
...
@@ -429,7 +429,7 @@ void UnityAssertEqualIntArray(UNITY_PTR_ATTRIBUTE const void* expected,
// If style is UNITY_DISPLAY_STYLE_INT, we'll fall into the default case rather than the INT16 or INT32 (etc) case
// as UNITY_DISPLAY_STYLE_INT includes a flag for UNITY_DISPLAY_RANGE_AUTO, which the width-specific
// variants do not. Therefore remove this flag.
switch
(
style
&
~
UNITY_DISPLAY_RANGE_AUTO
)
switch
(
style
&
(
UNITY_DISPLAY_STYLE_T
)(
~
UNITY_DISPLAY_RANGE_AUTO
)
)
{
case
UNITY_DISPLAY_STYLE_HEX8
:
case
UNITY_DISPLAY_STYLE_INT8
:
...
...
@@ -1098,7 +1098,7 @@ void tearDown(void);
void
UnityDefaultTestRun
(
UnityTestFunction
Func
,
const
char
*
FuncName
,
const
int
FuncLineNum
)
{
Unity
.
CurrentTestName
=
FuncName
;
Unity
.
CurrentTestLineNumber
=
FuncLineNum
;
Unity
.
CurrentTestLineNumber
=
(
UNITY_LINE_TYPE
)
FuncLineNum
;
Unity
.
NumberOfTests
++
;
if
(
TEST_PROTECT
())
{
...
...
@@ -1130,11 +1130,11 @@ int UnityEnd(void)
{
UnityPrint
(
"-----------------------"
);
UNITY_PRINT_EOL
;
UnityPrintNumber
(
Unity
.
NumberOfTests
);
UnityPrintNumber
(
(
_U_SINT
)(
Unity
.
NumberOfTests
)
);
UnityPrint
(
" Tests "
);
UnityPrintNumber
(
Unity
.
TestFailures
);
UnityPrintNumber
(
(
_U_SINT
)(
Unity
.
TestFailures
)
);
UnityPrint
(
" Failures "
);
UnityPrintNumber
(
Unity
.
TestIgnores
);
UnityPrintNumber
(
(
_U_SINT
)(
Unity
.
TestIgnores
)
);
UnityPrint
(
" Ignored"
);
UNITY_PRINT_EOL
;
if
(
Unity
.
TestFailures
==
0U
)
...
...
@@ -1146,5 +1146,5 @@ int UnityEnd(void)
UnityPrintFail
();
}
UNITY_PRINT_EOL
;
return
Unity
.
TestFailures
;
return
(
int
)(
Unity
.
TestFailures
)
;
}
targets/clang_strict.yml
0 → 100644
浏览文件 @
fe2c691e
---
compiler
:
path
:
clang
source_path
:
'
src/'
unit_tests_path
:
&unit_tests_path
'
test/'
build_path
:
&build_path
'
build/'
options
:
-
'
-c'
-
'
-Wall'
-
'
-Wextra'
-
'
-Werror'
-
'
-Wcast-qual'
-
'
-Wconversion'
-
'
-Wdisabled-optimization'
-
'
-Wformat=2'
-
'
-Winit-self'
-
'
-Winline'
-
'
-Winvalid-pch'
-
'
-Wmissing-declarations'
-
'
-Wmissing-include-dirs'
-
'
-Wmissing-prototypes'
-
'
-Wnonnull'
-
'
-Wpacked'
-
'
-Wpointer-arith'
-
'
-Wredundant-decls'
-
'
-Wswitch-default'
-
'
-Wstrict-aliasing'
-
'
-Wstrict-overflow=5'
-
'
-Wuninitialized'
-
'
-Wunused'
-
'
-Wunreachable-code'
-
'
-Wreturn-type'
-
'
-Wshadow'
-
'
-Wundef'
-
'
-Wwrite-strings'
-
'
-Wno-missing-declarations'
-
'
-Wno-missing-prototypes'
-
'
-Wno-nested-externs'
-
'
-Wno-redundant-decls'
-
'
-Wno-unused-parameter'
-
'
-Wno-variadic-macros'
-
'
-Wbad-function-cast'
-
'
-fms-extensions'
-
'
-fno-omit-frame-pointer'
-
'
-ffloat-store'
-
'
-fno-common'
-
'
-fstrict-aliasing'
-
'
-std=gnu99'
-
'
-pedantic'
-
'
-O0'
includes
:
prefix
:
'
-I'
items
:
-
'
src/'
-
'
../src/'
-
*unit_tests_path
defines
:
prefix
:
'
-D'
items
:
-
UNITY_INCLUDE_DOUBLE
-
UNITY_SUPPORT_TEST_CASES
-
UNITY_SUPPORT_64
object_files
:
prefix
:
'
-o'
extension
:
'
.o'
destination
:
*build_path
linker
:
path
:
gcc
options
:
-
-lm
-
'
-m64'
includes
:
prefix
:
'
-I'
object_files
:
path
:
*build_path
extension
:
'
.o'
bin_files
:
prefix
:
'
-o'
extension
:
'
.exe'
destination
:
*build_path
colour
:
true
:unity:
:plugins: []
test/testunity.c
浏览文件 @
fe2c691e
...
...
@@ -62,7 +62,7 @@ void testUnitySizeInitializationReminder(void)
/* This test ensures that sizeof(struct _Unity) doesn't change. If this
* test breaks, go look at the initialization of the Unity global variable
* in unity.c and make sure we're filling in the proper fields. */
c
har
*
message
=
"Unexpected size for _Unity struct. Please check that "
c
onst
char
*
message
=
"Unexpected size for _Unity struct. Please check that "
"the initialization of the Unity symbol in unity.c is "
"still correct."
;
...
...
@@ -151,7 +151,7 @@ void testFail(void)
void
testIsNull
(
void
)
{
char
*
ptr1
=
NULL
;
char
*
ptr2
=
"hello"
;
c
onst
c
har
*
ptr2
=
"hello"
;
TEST_ASSERT_NULL
(
ptr1
);
TEST_ASSERT_NOT_NULL
(
ptr2
);
...
...
@@ -159,7 +159,7 @@ void testIsNull(void)
void
testIsNullShouldFailIfNot
(
void
)
{
char
*
ptr1
=
"hello"
;
c
onst
c
har
*
ptr1
=
"hello"
;
EXPECT_ABORT_BEGIN
TEST_ASSERT_NULL
(
ptr1
);
...
...
@@ -1940,8 +1940,8 @@ void testEqualInt64s(void)
_US64
v0
,
v1
;
_US64
*
p0
,
*
p1
;
v0
=
0x9876543201234567
;
v1
=
0x9876543201234567
;
v0
=
(
_US64
)
0x9876543201234567
;
v1
=
(
_US64
)
0x9876543201234567
;
p0
=
&
v0
;
p1
=
&
v1
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录