1 /*
2 * Copyright (C) 2024 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 #include "gtest/gtest.h"
17 #include "sms_mms_common.h"
18 #include "sms_persist_helper.h"
19
20 namespace OHOS {
21 namespace Telephony {
22 using namespace testing::ext;
23
24 class SmsMmsCommonTest : public testing::Test {
25 public:
26 static void SetUpTestCase();
27 static void TearDownTestCase();
28 void SetUp();
29 void TearDown();
30 };
SetUpTestCase()31 void SmsMmsCommonTest::SetUpTestCase() {}
32
33 constexpr uint32_t EVENT_RELEASE_DATA_SHARE_HELPER = 10000;
TearDownTestCase()34 void SmsMmsCommonTest::TearDownTestCase()
35 {
36 DelayedSingleton<SmsPersistHelper>::GetInstance()->RemoveEvent(EVENT_RELEASE_DATA_SHARE_HELPER);
37 }
38
SetUp()39 void SmsMmsCommonTest::SetUp() {}
40
TearDown()41 void SmsMmsCommonTest::TearDown() {}
42
43 /**
44 * @tc.number Telephony_SmsMmsCommonTest_SendBroadcast_0001
45 * @tc.name Test SendBroadcast
46 * @tc.desc Function test
47 */
48 HWTEST_F(SmsMmsCommonTest, SendBroadcast_0001, Function | MediumTest | Level1)
49 {
50 std::string sendStatus = "";
51 uint16_t dataBaseId = 0;
52 auto smsCommon = DelayedSingleton<SmsMmsCommon>::GetInstance();
53 smsCommon->SendBroadcast(dataBaseId, SmsMmsCommonData::SMS_MMS_SENT_RESULT_NOTIFY, sendStatus,
54 SmsMmsCommonData::SMS_MMS_INFO_MMS_TYPE);
55 EXPECT_TRUE(smsCommon != nullptr);
56 }
57 } // namespace Telephony
58 } // namespace OHOS