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 #ifndef OHOS_EXTERNAL_FILE_ACCESS_TEST_BASIC_H
16 #define OHOS_EXTERNAL_FILE_ACCESS_TEST_BASIC_H
17 
18 #include <gtest/gtest.h>
19 
20 #include "file_access_helper.h"
21 
22 namespace OHOS {
23 namespace FileAccessFwk {
24 using namespace std;
25 
26 const int ABILITY_ID = 5003;
27 const int INIT_THREADS_NUMBER = 4;
28 const int ACTUAL_SUCCESS_THREADS_NUMBER = 1;
29 const int UID_TRANSFORM_TMP = 20000000;
30 const int SLEEP_TIME = 2;
31 const int UID_DEFAULT = 0;
32 const int FILE_COUNT_1 = 1;
33 const int FILE_COUNT_2 = 2;
34 const int FILE_COUNT_3 = 3;
35 const int FILE_COUNT_4 = 4;
36 const int FILE_COUNT_5 = 5;
37 const int FILE_COUNT_6 = 6;
38 
39 class FileExtensionHelperTest : public testing::Test {
40 public:
41     static void SetUpTestCase();
42     static void TearDownTestCase();
43     void SetUp() override;
44     void TearDown() override;
45     static bool ReplaceBundleNameFromPath(std::string &path, const std::string &newName);
46     static bool ReplaceBundleName(std::string& str, const std::string& newBundleName);
47     static shared_ptr<FileAccessHelper> GetFileAccessHelper();
48     static shared_ptr<OHOS::AbilityRuntime::Context> GetContext();
49 };
50 } // namespace FileAccessFwk
51 } // namespace OHOS
52 
53 #endif // OHOS_EXTERNAL_FILE_ACCESS_TEST_H
54