1f857971dSopenharmony_ci/*
2f857971dSopenharmony_ci * Copyright (c) 2021 Huawei Device Co., Ltd.
3f857971dSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4f857971dSopenharmony_ci * you may not use this file except in compliance with the License.
5f857971dSopenharmony_ci * You may obtain a copy of the License at
6f857971dSopenharmony_ci *
7f857971dSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8f857971dSopenharmony_ci *
9f857971dSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10f857971dSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11f857971dSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12f857971dSopenharmony_ci * See the License for the specific language governing permissions and
13f857971dSopenharmony_ci * limitations under the License.
14f857971dSopenharmony_ci */
15f857971dSopenharmony_ci
16f857971dSopenharmony_ci#ifndef DEVICESTATUSCLIENT_FUZZER_H
17f857971dSopenharmony_ci#define DEVICESTATUSCLIENT_FUZZER_H
18f857971dSopenharmony_ci
19f857971dSopenharmony_ci#include <cstdint>
20f857971dSopenharmony_ci#include <unistd.h>
21f857971dSopenharmony_ci#include <climits>
22f857971dSopenharmony_ci#include <cstdio>
23f857971dSopenharmony_ci#include <cstdlib>
24f857971dSopenharmony_ci#include <fcntl.h>
25f857971dSopenharmony_ci#include <iostream>
26f857971dSopenharmony_ci#include <random>
27f857971dSopenharmony_ci#include <thread>
28f857971dSopenharmony_ci
29f857971dSopenharmony_ci#include "devicestatus_callback_stub.h"
30f857971dSopenharmony_ci#include "stationary_manager.h"
31f857971dSopenharmony_ci
32f857971dSopenharmony_ci#define FUZZ_PROJECT_NAME "devicestatusclient_fuzzer"
33f857971dSopenharmony_ci
34f857971dSopenharmony_cinamespace OHOS {
35f857971dSopenharmony_cinamespace Msdp {
36f857971dSopenharmony_cinamespace DeviceStatus {
37f857971dSopenharmony_ci
38f857971dSopenharmony_ciclass DeviceStatusClientFuzzer {
39f857971dSopenharmony_cipublic:
40f857971dSopenharmony_ci    static bool DoSomethingInterestingWithMyAPI(const uint8_t* data, size_t size);
41f857971dSopenharmony_ci    static void TestSubscribeCallback(const uint8_t* data);
42f857971dSopenharmony_ci    static void TestGetDevicestatusData(Type type);
43f857971dSopenharmony_ci    static void TestUnSubscribeCallback(Type type);
44f857971dSopenharmony_ci
45f857971dSopenharmony_ci    class DeviceStatusTestCallback : public DeviceStatusCallbackStub {
46f857971dSopenharmony_ci    public:
47f857971dSopenharmony_ci        DeviceStatusTestCallback() {};
48f857971dSopenharmony_ci        virtual ~DeviceStatusTestCallback() {};
49f857971dSopenharmony_ci        virtual void OnDeviceStatusChanged(const Data& devicestatusData) override;
50f857971dSopenharmony_ci    };
51f857971dSopenharmony_ci};
52f857971dSopenharmony_ci} // namespace DeviceStatus
53f857971dSopenharmony_ci} // namespace Msdp
54f857971dSopenharmony_ci} // namespace OHOS
55f857971dSopenharmony_ci#endif // DEVICESTATUSCLIENT_FUZZER_H
56