Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
a4430ca9
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
a4430ca9
编写于
10月 29, 2022
作者:
I
inter515
提交者:
ry
10月 29, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixed
4c26ab38
from
https://gitee.com/inter515/xts_acts_release/pulls/6239
适配zlib用例 Signed-off-by:
N
inter515
<
ry.renyi@huawei.com
>
上级
828d5131
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
25 addition
and
24 deletion
+25
-24
bundlemanager/zlib/actszlibtest/ActsZlibTest.cpp
bundlemanager/zlib/actszlibtest/ActsZlibTest.cpp
+25
-24
未找到文件。
bundlemanager/zlib/actszlibtest/ActsZlibTest.cpp
浏览文件 @
a4430ca9
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
#include <mutex>
#include <mutex>
#include <securec.h>
#include <securec.h>
#include <sstream>
#include <sstream>
#include <mutex>
#include <string>
#include <string>
#include "zlib.h"
#include "zlib.h"
...
@@ -37,7 +38,7 @@ static int ONE = 1;
...
@@ -37,7 +38,7 @@ static int ONE = 1;
static
int
FOUR
=
4
;
static
int
FOUR
=
4
;
static
int
SIX
=
6
;
static
int
SIX
=
6
;
static
int
EIGHT
=
8
;
static
int
EIGHT
=
8
;
static
int
GARBAGE_LEN
=
strlen
(
GARBAGE
);
static
int
GARBAGE_LEN
=
strlen
(
GARBAGE
)
+
1
;
static
unsigned
BUFFER_SIZE
=
8192
;
static
unsigned
BUFFER_SIZE
=
8192
;
std
::
mutex
gzMutex_
;
std
::
mutex
gzMutex_
;
std
::
mutex
puMutex_
;
std
::
mutex
puMutex_
;
...
@@ -120,7 +121,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestCompress, Function | MediumTest | Level2)
...
@@ -120,7 +121,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestCompress, Function | MediumTest | Level2)
fprintf
(
stderr
,
"*********ActsZlibTestCompress Z_SOLO**********
\n
"
);
fprintf
(
stderr
,
"*********ActsZlibTestCompress Z_SOLO**********
\n
"
);
#else
#else
Byte
*
compr
,
*
uncompr
;
Byte
*
compr
,
*
uncompr
;
uLong
comprLen
=
100
00
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
comprLen
=
100
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
uncomprLen
=
comprLen
;
uLong
uncomprLen
=
comprLen
;
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
...
@@ -172,7 +173,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestGzio, Function | MediumTest | Level2)
...
@@ -172,7 +173,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestGzio, Function | MediumTest | Level2)
ASSERT_TRUE
(
file
!=
NULL
);
ASSERT_TRUE
(
file
!=
NULL
);
Byte
*
compr
,
*
uncompr
;
Byte
*
compr
,
*
uncompr
;
uLong
comprLen
=
100
00
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
comprLen
=
100
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
uncomprLen
=
comprLen
;
uLong
uncomprLen
=
comprLen
;
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
...
@@ -204,7 +205,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestGzio, Function | MediumTest | Level2)
...
@@ -204,7 +205,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestGzio, Function | MediumTest | Level2)
HWTEST_F
(
ActsZlibTest
,
ActsZlibTestDeflate
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsZlibTest
,
ActsZlibTestDeflate
,
Function
|
MediumTest
|
Level2
)
{
{
Byte
*
compr
;
Byte
*
compr
;
uLong
comprLen
=
100
00
*
sizeof
(
int
);
uLong
comprLen
=
100
*
sizeof
(
int
);
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
ASSERT_TRUE
(
compr
!=
Z_NULL
);
ASSERT_TRUE
(
compr
!=
Z_NULL
);
...
@@ -252,7 +253,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestDeflate, Function | MediumTest | Level2)
...
@@ -252,7 +253,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestDeflate, Function | MediumTest | Level2)
HWTEST_F
(
ActsZlibTest
,
ActsZlibTestInflate
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsZlibTest
,
ActsZlibTestInflate
,
Function
|
MediumTest
|
Level2
)
{
{
Byte
*
compr
,
*
uncompr
;
Byte
*
compr
,
*
uncompr
;
uLong
comprLen
=
100
00
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
comprLen
=
100
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
uncomprLen
=
comprLen
;
uLong
uncomprLen
=
comprLen
;
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
...
@@ -294,7 +295,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestInflate, Function | MediumTest | Level2)
...
@@ -294,7 +295,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestInflate, Function | MediumTest | Level2)
HWTEST_F
(
ActsZlibTest
,
ActsZlibTestLargeDeflate
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsZlibTest
,
ActsZlibTestLargeDeflate
,
Function
|
MediumTest
|
Level2
)
{
{
Byte
*
compr
,
*
uncompr
;
Byte
*
compr
,
*
uncompr
;
uLong
comprLen
=
100
00
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
comprLen
=
100
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
uncomprLen
=
comprLen
;
uLong
uncomprLen
=
comprLen
;
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
...
@@ -355,7 +356,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestLargeDeflate, Function | MediumTest | Level2)
...
@@ -355,7 +356,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestLargeDeflate, Function | MediumTest | Level2)
HWTEST_F
(
ActsZlibTest
,
ActsZlibTestLargeInflate
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsZlibTest
,
ActsZlibTestLargeInflate
,
Function
|
MediumTest
|
Level2
)
{
{
Byte
*
compr
,
*
uncompr
;
Byte
*
compr
,
*
uncompr
;
uLong
comprLen
=
100
00
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
comprLen
=
100
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
uncomprLen
=
comprLen
;
uLong
uncomprLen
=
comprLen
;
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
...
@@ -396,7 +397,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestLargeInflate, Function | MediumTest | Level2)
...
@@ -396,7 +397,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestLargeInflate, Function | MediumTest | Level2)
HWTEST_F
(
ActsZlibTest
,
ActsZlibTestFlush
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsZlibTest
,
ActsZlibTestFlush
,
Function
|
MediumTest
|
Level2
)
{
{
Byte
*
compr
;
Byte
*
compr
;
uLong
comprLen
=
100
00
*
sizeof
(
int
);
uLong
comprLen
=
100
*
sizeof
(
int
);
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
ASSERT_TRUE
(
compr
!=
Z_NULL
);
ASSERT_TRUE
(
compr
!=
Z_NULL
);
...
@@ -437,7 +438,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestFlush, Function | MediumTest | Level2)
...
@@ -437,7 +438,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestFlush, Function | MediumTest | Level2)
HWTEST_F
(
ActsZlibTest
,
ActsZlibTestSync
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsZlibTest
,
ActsZlibTestSync
,
Function
|
MediumTest
|
Level2
)
{
{
Byte
*
compr
,
*
uncompr
;
Byte
*
compr
,
*
uncompr
;
uLong
comprLen
=
100
00
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
comprLen
=
100
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
uncomprLen
=
comprLen
;
uLong
uncomprLen
=
comprLen
;
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
...
@@ -475,7 +476,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestSync, Function | MediumTest | Level2)
...
@@ -475,7 +476,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestSync, Function | MediumTest | Level2)
HWTEST_F
(
ActsZlibTest
,
ActsZlibTestDictDeflate
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsZlibTest
,
ActsZlibTestDictDeflate
,
Function
|
MediumTest
|
Level2
)
{
{
Byte
*
compr
,
*
uncompr
;
Byte
*
compr
,
*
uncompr
;
uLong
comprLen
=
100
00
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
comprLen
=
100
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
uncomprLen
=
comprLen
;
uLong
uncomprLen
=
comprLen
;
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
...
@@ -514,7 +515,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestDictDeflate, Function | MediumTest | Level2)
...
@@ -514,7 +515,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestDictDeflate, Function | MediumTest | Level2)
HWTEST_F
(
ActsZlibTest
,
ActsZlibTestDictInflate
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsZlibTest
,
ActsZlibTestDictInflate
,
Function
|
MediumTest
|
Level2
)
{
{
Byte
*
compr
,
*
uncompr
;
Byte
*
compr
,
*
uncompr
;
uLong
comprLen
=
100
00
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
comprLen
=
100
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
uncomprLen
=
comprLen
;
uLong
uncomprLen
=
comprLen
;
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
...
@@ -570,7 +571,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestCompress2, Function | MediumTest | Level2)
...
@@ -570,7 +571,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestCompress2, Function | MediumTest | Level2)
fprintf
(
stderr
,
"*********ActsZlibTestCompress2 Z_BEST_COMPRESSION Z_SOLO**********
\n
"
);
fprintf
(
stderr
,
"*********ActsZlibTestCompress2 Z_BEST_COMPRESSION Z_SOLO**********
\n
"
);
#else
#else
Byte
*
compr
,
*
uncompr
;
Byte
*
compr
,
*
uncompr
;
uLong
comprLen
=
100
00
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
comprLen
=
100
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
uncomprLen
=
comprLen
;
uLong
uncomprLen
=
comprLen
;
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
...
@@ -634,7 +635,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestDeflateState, Function | MediumTest | Level2)
...
@@ -634,7 +635,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestDeflateState, Function | MediumTest | Level2)
{
{
Byte
*
compr
,
*
uncompr
;
Byte
*
compr
,
*
uncompr
;
int
*
bits
=
nullptr
;
int
*
bits
=
nullptr
;
uLong
comprLen
=
100
00
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
comprLen
=
100
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
uncomprLen
=
comprLen
;
uLong
uncomprLen
=
comprLen
;
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
...
@@ -812,7 +813,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestGzBuffer, Function | MediumTest | Level2)
...
@@ -812,7 +813,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestGzBuffer, Function | MediumTest | Level2)
int
res
=
gzdirect
(
file
);
int
res
=
gzdirect
(
file
);
fprintf
(
stderr
,
"gzdirect result: %d
\n
"
,
res
);
fprintf
(
stderr
,
"gzdirect result: %d
\n
"
,
res
);
Byte
*
compr
,
*
uncompr
;
Byte
*
compr
,
*
uncompr
;
uLong
comprLen
=
100
00
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
comprLen
=
100
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
uncomprLen
=
comprLen
;
uLong
uncomprLen
=
comprLen
;
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
...
@@ -960,7 +961,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestGzGets, Function | MediumTest | Level2)
...
@@ -960,7 +961,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestGzGets, Function | MediumTest | Level2)
file
=
gzopen
(
TESTFILE
,
"wb"
);
file
=
gzopen
(
TESTFILE
,
"wb"
);
ASSERT_TRUE
(
file
!=
NULL
);
ASSERT_TRUE
(
file
!=
NULL
);
Byte
*
uncompr
;
Byte
*
uncompr
;
uLong
uncomprLen
=
100
00
*
sizeof
(
int
);
uLong
uncomprLen
=
100
*
sizeof
(
int
);
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
strcpy_s
(
reinterpret_cast
<
char
*>
(
uncompr
),
GARBAGE_LEN
,
GARBAGE
);
strcpy_s
(
reinterpret_cast
<
char
*>
(
uncompr
),
GARBAGE_LEN
,
GARBAGE
);
fprintf
(
stderr
,
"gzgets
\n
"
);
fprintf
(
stderr
,
"gzgets
\n
"
);
...
@@ -1126,7 +1127,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestGzRead, Function | MediumTest | Level2)
...
@@ -1126,7 +1127,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestGzRead, Function | MediumTest | Level2)
ASSERT_TRUE
(
file
!=
NULL
);
ASSERT_TRUE
(
file
!=
NULL
);
Byte
*
uncompr
;
Byte
*
uncompr
;
uLong
uncomprLen
=
100
00
*
sizeof
(
int
);
uLong
uncomprLen
=
100
*
sizeof
(
int
);
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
ASSERT_TRUE
(
uncompr
!=
Z_NULL
);
ASSERT_TRUE
(
uncompr
!=
Z_NULL
);
...
@@ -1310,7 +1311,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestGzInflateBack, Function | MediumTest | Level2
...
@@ -1310,7 +1311,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestGzInflateBack, Function | MediumTest | Level2
z_stream
strm
;
z_stream
strm
;
unsigned
char
match
[
65280
+
2
];
/* buffer for reversed match or gzip 32K sliding window */
unsigned
char
match
[
65280
+
2
];
/* buffer for reversed match or gzip 32K sliding window */
Byte
*
uncompr
;
Byte
*
uncompr
;
uLong
uncomprLen
=
100
00
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
uncomprLen
=
100
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
/* initialize inflateBack state for repeated use */
/* initialize inflateBack state for repeated use */
window
=
match
;
/* reuse match buffer */
window
=
match
;
/* reuse match buffer */
...
@@ -1341,7 +1342,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestGzInflateBack, Function | MediumTest | Level2
...
@@ -1341,7 +1342,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestGzInflateBack, Function | MediumTest | Level2
HWTEST_F
(
ActsZlibTest
,
ActsZlibTestInflateCodesUsed
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsZlibTest
,
ActsZlibTestInflateCodesUsed
,
Function
|
MediumTest
|
Level2
)
{
{
Byte
*
compr
,
*
uncompr
;
Byte
*
compr
,
*
uncompr
;
uLong
comprLen
=
100
00
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
comprLen
=
100
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
uncomprLen
=
comprLen
;
uLong
uncomprLen
=
comprLen
;
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
...
@@ -1385,7 +1386,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestInflateCopy_END, Function | MediumTest | Leve
...
@@ -1385,7 +1386,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestInflateCopy_END, Function | MediumTest | Leve
HWTEST_F
(
ActsZlibTest
,
ActsZlibTestInflateGetDictionary
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsZlibTest
,
ActsZlibTestInflateGetDictionary
,
Function
|
MediumTest
|
Level2
)
{
{
Byte
*
compr
,
*
uncompr
;
Byte
*
compr
,
*
uncompr
;
uLong
comprLen
=
100
00
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
comprLen
=
100
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
uncomprLen
=
comprLen
;
uLong
uncomprLen
=
comprLen
;
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
...
@@ -1556,7 +1557,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestInflatePrime, Function | MediumTest | Level2)
...
@@ -1556,7 +1557,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestInflatePrime, Function | MediumTest | Level2)
HWTEST_F
(
ActsZlibTest
,
ActsZlibTestInflateReset
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsZlibTest
,
ActsZlibTestInflateReset
,
Function
|
MediumTest
|
Level2
)
{
{
Byte
*
compr
,
*
uncompr
;
Byte
*
compr
,
*
uncompr
;
uLong
comprLen
=
100
00
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
comprLen
=
100
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
uncomprLen
=
comprLen
;
uLong
uncomprLen
=
comprLen
;
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
...
@@ -1594,7 +1595,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestInflateReset, Function | MediumTest | Level2)
...
@@ -1594,7 +1595,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestInflateReset, Function | MediumTest | Level2)
HWTEST_F
(
ActsZlibTest
,
ActsZlibTestInflateSetDictionary
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsZlibTest
,
ActsZlibTestInflateSetDictionary
,
Function
|
MediumTest
|
Level2
)
{
{
Byte
*
compr
,
*
uncompr
;
Byte
*
compr
,
*
uncompr
;
uLong
comprLen
=
100
00
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
comprLen
=
100
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
uncomprLen
=
comprLen
;
uLong
uncomprLen
=
comprLen
;
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
...
@@ -1628,7 +1629,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestInflateSetDictionary, Function | MediumTest |
...
@@ -1628,7 +1629,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestInflateSetDictionary, Function | MediumTest |
HWTEST_F
(
ActsZlibTest
,
ActsZlibTestInflateSyncPoint
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsZlibTest
,
ActsZlibTestInflateSyncPoint
,
Function
|
MediumTest
|
Level2
)
{
{
Byte
*
compr
,
*
uncompr
;
Byte
*
compr
,
*
uncompr
;
uLong
comprLen
=
100
00
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
comprLen
=
100
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
uncomprLen
=
comprLen
;
uLong
uncomprLen
=
comprLen
;
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
...
@@ -1660,7 +1661,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestInflateSyncPoint, Function | MediumTest | Lev
...
@@ -1660,7 +1661,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestInflateSyncPoint, Function | MediumTest | Lev
HWTEST_F
(
ActsZlibTest
,
ActsZlibTestInflateUndermine
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsZlibTest
,
ActsZlibTestInflateUndermine
,
Function
|
MediumTest
|
Level2
)
{
{
Byte
*
compr
,
*
uncompr
;
Byte
*
compr
,
*
uncompr
;
uLong
comprLen
=
100
00
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
comprLen
=
100
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
uncomprLen
=
comprLen
;
uLong
uncomprLen
=
comprLen
;
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
...
@@ -1692,7 +1693,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestInflateUndermine, Function | MediumTest | Lev
...
@@ -1692,7 +1693,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestInflateUndermine, Function | MediumTest | Lev
HWTEST_F
(
ActsZlibTest
,
ActsZlibTestInflateValidate
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsZlibTest
,
ActsZlibTestInflateValidate
,
Function
|
MediumTest
|
Level2
)
{
{
Byte
*
compr
,
*
uncompr
;
Byte
*
compr
,
*
uncompr
;
uLong
comprLen
=
100
00
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
comprLen
=
100
*
sizeof
(
int
);
/* don't overflow on MSDOS */
uLong
uncomprLen
=
comprLen
;
uLong
uncomprLen
=
comprLen
;
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
compr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
comprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
uncompr
=
static_cast
<
Byte
*>
(
calloc
(
static_cast
<
uInt
>
(
uncomprLen
),
CALLOC_SIZE
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录