Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Unity
提交
7fff3fc0
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看板
提交
7fff3fc0
编写于
2月 23, 2016
作者:
M
Mark VanderVoord
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #170 from jsalling/feature/fix-compiler-warnings
Clean up int conversion warnings in Fixture
上级
4cc96496
2107e706
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
45 addition
and
24 deletion
+45
-24
extras/fixture/src/unity_fixture.c
extras/fixture/src/unity_fixture.c
+4
-4
extras/fixture/src/unity_fixture_internals.h
extras/fixture/src/unity_fixture_internals.h
+1
-1
extras/fixture/test/Makefile
extras/fixture/test/Makefile
+25
-3
extras/fixture/test/unity_fixture_Test.c
extras/fixture/test/unity_fixture_Test.c
+13
-14
extras/fixture/test/unity_output_Spy.c
extras/fixture/test/unity_output_Spy.c
+2
-2
未找到文件。
extras/fixture/src/unity_fixture.c
浏览文件 @
7fff3fc0
...
...
@@ -23,9 +23,9 @@ void tearDown(void) { /*does nothing*/ }
static
void
announceTestRun
(
unsigned
int
runNumber
)
{
UnityPrint
(
"Unity test run "
);
UnityPrintNumber
(
runNumber
+
1
);
UnityPrintNumber
Unsigned
(
runNumber
+
1
);
UnityPrint
(
" of "
);
UnityPrintNumber
(
UnityFixture
.
RepeatCount
);
UnityPrintNumber
Unsigned
(
UnityFixture
.
RepeatCount
);
UNITY_PRINT_EOL
();
}
...
...
@@ -45,7 +45,7 @@ int UnityMain(int argc, const char* argv[], void (*runAllTests)(void))
UnityEnd
();
}
return
Unity
.
TestFailures
;
return
(
int
)
Unity
.
TestFailures
;
}
static
int
selected
(
const
char
*
filter
,
const
char
*
name
)
...
...
@@ -71,7 +71,7 @@ void UnityTestRunner(unityfunction* setup,
const
char
*
printableName
,
const
char
*
group
,
const
char
*
name
,
const
char
*
file
,
int
line
)
const
char
*
file
,
unsigned
int
line
)
{
if
(
testSelected
(
name
)
&&
groupSelected
(
group
))
{
...
...
extras/fixture/src/unity_fixture_internals.h
浏览文件 @
7fff3fc0
...
...
@@ -23,7 +23,7 @@ void UnityTestRunner(unityfunction* setup,
const
char
*
printableName
,
const
char
*
group
,
const
char
*
name
,
const
char
*
file
,
int
line
);
const
char
*
file
,
unsigned
int
line
);
void
UnityIgnoreTest
(
const
char
*
printableName
,
const
char
*
group
,
const
char
*
name
);
void
UnityMalloc_StartTest
(
void
);
...
...
extras/fixture/test/Makefile
浏览文件 @
7fff3fc0
CC
=
gcc
CFLAGS
+=
-Werror
#DEBUG = -O0 -g
CFLAGS
+=
-std
=
c99
CFLAGS
+=
-pedantic
CFLAGS
+=
-Wundef
CFLAGS
+=
-Wall
CFLAGS
+=
-Wextra
CFLAGS
+=
-Werror
CFLAGS
+=
$(DEBUG)
DEFINES
=
-D
UNITY_OUTPUT_CHAR
=
UnityOutputCharSpy_OutputChar
SRC
=
../src/unity_fixture.c
\
../../../src/unity.c
\
...
...
@@ -32,7 +35,26 @@ noStdlibMalloc: ../build/
./
$(TARGET)
clangEverything
:
$(CC)
$(CFLAGS)
$(DEFINES)
$(SRC)
$(INC_DIR)
-o
$(TARGET)
-m64
-Weverything
# || true #prevents make from fail
ing
clang
$(CFLAGS)
$(DEFINES)
$(SRC)
$(INC_DIR)
-o
$(TARGET)
-m64
-Weveryth
ing
../build
:
mkdir
-p
../build
clean
:
rm
-f
$(TARGET)
# These extended flags DO get included before any target build runs
CFLAGS
+=
-Wbad-function-cast
CFLAGS
+=
-Wcast-qual
CFLAGS
+=
-Wconversion
CFLAGS
+=
-Wformat
=
2
CFLAGS
+=
-Wmissing-prototypes
CFLAGS
+=
-Wold-style-definition
CFLAGS
+=
-Wpointer-arith
CFLAGS
+=
-Wshadow
CFLAGS
+=
-Wstrict-overflow
=
5
CFLAGS
+=
-Wstrict-prototypes
CFLAGS
+=
-Wswitch-default
CFLAGS
+=
-Wundef
CFLAGS
+=
-Wunused
CFLAGS
+=
-fstrict-aliasing
extras/fixture/test/unity_fixture_Test.c
浏览文件 @
7fff3fc0
...
...
@@ -22,14 +22,13 @@ TEST_TEAR_DOWN(UnityFixture)
{
}
int
my_int
;
int
*
pointer1
=
0
;
int
*
pointer2
=
(
int
*
)
2
;
int
*
pointer3
=
(
int
*
)
3
;
int
int1
;
int
int2
;
int
int3
;
int
int4
;
static
int
*
pointer1
=
0
;
static
int
*
pointer2
=
(
int
*
)
2
;
static
int
*
pointer3
=
(
int
*
)
3
;
static
int
int1
;
static
int
int2
;
static
int
int3
;
static
int
int4
;
TEST
(
UnityFixture
,
PointerSetting
)
{
...
...
@@ -112,8 +111,8 @@ TEST(UnityFixture, CallocFillsWithZero)
free
(
m
);
}
char
*
p1
;
char
*
p2
;
static
char
*
p1
;
static
char
*
p2
;
TEST
(
UnityFixture
,
PointerSet
)
{
...
...
@@ -143,10 +142,10 @@ TEST(UnityFixture, FreeNULLSafety)
TEST_GROUP
(
UnityCommandOptions
);
int
savedVerbose
;
int
savedRepeat
;
const
char
*
savedName
;
const
char
*
savedGroup
;
static
int
savedVerbose
;
static
unsigned
int
savedRepeat
;
static
const
char
*
savedName
;
static
const
char
*
savedGroup
;
TEST_SETUP
(
UnityCommandOptions
)
{
...
...
extras/fixture/test/unity_output_Spy.c
浏览文件 @
7fff3fc0
...
...
@@ -22,7 +22,7 @@ void UnityOutputCharSpy_Create(int s)
size
=
s
;
count
=
0
;
spy_enable
=
0
;
buffer
=
malloc
(
size
);
buffer
=
malloc
(
(
size_t
)
size
);
TEST_ASSERT_NOT_NULL_MESSAGE
(
buffer
,
"Internal malloc failed in Spy Create():"
__FILE__
);
memset
(
buffer
,
0
,
size
);
}
...
...
@@ -38,7 +38,7 @@ int UnityOutputCharSpy_OutputChar(int c)
if
(
spy_enable
)
{
if
(
count
<
(
size
-
1
))
buffer
[
count
++
]
=
c
;
buffer
[
count
++
]
=
(
char
)
c
;
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录