diff --git a/common/include/dscreen_errcode.h b/common/include/dscreen_errcode.h index 7fcc64d9d9e68d3d9c9375dd0cbc9dadbd6a3d3f..62774bfbde0ec2347e7d32321f01028e880a7394 100644 --- a/common/include/dscreen_errcode.h +++ b/common/include/dscreen_errcode.h @@ -75,6 +75,7 @@ enum DScreenErrorCode { ERR_DH_SCREEN_TRANS_STOP_CODEC_FAILED = -51009, ERR_DH_SCREEN_TRANS_CREATE_SURFACE_FAILED = -51010, ERR_DH_SCREEN_TRANS_SESSION_NOT_OPEN = -51011, + ERR_DH_SCREEN_TRANS_SESSION_CREATE_FAILED = -51012, // adapter ERR_DH_SCREEN_ADAPTER_SESSION_ID_NOT_FIND = -52000, ERR_DH_SCREEN_ADAPTER_UNREGISTER_SOFTBUS_LISTENER_FAIL = -52001, diff --git a/services/screenservice/test/unittest/sourceservice/dscreenmgr/src/dscreen_test.cpp b/services/screenservice/test/unittest/sourceservice/dscreenmgr/src/dscreen_test.cpp index 62794521493b203d1716bd62efaa813ef0890af9..c56b0eb5b2967188c7e55089c94d32c37548491a 100644 --- a/services/screenservice/test/unittest/sourceservice/dscreenmgr/src/dscreen_test.cpp +++ b/services/screenservice/test/unittest/sourceservice/dscreenmgr/src/dscreen_test.cpp @@ -330,7 +330,7 @@ HWTEST_F(DScreenTest, SetUp_001, TestSize.Level1) dScreen_->videoParam_->SetScreenHeight(100); dScreen_->videoParam_->SetScreenWidth(100); int32_t ret = dScreen_->SetUp(); - EXPECT_EQ(-1, ret); + EXPECT_EQ(ERR_DH_SCREEN_TRANS_SESSION_CREATE_FAILED, ret); } /** @@ -350,7 +350,7 @@ HWTEST_F(DScreenTest, SetUp_002, TestSize.Level1) dScreen_->videoParam_->SetScreenHeight(100); dScreen_->videoParam_->SetScreenWidth(100); int32_t ret = dScreen_->SetUp(); - EXPECT_EQ(-1, ret); + EXPECT_EQ(ERR_DH_SCREEN_TRANS_SESSION_CREATE_FAILED, ret); } /** diff --git a/services/screentransport/screensourcetrans/src/screen_source_trans.cpp b/services/screentransport/screensourcetrans/src/screen_source_trans.cpp index 1febf8ef583a0277766d171f7aa9a30c0de28e2e..bacb2f78430b91d6889ef8e4b72683e362b95f78 100644 --- a/services/screentransport/screensourcetrans/src/screen_source_trans.cpp +++ b/services/screentransport/screensourcetrans/src/screen_source_trans.cpp @@ -285,7 +285,7 @@ int32_t ScreenSourceTrans::RegisterChannelListener() if (ret != DH_SUCCESS) { DHLOGE("%s: Create session failed ret: %" PRId32, LOG_TAG); ReportOptFail(DSCREEN_OPT_FAIL, ret, "dscreen source Create session failed."); - return ret; + return ERR_DH_SCREEN_TRANS_SESSION_CREATE_FAILED; } return DH_SUCCESS; diff --git a/services/screentransport/test/unittest/screensourcetrans/src/screen_source_trans_test.cpp b/services/screentransport/test/unittest/screensourcetrans/src/screen_source_trans_test.cpp index 0bce0f9e41570b34abab9b117e5ece49511b7663..65d1275979de109a197be62ea71450b9e18367aa 100644 --- a/services/screentransport/test/unittest/screensourcetrans/src/screen_source_trans_test.cpp +++ b/services/screentransport/test/unittest/screensourcetrans/src/screen_source_trans_test.cpp @@ -74,7 +74,7 @@ HWTEST_F(ScreenSourceTransTest, SetUp_002, TestSize.Level1) int32_t actual = trans->SetUp(localParam, remoteParam, peerDevId); - EXPECT_EQ(-1, actual); + EXPECT_EQ(ERR_DH_SCREEN_TRANS_SESSION_CREATE_FAILED, actual); } /** @@ -91,7 +91,7 @@ HWTEST_F(ScreenSourceTransTest, InitScreenTrans_001, TestSize.Level1) trans->screenChannel_ = std::make_shared(); int32_t actual = trans->InitScreenTrans(localParam, remoteParam, peerDevId); - EXPECT_EQ(-1, actual); + EXPECT_EQ(ERR_DH_SCREEN_TRANS_SESSION_CREATE_FAILED, actual); } /** diff --git a/services/softbusadapter/test/unittest/src/softbus_adapter_test.cpp b/services/softbusadapter/test/unittest/src/softbus_adapter_test.cpp index 126182326b7ecb39f484b265b9208695a9480331..2cf6ccc133953fccd835f5309365a99785024e9e 100644 --- a/services/softbusadapter/test/unittest/src/softbus_adapter_test.cpp +++ b/services/softbusadapter/test/unittest/src/softbus_adapter_test.cpp @@ -104,7 +104,7 @@ HWTEST_F(SoftbusAdapterTest, CreateSoftbusSessionServer_001, TestSize.Level1) softbusAdapter.OnBytesReceived(sessionId, data, dataLen); softbusAdapter.OnStreamReceived(sessionId, streamData, ext, frameInfo); int32_t actual = softbusAdapter.CreateSoftbusSessionServer(pkgname, sessionName, peerDevId); - EXPECT_EQ(DH_SUCCESS, actual); + EXPECT_EQ(ERR_DH_SCREEN_TRANS_SESSION_CREATE_FAILED, actual); softbusAdapter.RemoveSoftbusSessionServer(pkgname, sessionName, peerDevId); }