Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Unity
提交
1e439674
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看板
提交
1e439674
编写于
3月 29, 2017
作者:
T
toby
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add EACH_EQUAL changes
上级
e2cc6791
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
71 addition
and
0 deletion
+71
-0
docs/UnityAssertionsReference.md
docs/UnityAssertionsReference.md
+71
-0
未找到文件。
docs/UnityAssertionsReference.md
浏览文件 @
1e439674
...
...
@@ -127,6 +127,27 @@ Notes:
and double assertions (see immediately following section).
### TEST_ASSERT_EACH_EQUAL_X Variants
Unity provides a collection of assertions for arrays containing a variety of
types which can be compared to a single value as well. These are documented in
the Each Equal section below. these are almost on par with the
`_MESSAGE`
variants of Unity's Asserts in that for pretty much any Unity type assertion you
can inject _EACH_EQUAL and run assertions on an entire block of memory.
TEST_ASSERT_EACH_EQUAL_TYPEX( expected, actual, {size/count} )
"Expected" is a single value to compare to.
"Actual" is an array where each element will be compared to the expected value.
"Size/count" is one of two parameters necessary to establish the number of array
elements and perhaps the length of elements within the array.
Notes:
-
The
`_MESSAGE`
variant convention still applies here to Each Equal assertions.
-
Assertions for handling Each Equal of floating point values are grouped with
float and double assertions (see immediately following section).
### Configuration
#### Floating Point Support Is Optional
...
...
@@ -383,6 +404,56 @@ match. Failure messages specify the array index of the failed comparison.
`len`
is the memory in bytes to be compared at each array element.
### Each Equal (Arrays to Single Value)
`expected`
are single values and
`actual`
are arrays.
`num_elements`
specifies
the number of elements in the arrays to compare.
`_HEX`
assertions produce failure messages with expected and actual array
contents formatted in hexadecimal.
Assertions fail upon the first element in the compared arrays found not to
match. Failure messages specify the array index of the failed comparison.
#### `TEST_ASSERT_EACH_EQUAL_INT (expected, actual, num_elements)`
#### `TEST_ASSERT_EACH_EQUAL_INT8 (expected, actual, num_elements)`
#### `TEST_ASSERT_EACH_EQUAL_INT16 (expected, actual, num_elements)`
#### `TEST_ASSERT_EACH_EQUAL_INT32 (expected, actual, num_elements)`
#### `TEST_ASSERT_EACH_EQUAL_INT64 (expected, actual, num_elements)`
#### `TEST_ASSERT_EACH_EQUAL_UINT (expected, actual, num_elements)`
#### `TEST_ASSERT_EACH_EQUAL_UINT8 (expected, actual, num_elements)`
#### `TEST_ASSERT_EACH_EQUAL_UINT16 (expected, actual, num_elements)`
#### `TEST_ASSERT_EACH_EQUAL_UINT32 (expected, actual, num_elements)`
#### `TEST_ASSERT_EACH_EQUAL_UINT64 (expected, actual, num_elements)`
#### `TEST_ASSERT_EACH_EQUAL_HEX (expected, actual, num_elements)`
#### `TEST_ASSERT_EACH_EQUAL_HEX8 (expected, actual, num_elements)`
#### `TEST_ASSERT_EACH_EQUAL_HEX16 (expected, actual, num_elements)`
#### `TEST_ASSERT_EACH_EQUAL_HEX32 (expected, actual, num_elements)`
#### `TEST_ASSERT_EACH_EQUAL_HEX64 (expected, actual, num_elements)`
#### `TEST_ASSERT_EACH_EQUAL_PTR (expected, actual, num_elements)`
#### `TEST_ASSERT_EACH_EQUAL_STRING (expected, actual, num_elements)`
#### `TEST_ASSERT_EACH_EQUAL_MEMORY (expected, actual, len, num_elements)`
`len`
is the memory in bytes to be compared at each array element.
### Floating Point (If enabled)
##### `TEST_ASSERT_FLOAT_WITHIN (delta, expected, actual)`
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录