Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
e7108819
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看板
提交
e7108819
编写于
7月 16, 2023
作者:
H
hu0475
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
完成telephony子系统socket模块的跨平台测试套
Signed-off-by:
N
hu0475
<
huyanqiang5@huawei.com
>
上级
08b337d1
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
21 addition
and
9 deletion
+21
-9
telephony/BUILD.gn
telephony/BUILD.gn
+1
-1
telephony/crossplatform/socket/BUILD.gn
telephony/crossplatform/socket/BUILD.gn
+1
-1
telephony/crossplatform/socket/src/main/ets/test/socket.testerror.ets
...ossplatform/socket/src/main/ets/test/socket.testerror.ets
+19
-7
未找到文件。
telephony/BUILD.gn
浏览文件 @
e7108819
...
...
@@ -14,8 +14,8 @@
group("telephony") {
testonly = true
deps = [
"crossplatform/telephony_http_test:ActsCrossplatformTelephonyHttpEtsTest",
"crossplatform/socket:ActsCrossplatformSocketTest",
"crossplatform/telephony_http_test:ActsCrossplatformTelephonyHttpEtsTest",
"telephonyjstest:telephonyjstest",
]
}
telephony/crossplatform/socket/BUILD.gn
浏览文件 @
e7108819
...
...
@@ -35,4 +35,4 @@ ohos_resources("windowStage_resources") {
sources = [ "src/main/resources" ]
deps = [ ":windowStage_app_profile" ]
hap_profile = "src/main/module.json"
}
\ No newline at end of file
}
telephony/crossplatform/socket/src/main/ets/test/socket.testerror.ets
浏览文件 @
e7108819
...
...
@@ -60,11 +60,12 @@ export default function socketTest() {
promise.then(()=>{
console.log('test_Socket_setExtraOptions_Tcp_Error_002 success' );
expect(false).assertTrue();
tcp.close();
done();
tcp.close(err => {
expect(err == undefined).assertTrue();
done();
})
}).catch(err=>{
console.log('test_Socket_setExtraOptions_Tcp_Error_002 err :' + JSON.stringify(err));
// expect(err.code == 2301088).assertTrue();
tcp.close(()=>{
setTimeout(function (){
done();
...
...
@@ -166,6 +167,7 @@ export default function socketTest() {
done();
} catch (err) {
console.log('test_Socket_Tcp_Bind_001 error' + JSON.stringify(err));
expect().assertFail();
tcp.close();
done();
}
...
...
@@ -189,6 +191,7 @@ export default function socketTest() {
done();
})} catch(err) {
console.log('test_Socket_Tcp_Bind_002 bind fail');
expect().assertFail();
tcp.close();
done();
};
...
...
@@ -216,6 +219,7 @@ export default function socketTest() {
})
} catch (err) {
console.log('test_Socket_Tcp_Connect_001 error' + JSON.stringify(err));
expect().assertFail();
tcp.close();
done();
}
...
...
@@ -244,6 +248,7 @@ export default function socketTest() {
})
} catch (err) {
console.log('test_Socket_Tcp_Connect_002 error' + JSON.stringify(err));
expect().assertFail();
tcp.close();
done();
}
...
...
@@ -272,6 +277,7 @@ export default function socketTest() {
})
} catch (err) {
console.log('test_Socket_Tcp_Connect_Promise_Error_001 error' + JSON.stringify(err));
expect().assertFail();
tcp.close();
done();
}
...
...
@@ -298,6 +304,7 @@ export default function socketTest() {
})
} catch (err) {
console.log('test_Socket_Tcp_Connect_Promise_Error_001 error' + JSON.stringify(err));
expect().assertFail();
done();
}
})
...
...
@@ -457,7 +464,6 @@ export default function socketTest() {
expect(err.code == 2301009).assertTrue();
tcp.close();
done();
// return;
} else {
console.log('test_Socket_setExtraOptions_Tcp_Error_001 success');
tcp.close();
...
...
@@ -546,6 +552,7 @@ export default function socketTest() {
done();
} catch (err) {
console.log('test_Socket_Udp_Bind_001 error' + JSON.stringify(err))
expect().assertFail();
done();
}
})
...
...
@@ -559,17 +566,16 @@ export default function socketTest() {
* @tc.level : Level 2
*/
it('test_Socket_Udp_Bind_002', 0,async function (done) {
let udp = socket.constructUDPSocketInstance();
try{
let promise = udp.bind({ address: '127.0.0.1', port: 0, family: 1 });
promise.then(async () => {
console.log('bind success');
udp.close();
done();
})} catch(err) {
console.log('bind fail');
expect().assertFail();
done();
};
})
...
...
@@ -746,6 +752,7 @@ export default function socketTest() {
done();
})
}catch (err){
expect().assertFail();
done();
}
});
...
...
@@ -767,6 +774,7 @@ export default function socketTest() {
done();
} catch (err) {
console.log('test_Socket_Udp_Bind_001 error' + JSON.stringify(err))
expect().assertFail();
done();
}
})
...
...
@@ -789,6 +797,7 @@ export default function socketTest() {
done();
})} catch(err) {
console.log('bind fail');
expect().assertFail();
done();
};
})
...
...
@@ -818,7 +827,6 @@ export default function socketTest() {
* @tc.level : Level 2
*/
it('test_Socket_Close_Tls_Error_002', 0, function (done) {
let tls = socket.constructUDPSocketInstance();
let promise = tls.close();
promise.then((err) => {
...
...
@@ -903,6 +911,7 @@ export default function socketTest() {
})
} catch (err) {
console.log('test_Socket_tls_Connect_001 error' + JSON.stringify(err));
expect().assertFail();
done();
}
})
...
...
@@ -929,6 +938,7 @@ export default function socketTest() {
})
} catch (err) {
console.log('test_Socket_tls_Connect_002 error' + JSON.stringify(err));
expect().assertFail();
done();
}
})
...
...
@@ -956,6 +966,7 @@ export default function socketTest() {
})
} catch (err) {
console.log('test_Socket_tls_Connect_Promise_Error_001 error' + JSON.stringify(err));
expect().assertFail();
done();
}
})
...
...
@@ -982,6 +993,7 @@ export default function socketTest() {
})
} catch (err) {
console.log('test_Socket_tls_Connect_Promise_Error_001 error' + JSON.stringify(err));
expect().assertFail();
done();
}
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录