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 NATIVE_RDB_TEST_COMMON_H 17 #define NATIVE_RDB_TEST_COMMON_H 18 19 #include <string> 20 21 #include "values_bucket.h" 22 23 namespace OHOS { 24 namespace NativeRdb { 25 26 static const std::string RDB_TEST_PATH = "/data/test/"; 27 struct RowData { 28 int id; 29 std::string name; 30 int age; 31 double salary; 32 std::vector<uint8_t> blobType; 33 AssetValue asset; 34 std::vector<AssetValue> assets; 35 }; 36 37 struct RowDatas { 38 int id; 39 std::string eName; 40 int jobId; 41 ValueObject mgr; 42 std::string joinDate; 43 double salary; 44 ValueObject bonus; 45 int deptId; 46 }; 47 48 class UTUtils { 49 public: 50 static ValuesBucket SetRowData(const RowData &rowData); 51 52 static ValuesBucket SetRowDatas(const RowDatas &rowDatas); 53 54 static const RowData g_rowData[3]; 55 56 static const RowDatas gRowDatas[14]; 57 }; 58 59 } // namespace NativeRdb 60 } // namespace OHOS 61 62 #endif 63