1 /* 2 * Copyright (c) 2021 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 #ifndef OS_ACCOUNT_TEST_SYSTEMTEST_COMMON_RESOURCE_FUZZTEST_INCLUDE_GET_PARAM_H 17 #define OS_ACCOUNT_TEST_SYSTEMTEST_COMMON_RESOURCE_FUZZTEST_INCLUDE_GET_PARAM_H 18 19 #include <memory> 20 #include <string> 21 #include <vector> 22 #include "app_account_info.h" 23 #include "app_account_manager.h" 24 #include "app_account_subscribe_info.h" 25 #include "app_account_subscriber.h" 26 #include "os_account_manager.h" 27 28 namespace OHOS { 29 namespace AccountSA { 30 bool GetBoolParam(); 31 uint8_t GetU8Param(); 32 unsigned int GetUIntParam(); 33 uint16_t GetU16Param(); 34 uint32_t GetU32Param(); 35 uint64_t GetU64Param(); 36 int8_t GetS8Param(); 37 int16_t GetS16Param(); 38 int32_t GetS32Param(); 39 int64_t GetS64Param(); 40 char32_t GetChar32Param(); 41 42 short GetShortParam(); 43 long GetLongParam(); 44 int GetIntParam(); 45 double GetDoubleParam(); 46 float GetFloatParam(); 47 char GetCharParam(); 48 char *GetCharArryParam(); 49 std::string GetStringParam(); 50 std::vector<bool> GetBoolVectorParam(); 51 std::vector<short> GetShortVectorParam(); 52 std::vector<long> GetLongVectorParam(); 53 std::vector<int> GetIntVectorParam(); 54 std::vector<float> GetFloatVectorParam(); 55 std::vector<double> GetDoubleVectorParam(); 56 std::vector<char> GetCharVectorParam(); 57 std::vector<char32_t> GetChar32VectorParam(); 58 std::vector<std::string> GetStringVectorParam(); 59 template<class T> 60 std::vector<T> GetUnsignVectorParam(); 61 std::vector<int8_t> GetS8VectorParam(); 62 std::vector<int16_t> GetS16VectorParam(); 63 std::vector<int32_t> GetS32VectorParam(); 64 std::vector<int64_t> GetS64VectorParam(); 65 OsAccountType GetParamOsAccountType(); 66 OsAccountInfo GetParamOsAccountInfo(); 67 DomainAccountInfo GetParamDomainAccountInfo(); 68 69 AppAccountInfo GetParamAppAccountInfo(); 70 std::vector<AppAccountInfo> GetVectorParamAppAccountInfo(); 71 std::shared_ptr<AppAccountSubscriber> GetAppAccountSubscriber(); 72 73 class TestAppAccountSubscriber : public AppAccountSubscriber { 74 public: TestAppAccountSubscriber()75 TestAppAccountSubscriber() {} ~TestAppAccountSubscriber()76 ~TestAppAccountSubscriber() {} OnAccountsChanged(const std::vector<AppAccountInfo> & accounts)77 virtual void OnAccountsChanged(const std::vector<AppAccountInfo> &accounts) 78 { 79 printf("Fuzz Test OnAccountsChanged\n"); 80 } 81 }; 82 83 class TestOsAccountSubscriber : public OsAccountSubscriber { 84 public: TestOsAccountSubscriber()85 TestOsAccountSubscriber() {}; ~TestOsAccountSubscriber()86 ~TestOsAccountSubscriber() {}; OnAccountsChanged(const int & id)87 virtual void OnAccountsChanged(const int &id) 88 { 89 printf("Fuzz Test OnAccountsChanged\n"); 90 } 91 }; 92 } // namespace AccountSA 93 } // namespace OHOS 94 #endif // OS_ACCOUNT_TEST_SYSTEMTEST_COMMON_RESOURCE_FUZZTEST_INCLUDE_GET_PARAM_H