Merge pull request !6248 from 夏文腾/master
This commit is contained in:
openharmony_ci 2024-05-25 09:12:12 +00:00 committed by Gitee
commit a9a98c6f2d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
7 changed files with 42 additions and 8 deletions

View File

@ -153,6 +153,7 @@ public:
connectCb.OnDisconnected = OnDisconnected;
connectCb.OnDataReceived = OnDataReceived;
LooperInit();
SoftbusConfigInit();
NiceMock<ConnectionBleManagerInterfaceMock> bleMock;
@ -161,7 +162,10 @@ public:
g_bleInterface = ConnInitBle(&connectCb);
ASSERT_NE(g_bleInterface, NULL);
}
void TearDown() override {};
void TearDown() override
{
LooperDeinit();
}
};
void ConnectionBleManagerTest::TearDownTestCase()

View File

@ -20,6 +20,7 @@
#include <securec.h>
#include "common_list.h"
#include "message_handler.h"
#include "conn_log.h"
#include "softbus_conn_interface.h"
#include "softbus_conn_manager.h"
@ -88,12 +89,15 @@ public:
void ConnectionBleSwitchTest::SetUpTestCase(void)
{
LooperInit();
SoftbusConfigInit();
ConnServerInit();
}
void ConnectionBleSwitchTest::TearDownTestCase(void)
{}
{
LooperDeinit();
}
void ConnectionBleSwitchTest::SetUp(void)
{}

View File

@ -44,17 +44,23 @@ void DataReceivedCB(unsigned int connectionId, ConnModule moduleId, int64_t seq,
class ConnectionBleTest : public testing::Test {
public:
static void SetUpTestCase();
static void TearDownTestCase() {}
static void TearDownTestCase();
void SetUp() override {}
void TearDown() override {}
};
void ConnectionBleTest::SetUpTestCase()
{
LooperInit();
SoftbusConfigInit();
ConnServerInit();
}
void ConnectionBleTest::TearDownTestCase()
{
LooperDeinit();
}
/*
* @tc.name: TransTest001
* @tc.desc: Test ConnBlePackCtlMessage.

View File

@ -66,18 +66,24 @@ namespace OHOS {
class ConnectionBleTransTest : public testing::Test {
public:
static void SetUpTestCase();
static void TearDownTestCase() {}
static void TearDownTestCase();
void SetUp() override {}
void TearDown() override {}
};
void ConnectionBleTransTest::SetUpTestCase()
{
LooperInit();
g_transEventListener.onPostBytesFinished = OnPostBytesFinished;
int32_t ret = ConnBleInitTransModule(&g_transEventListener);
EXPECT_EQ(SOFTBUS_OK, ret);
}
void ConnectionBleTransTest::TearDownTestCase()
{
LooperDeinit();
}
/*
* @tc.name: TransRecv
* @tc.desc: Test ConnCocTransRecv.

View File

@ -137,9 +137,15 @@ public:
void TearDown();
};
void ConnectionBrConnectionTest::SetUpTestCase(void){ }
void ConnectionBrConnectionTest::SetUpTestCase(void)
{
LooperInit();
}
void ConnectionBrConnectionTest::TearDownTestCase(void) { }
void ConnectionBrConnectionTest::TearDownTestCase(void)
{
LooperDeinit();
}
void ConnectionBrConnectionTest::SetUp(void) { }
@ -160,6 +166,7 @@ ConnectFuncInterface *g_connectFuncInterface = NULL;
ConnectFuncInterface *ConnInit(void)
{
LooperInit();
ConnectCallback callback = {
.OnConnected = OnConnected,
.OnDisconnected = OnDisconnected,

View File

@ -190,11 +190,15 @@ public:
void ConnectionBrConnectionTest::SetUpTestCase(void)
{
LooperInit();
SoftbusConfigInit();
ConnServerInit();
}
void ConnectionBrConnectionTest::TearDownTestCase(void) { }
void ConnectionBrConnectionTest::TearDownTestCase(void)
{
LooperDeinit();
}
void ConnectionBrConnectionTest::SetUp(void) { }

View File

@ -101,12 +101,15 @@ public:
void ConnectionBrTest::SetUpTestCase(void)
{
LooperInit();
SoftbusConfigInit();
ConnServerInit();
}
void ConnectionBrTest::TearDownTestCase(void)
{}
{
LooperDeinit();
}
void ConnectionBrTest::SetUp(void)
{}