Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Unity
提交
94fc6894
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看板
提交
94fc6894
编写于
2月 15, 2016
作者:
J
jsalling
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
100% code coverage for Unity Fixture
Add tests for uncovered lines
上级
cc0f58cf
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
36 addition
and
1 deletion
+36
-1
extras/fixture/test/Makefile
extras/fixture/test/Makefile
+1
-0
extras/fixture/test/unity_fixture_Test.c
extras/fixture/test/unity_fixture_Test.c
+31
-0
extras/fixture/test/unity_fixture_TestRunner.c
extras/fixture/test/unity_fixture_TestRunner.c
+3
-0
extras/fixture/test/unity_output_Spy.c
extras/fixture/test/unity_output_Spy.c
+1
-1
未找到文件。
extras/fixture/test/Makefile
浏览文件 @
94fc6894
...
...
@@ -75,5 +75,6 @@ CFLAGS += -Wstrict-prototypes
CFLAGS
+=
-Wswitch-default
CFLAGS
+=
-Wundef
CFLAGS
+=
-Wno-error
=
undef
# Warning only, this should not stop the build
CFLAGS
+=
-Wunreachable-code
CFLAGS
+=
-Wunused
CFLAGS
+=
-fstrict-aliasing
extras/fixture/test/unity_fixture_Test.c
浏览文件 @
94fc6894
...
...
@@ -136,6 +136,22 @@ TEST(UnityFixture, FreeNULLSafety)
free
(
NULL
);
}
TEST
(
UnityFixture
,
ConcludeTestIncrementsFailCount
)
{
_U_UINT
savedFails
=
Unity
.
TestFailures
;
_U_UINT
savedIgnores
=
Unity
.
TestIgnores
;
UnityOutputCharSpy_Enable
(
1
);
Unity
.
CurrentTestFailed
=
1
;
UnityConcludeFixtureTest
();
// Resets TestFailed for this test to pass
Unity
.
CurrentTestIgnored
=
1
;
UnityConcludeFixtureTest
();
// Resets TestIgnored
UnityOutputCharSpy_Enable
(
0
);
TEST_ASSERT_EQUAL
(
savedFails
+
1
,
Unity
.
TestFailures
);
TEST_ASSERT_EQUAL
(
savedIgnores
+
1
,
Unity
.
TestIgnores
);
Unity
.
TestFailures
=
savedFails
;
Unity
.
TestIgnores
=
savedIgnores
;
}
//------------------------------------------------------------
TEST_GROUP
(
UnityCommandOptions
);
...
...
@@ -276,6 +292,21 @@ TEST(UnityCommandOptions, UnknownCommandIsIgnored)
TEST_ASSERT_EQUAL
(
98
,
UnityFixture
.
RepeatCount
);
}
TEST
(
UnityCommandOptions
,
GroupOrNameFilterWithoutStringFails
)
{
TEST_ASSERT_EQUAL
(
1
,
UnityGetCommandLineOptions
(
3
,
unknownCommand
));
TEST_ASSERT_EQUAL
(
1
,
UnityGetCommandLineOptions
(
5
,
unknownCommand
));
TEST_ASSERT_EQUAL
(
1
,
UnityMain
(
3
,
unknownCommand
,
NULL
));
}
TEST
(
UnityCommandOptions
,
GroupFilterReallyFilters
)
{
_U_UINT
saved
=
Unity
.
NumberOfTests
;
TEST_ASSERT_EQUAL
(
0
,
UnityGetCommandLineOptions
(
4
,
unknownCommand
));
UnityIgnoreTest
(
NULL
,
"non-matching"
,
NULL
);
TEST_ASSERT_EQUAL
(
saved
,
Unity
.
NumberOfTests
);
}
IGNORE_TEST
(
UnityCommandOptions
,
TestShouldBeIgnored
)
{
TEST_FAIL_MESSAGE
(
"This test should not run!"
);
...
...
extras/fixture/test/unity_fixture_TestRunner.c
浏览文件 @
94fc6894
...
...
@@ -19,6 +19,7 @@ TEST_GROUP_RUNNER(UnityFixture)
RUN_TEST_CASE
(
UnityFixture
,
CallocFillsWithZero
);
RUN_TEST_CASE
(
UnityFixture
,
PointerSet
);
RUN_TEST_CASE
(
UnityFixture
,
FreeNULLSafety
);
RUN_TEST_CASE
(
UnityFixture
,
ConcludeTestIncrementsFailCount
);
}
TEST_GROUP_RUNNER
(
UnityCommandOptions
)
...
...
@@ -32,6 +33,8 @@ TEST_GROUP_RUNNER(UnityCommandOptions)
RUN_TEST_CASE
(
UnityCommandOptions
,
MultipleOptions
);
RUN_TEST_CASE
(
UnityCommandOptions
,
MultipleOptionsDashRNotLastAndNoValueSpecified
);
RUN_TEST_CASE
(
UnityCommandOptions
,
UnknownCommandIsIgnored
);
RUN_TEST_CASE
(
UnityCommandOptions
,
GroupOrNameFilterWithoutStringFails
);
RUN_TEST_CASE
(
UnityCommandOptions
,
GroupFilterReallyFilters
);
RUN_TEST_CASE
(
UnityCommandOptions
,
TestShouldBeIgnored
);
}
...
...
extras/fixture/test/unity_output_Spy.c
浏览文件 @
94fc6894
...
...
@@ -19,7 +19,7 @@ static int spy_enable;
void
UnityOutputCharSpy_Create
(
int
s
)
{
size
=
s
;
size
=
(
s
>
0
)
?
s
:
0
;
count
=
0
;
spy_enable
=
0
;
buffer
=
malloc
((
size_t
)
size
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录