Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Test Developertest
提交
d2f3bb01
T
Test Developertest
项目概览
OpenHarmony
/
Test Developertest
大约 1 年 前同步成功
通知
2
Star
23
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Test Developertest
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
d2f3bb01
编写于
3月 23, 2022
作者:
O
openharmony_ci
提交者:
Gitee
3月 23, 2022
浏览文件
操作
浏览文件
下载
差异文件
!90 Modified the File
Merge pull request !90 from stivn/master
上级
c947468e
76f41cb9
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
79 addition
and
60 deletion
+79
-60
aw/cxx/distributed/distributed.h
aw/cxx/distributed/distributed.h
+6
-6
aw/cxx/distributed/distributed_agent.cpp
aw/cxx/distributed/distributed_agent.cpp
+5
-5
aw/cxx/distributed/distributed_cfg.h
aw/cxx/distributed/distributed_cfg.h
+1
-1
aw/cxx/distributed/distributed_major.cpp
aw/cxx/distributed/distributed_major.cpp
+6
-6
aw/cxx/hwext/perf.h
aw/cxx/hwext/perf.h
+1
-1
bundle.json
bundle.json
+37
-0
examples/calculator/include/calculator.h
examples/calculator/include/calculator.h
+3
-1
examples/calculator/src/calculator.cpp
examples/calculator/src/calculator.cpp
+0
-1
examples/calculator/test/fuzztest/common/parse_fuzzer/parse_fuzzer.cpp
...ulator/test/fuzztest/common/parse_fuzzer/parse_fuzzer.cpp
+2
-4
examples/calculator/test/fuzztest/common/parse_fuzzer/parse_fuzzer.h
...lculator/test/fuzztest/common/parse_fuzzer/parse_fuzzer.h
+4
-6
examples/detector/include/detector.h
examples/detector/include/detector.h
+4
-0
examples/sleep/include/sleep_ex.h
examples/sleep/include/sleep_ex.h
+4
-3
examples/sleep/src/sleep_ex.cpp
examples/sleep/src/sleep_ex.cpp
+5
-3
ohos.build
ohos.build
+0
-22
src/core/config/config_manager.py
src/core/config/config_manager.py
+1
-1
未找到文件。
aw/cxx/distributed/distributed.h
浏览文件 @
d2f3bb01
...
...
@@ -21,12 +21,12 @@
namespace
OHOS
{
namespace
DistributeSystemTest
{
static
const
int
MAX_BUFF_LEN
=
1024
;
static
const
int
DST_COMMAND_NOTIFY
=
0
;
static
const
int
DST_COMMAND_CALL
=
1
;
static
const
int
DST_COMMAND_MSG
=
2
;
static
const
int
DST_COMMAND_END
=
3
;
static
const
int
DEFAULT_AGENT_PORT
=
6789
;
constexpr
int
MAX_BUFF_LEN
=
1024
;
constexpr
int
DST_COMMAND_NOTIFY
=
0
;
constexpr
int
DST_COMMAND_CALL
=
1
;
constexpr
int
DST_COMMAND_MSG
=
2
;
constexpr
int
DST_COMMAND_END
=
3
;
constexpr
int
DEFAULT_AGENT_PORT
=
6789
;
struct
DistributedCmd
{
int
no
;
// record command no, as return no.
...
...
aw/cxx/distributed/distributed_agent.cpp
浏览文件 @
d2f3bb01
...
...
@@ -94,7 +94,7 @@ int DistributedAgent::InitAgentServer()
}
addr
.
sin_port
=
htons
(
agentPort_
);
int
err
=
::
bind
(
serverSockFd
,
(
struct
sockaddr
*
)
&
addr
,
sizeof
(
addr
));
int
err
=
::
bind
(
serverSockFd
,
reinterpret_cast
<
struct
sockaddr
*>
(
&
addr
)
,
sizeof
(
addr
));
if
(
err
<
0
)
{
HiLog
::
Error
(
DistributedAgent
::
LABEL
,
"agent bind error.
\n
"
);
close
(
serverSockFd
);
...
...
@@ -132,7 +132,7 @@ int DistributedAgent::DoCmdServer(int serverSockFd)
while
(
receiveLen
>
0
)
{
HiLog
::
Info
(
DistributedAgent
::
LABEL
,
"wait client .......
\n
"
);
if
((
clientSockFd
=
accept
(
serverSockFd
,
(
struct
sockaddr
*
)
&
clientAddr
,
&
sinSize
))
>
0
)
{
if
((
clientSockFd
=
accept
(
serverSockFd
,
reinterpret_cast
<
struct
sockaddr
*>
(
&
clientAddr
)
,
&
sinSize
))
>
0
)
{
break
;
}
receiveLen
--
;
...
...
@@ -153,9 +153,9 @@ int DistributedAgent::DoCmdServer(int serverSockFd)
return
-
1
;
}
// every cmd length less than MAX_BUFF_LEN bytes;
int
c
mdLen
=
recv
(
clientSockFd_
,
buff
,
DST_COMMAND_HEAD_LEN
,
0
);
if
(
static_cast
<
unsigned
long
>
(
c
mdLen
)
<
DST_COMMAND_HEAD_LEN
)
{
if
(
c
mdLen
==
0
)
{
int
recvC
mdLen
=
recv
(
clientSockFd_
,
buff
,
DST_COMMAND_HEAD_LEN
,
0
);
if
(
static_cast
<
unsigned
long
>
(
recvC
mdLen
)
<
DST_COMMAND_HEAD_LEN
)
{
if
(
recvC
mdLen
==
0
)
{
HiLog
::
Info
(
DistributedAgent
::
LABEL
,
"agent connect socket closed, IP:%s .
\n
"
,
inet_ntoa
(
clientAddr
.
sin_addr
));
mbStop_
=
true
;
...
...
aw/cxx/distributed/distributed_cfg.h
浏览文件 @
d2f3bb01
...
...
@@ -41,7 +41,7 @@ public:
~
DistributedCfg
();
bool
OpenCfg
(
std
::
string
fileName
);
bool
GetCfgVal
(
std
::
string
key
,
std
::
string
&
value
);
std
::
string
GetValueInString
(
std
::
string
str
,
size_t
devN
O
);
std
::
string
GetValueInString
(
std
::
string
str
,
size_t
devN
o
);
std
::
string
GetDeviceIp
(
std
::
string
fileName
,
size_t
devNo
);
std
::
string
GetDeviceUuid
(
std
::
string
fileName
,
size_t
devNo
);
static
std
::
unique_ptr
<
DistributedCfg
>&
GetInstance
();
...
...
aw/cxx/distributed/distributed_major.cpp
浏览文件 @
d2f3bb01
...
...
@@ -130,7 +130,7 @@ int DistributeTestEnvironment::ConnectAgent(size_t devNo)
addr
.
sin_port
=
htons
(
serverPort_
);
int
connectCount
=
0
;
for
(
connectCount
=
0
;
connectCount
<
CONNECT_TIME
;
connectCount
++
)
{
// try connect to agent 3 times.
if
(
connect
(
clientSockFd
,
(
struct
sockaddr
*
)
&
addr
,
sizeof
(
addr
))
==
0
)
{
if
(
connect
(
clientSockFd
,
reinterpret
<
struct
sockaddr
*>
(
&
addr
)
,
sizeof
(
addr
))
==
0
)
{
break
;
}
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
milliseconds
(
SLEEP_TIME
));
// delay 10ms
...
...
@@ -184,11 +184,11 @@ bool DistributeTestEnvironment::SendToAgent(size_t devNo, int cmdType, void *pst
}
globalCommandNo
++
;
char
szrbuf
[
MAX_BUFF_LEN
]
=
{
0
};
auto
pCmd
Test
=
reinterpret_cast
<
DistributedMsg
*>
(
pstrMsg
);
pCmd
Test
->
no
=
globalCommandNo
;
pCmd
Test
->
cmdTestType
=
htons
(
cmdType
);
pCmd
Test
->
len
=
htons
(
len
);
int
rlen
=
send
(
clientList_
[
devNo
].
fd
,
pCmd
Test
,
static_cast
<
size_t
>
(
len
+
DST_COMMAND_HEAD_LEN
),
0
);
auto
pCmd
Msg
=
reinterpret_cast
<
DistributedMsg
*>
(
pstrMsg
);
pCmd
Msg
->
no
=
globalCommandNo
;
pCmd
Msg
->
cmdTestType
=
htons
(
cmdType
);
pCmd
Msg
->
len
=
htons
(
len
);
int
rlen
=
send
(
clientList_
[
devNo
].
fd
,
pCmd
Msg
,
static_cast
<
size_t
>
(
len
+
DST_COMMAND_HEAD_LEN
),
0
);
if
(
rlen
<=
0
)
{
HiLog
::
Error
(
LABEL
,
"agent socket is closed."
);
return
breturn
;
...
...
aw/cxx/hwext/perf.h
浏览文件 @
d2f3bb01
...
...
@@ -19,7 +19,7 @@
#include <string>
#include <list>
#include <map>
#include <
time.h
>
#include <
ctime
>
#include "securec.h"
#include <gtest/gtest.h>
...
...
bundle.json
0 → 100644
浏览文件 @
d2f3bb01
{
"name"
:
"@openharmony/developertest"
,
"version"
:
"3.1.0"
,
"description"
:
"developertest"
,
"license"
:
"Apache License 2.0"
,
"publishAs"
:
"code-segment"
,
"scripts"
:
{},
"repository"
:
""
,
"dirs"
:
{},
"component"
:
{
"name"
:
"developertest"
,
"subsystem"
:
"developertest"
,
"features"
:[],
"adapted_system_type"
:
[
"standard"
],
"rom"
:
"0KB"
,
"ram"
:
"0KB"
,
"deps"
:
{},
"build"
:
{
"sub_component"
:
[
"//test/developertest/examples/app_info:app_info"
,
"//test/developertest/examples/detector:detector"
,
"//test/developertest/examples/calculator:calculator"
,
"//test/developertest/examples/calculator:calculator_static"
],
"inner_kits"
:
[],
"test"
:
[
"//test/developertest/examples/app_info/test:unittest"
,
"//test/developertest/examples/calculator/test:unittest"
,
"//test/developertest/examples/calculator/test:fuzztest"
,
"//test/developertest/examples/calculator/test:benchmarktest"
,
"//test/developertest/examples/detector/test:unittest"
,
"//test/developertest/examples/sleep/test:performance"
,
"//test/developertest/examples/distributedb/test:distributedtest"
]
}
}
}
examples/calculator/include/calculator.h
浏览文件 @
d2f3bb01
...
...
@@ -12,10 +12,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <iostream>
#ifndef _EXAMPLE_CALCULATOR_H_
#define _EXAMPLE_CALCULATOR_H_
int
Add
(
int
e1
,
int
e2
);
int
Sub
(
int
e1
,
int
e2
);
int
Mul
(
int
e1
,
int
e2
);
int
Div
(
int
e1
,
int
e2
);
#endif // _EXAMPLE_CALCULATOR_H_
\ No newline at end of file
examples/calculator/src/calculator.cpp
浏览文件 @
d2f3bb01
...
...
@@ -13,7 +13,6 @@
* limitations under the License.
*/
#include <iostream>
int
Add
(
int
e1
,
int
e2
)
{
...
...
examples/calculator/test/fuzztest/common/parse_fuzzer/parse_fuzzer.cpp
浏览文件 @
d2f3bb01
...
...
@@ -13,10 +13,8 @@
* limitations under the License.
*/
#include "parse_fuzzer.h"
#include <stddef.h>
#include <stdint.h>
#include <cstddef>
#include <cstdint>
const
int
FUZZ_DATA_LEN
=
3
;
const
int
FUZZ_FST_DATA
=
0
;
...
...
examples/calculator/test/fuzztest/common/parse_fuzzer/parse_fuzzer.h
浏览文件 @
d2f3bb01
...
...
@@ -13,11 +13,9 @@
* limitations under the License.
*/
#include <cstdint>
#include <unistd.h>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <fcntl.h>
#ifndef _EXAMPLE_CALCULATOR_PARSE_FUZZER_H_
#define _EXAMPLE_CALCULATOR_PARSE_FUZZER_H_
#define FUZZ_PROJECT_NAME "parse_fuzzer"
#endif // _EXAMPLE_CALCULATOR_PARSE_FUZZER_H_
\ No newline at end of file
examples/detector/include/detector.h
浏览文件 @
d2f3bb01
...
...
@@ -13,7 +13,11 @@
* limitations under the License.
*/
#ifndef _EXAMPLE_DETECTOR_H_
#define _EXAMPLE_DETECTOR_H_
#include <stdio.h>
bool
IsPrime
(
int
n
);
bool
FileExist
(
const
char
*
fileName
);
#endif // _EXAMPLE_DETECTOR_H_
\ No newline at end of file
examples/sleep/include/sleep_ex.h
浏览文件 @
d2f3bb01
...
...
@@ -13,10 +13,11 @@
* limitations under the License.
*/
#include <sys/socket.h>
#include <string>
#include <unistd.h>
#ifndef EXAMPLE_SLEEP_H_
#define EXAMPLE_SLEEP_H_
typedef
void
(
*
time_callback
)(
void
*
);
int
Msleep
(
unsigned
long
milisec
);
double
ElapsedTime
(
time_callback
func
,
void
*
arg
);
#endif // EXAMPLE_SLEEP_H_
\ No newline at end of file
examples/sleep/src/sleep_ex.cpp
浏览文件 @
d2f3bb01
...
...
@@ -32,8 +32,10 @@ static double TimeDiff(struct timeval *x , struct timeval *y)
return
0
;
}
double
xUs
=
(
double
)
x
->
tv_sec
*
SleepTest
::
ID_MS_TO_NS_LEVEL
+
(
double
)
x
->
tv_usec
;
double
yUs
=
(
double
)
y
->
tv_sec
*
SleepTest
::
ID_MS_TO_NS_LEVEL
+
(
double
)
y
->
tv_usec
;
double
xUs
=
reinterpret_cast
<
double
>
(
x
->
tv_sec
*
SleepTest
::
ID_MS_TO_NS_LEVEL
)
+
reinterpret_cast
<
double
>
(
x
->
tv_usec
);
double
yUs
=
reinterpret_cast
<
double
>
(
y
->
tv_sec
*
SleepTest
::
ID_MS_TO_NS_LEVEL
)
+
reinterpret_cast
<
double
>
(
y
->
tv_usec
);
return
(
yUs
-
xUs
);
}
...
...
@@ -52,7 +54,7 @@ int Msleep(unsigned long miliSec)
{
struct
timespec
req
=
{
0
,
0
};
struct
timespec
rem
=
{
0
,
0
};
time_t
sec
=
(
int
)
(
miliSec
/
SleepTest
::
ID_SE_TO_MS_LEVEL
);
time_t
sec
=
reinterpret_cast
<
int
>
(
miliSec
/
SleepTest
::
ID_SE_TO_MS_LEVEL
);
miliSec
=
miliSec
-
(
sec
*
SleepTest
::
ID_SE_TO_MS_LEVEL
);
req
.
tv_sec
=
sec
;
req
.
tv_nsec
=
miliSec
*
SleepTest
::
ID_MS_TO_NS_LEVEL
;
...
...
ohos.build
已删除
100644 → 0
浏览文件 @
c947468e
{
"subsystem": "developertest",
"parts": {
"developertest": {
"module_list": [
"//test/developertest/examples/app_info:app_info",
"//test/developertest/examples/detector:detector",
"//test/developertest/examples/calculator:calculator",
"//test/developertest/examples/calculator:calculator_static"
],
"test_list": [
"//test/developertest/examples/app_info/test:unittest",
"//test/developertest/examples/calculator/test:unittest",
"//test/developertest/examples/calculator/test:fuzztest",
"//test/developertest/examples/calculator/test:benchmarktest",
"//test/developertest/examples/detector/test:unittest",
"//test/developertest/examples/sleep/test:performance",
"//test/developertest/examples/distributedb/test:distributedtest"
]
}
}
}
src/core/config/config_manager.py
浏览文件 @
d2f3bb01
...
...
@@ -92,7 +92,7 @@ class FilterConfigManager(object):
if
child
.
tag
!=
target_name
:
continue
for
child2
in
child
:
if
child2
.
tag
!=
product_form
.
lower
():
if
child2
.
tag
.
lower
()
!=
product_form
.
lower
():
continue
for
child3
in
child2
:
if
child3
.
text
!=
""
and
child3
.
text
is
not
None
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录