fix: 删除无效用例
Signed-off-by: zhushengle <zhushengle@huawei.com> Change-Id: I8d932d850705f2ef9d54a53403fef2a44e77a2fc
This commit is contained in:
parent
216c124854
commit
3cd28f32ca
|
|
@ -41,32 +41,3 @@ sources_smoke = []
|
||||||
sources_pressure = []
|
sources_pressure = []
|
||||||
|
|
||||||
sources_full = []
|
sources_full = []
|
||||||
|
|
||||||
# jffs module
|
|
||||||
if (LOSCFG_USER_TEST_FS_JFFS == true) {
|
|
||||||
import("./jffs/config.gni")
|
|
||||||
common_include_dirs += jffs_include_dirs
|
|
||||||
sources_entry += jffs_sources_entry
|
|
||||||
sources_smoke += jffs_sources_smoke
|
|
||||||
sources_pressure += jffs_sources_pressure
|
|
||||||
sources_full += jffs_sources_full
|
|
||||||
}
|
|
||||||
|
|
||||||
# proc module
|
|
||||||
if (LOSCFG_USER_TEST_FS_PROC == true) {
|
|
||||||
import("./proc/config.gni")
|
|
||||||
common_include_dirs += proc_include_dirs
|
|
||||||
sources_entry += proc_sources_entry
|
|
||||||
sources_smoke += proc_sources_smoke
|
|
||||||
sources_full += proc_sources_full
|
|
||||||
}
|
|
||||||
|
|
||||||
# vfat module
|
|
||||||
if (LOSCFG_USER_TEST_FS_VFAT == true) {
|
|
||||||
import("./vfat/config.gni")
|
|
||||||
common_include_dirs += vfat_include_dirs
|
|
||||||
sources_entry += vfat_sources_entry
|
|
||||||
sources_smoke += vfat_sources_smoke
|
|
||||||
sources_pressure += vfat_sources_pressure
|
|
||||||
sources_full += vfat_sources_full
|
|
||||||
}
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,801 +0,0 @@
|
||||||
# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
#
|
|
||||||
# Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
# are permitted provided that the following conditions are met:
|
|
||||||
#
|
|
||||||
# 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
# conditions and the following disclaimer.
|
|
||||||
#
|
|
||||||
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
# of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
# provided with the distribution.
|
|
||||||
#
|
|
||||||
# 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
# to endorse or promote products derived from this software without specific prior written
|
|
||||||
# permission.
|
|
||||||
#
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
import("//kernel/liteos_a/testsuites/unittest/config.gni")
|
|
||||||
|
|
||||||
jffs_include_dirs = [ "$TEST_UNITTEST_DIR/fs/jffs" ]
|
|
||||||
|
|
||||||
jffs_sources_entry = [ "$TEST_UNITTEST_DIR/fs/jffs/vfs_jffs_test.cpp" ]
|
|
||||||
|
|
||||||
jffs_sources_smoke = [
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/smoke/It_vfs_jffs_001.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/smoke/It_vfs_jffs_002.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/smoke/It_vfs_jffs_003.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/smoke/It_vfs_jffs_005.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/smoke/It_vfs_jffs_021.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/smoke/It_vfs_jffs_022.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/smoke/It_vfs_jffs_026.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/smoke/It_vfs_jffs_027.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/smoke/It_vfs_jffs_034.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/smoke/It_vfs_jffs_035.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/smoke/It_vfs_jffs_094.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/smoke/It_vfs_jffs_095.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/smoke/It_vfs_jffs_103.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/smoke/It_vfs_jffs_535.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/smoke/It_vfs_jffs_Dac_001.cpp",
|
|
||||||
]
|
|
||||||
|
|
||||||
jffs_sources_smoke = [
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_performance_001.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_performance_002.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_performance_003.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_performance_004.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_performance_005.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_performance_006.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_performance_007.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_performance_008.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_performance_009.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_performance_010.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_performance_011.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_performance_012.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_performance_013.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_001.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_002.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_003.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_004.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_005.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_006.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_007.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_008.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_009.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_010.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_011.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_012.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_014.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_015.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_016.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_017.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_018.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_019.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_020.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_021.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_022.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_023.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_024.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_025.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_026.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_027.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_028.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_029.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_030.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_031.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_032.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_033.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_034.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_035.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_036.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_037.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_038.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_039.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_040.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_041.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_042.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_043.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_044.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_045.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_046.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_047.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_048.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_049.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_050.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_051.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_052.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_053.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_301.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_302.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_303.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_304.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_305.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_306.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_307.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_308.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_309.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_310.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_311.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_312.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_313.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_314.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_fs_jffs_pressure_315.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_001.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_002.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_003.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_004.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_005.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_006.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_007.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_008.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_009.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_010.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_011.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_012.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_013.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_014.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_015.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_016.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_017.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_018.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_019.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_020.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_021.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_022.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_023.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_024.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_025.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_026.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_027.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_028.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_029.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_030.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_031.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_032.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_033.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_034.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_035.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_036.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_037.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_038.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_039.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_040.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_041.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_042.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_043.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_044.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_045.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_046.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_047.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_048.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_049.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_050.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_051.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_052.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_053.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_054.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_055.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_056.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_057.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_058.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_059.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_060.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_061.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_062.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/pressure/It_vfs_jffs_multipthread_063.cpp",
|
|
||||||
]
|
|
||||||
|
|
||||||
jffs_sources_full = [
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_test_faccessat_001.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_test_faccessat_002.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_test_fstatat_001.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_test_fstatat_002.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_test_fstatfs_001.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_test_fstatfs_002.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/it_test_fs_jffs_001.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/it_test_fs_jffs_002.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/it_test_fs_jffs_003.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/it_test_fs_jffs_004.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/it_test_fs_jffs_100.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/it_test_fs_jffs_101.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/it_test_fs_jffs_106.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/it_test_fs_jffs_112.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/it_test_fs_jffs_113.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_001.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_002.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_003.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_004.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_005.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_006.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_007.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_008.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_009.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_010.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_011.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_012.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_013.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_014.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_015.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_016.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_017.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_018.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_019.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_020.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_021.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_022.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_023.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_024.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_025.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_026.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_027.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_028.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_029.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_030.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_031.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_032.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_033.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_034.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_035.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_036.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_037.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_038.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_039.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_040.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_041.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_042.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_043.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_jffs_044.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_004.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_006.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_007.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_008.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_009.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_010.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_011.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_012.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_013.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_014.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_015.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_016.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_017.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_018.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_019.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_020.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_023.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_024.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_025.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_028.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_029.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_030.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_031.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_032.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_033.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_037.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_038.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_039.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_040.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_041.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_042.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_043.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_044.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_045.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_046.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_048.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_049.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_050.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_051.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_053.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_055.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_056.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_057.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_058.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_059.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_060.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_061.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_062.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_063.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_064.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_065.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_066.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_067.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_068.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_069.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_070.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_071.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_072.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_073.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_074.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_076.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_077.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_078.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_079.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_080.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_081.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_082.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_083.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_084.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_085.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_086.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_088.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_090.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_092.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_093.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_096.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_097.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_099.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_100.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_101.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_102.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_104.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_105.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_106.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_107.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_116.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_117.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_118.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_119.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_120.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_121.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_122.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_123.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_124.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_125.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_126.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_127.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_128.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_129.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_130.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_131.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_132.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_133.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_134.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_135.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_136.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_137.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_138.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_139.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_140.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_141.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_142.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_143.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_144.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_145.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_146.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_147.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_148.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_149.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_150.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_151.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_152.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_153.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_154.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_155.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_156.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_157.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_158.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_159.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_160.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_161.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_162.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_163.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_164.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_165.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_166.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_167.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_168.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_169.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_170.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_171.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_172.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_173.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_174.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_175.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_176.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_177.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_178.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_179.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_180.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_182.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_183.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_184.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_185.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_187.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_188.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_189.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_190.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_191.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_192.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_193.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_194.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_195.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_196.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_197.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_198.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_199.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_200.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_201.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_202.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_203.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_204.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_205.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_206.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_207.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_208.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_209.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_210.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_211.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_212.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_213.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_214.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_215.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_216.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_217.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_218.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_219.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_220.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_221.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_222.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_223.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_224.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_225.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_226.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_227.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_228.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_229.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_230.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_231.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_232.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_233.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_234.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_235.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_236.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_237.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_238.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_239.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_240.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_241.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_242.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_243.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_244.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_245.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_246.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_247.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_248.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_249.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_250.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_251.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_252.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_253.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_254.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_255.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_256.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_257.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_258.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_259.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_260.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_261.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_262.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_263.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_264.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_265.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_266.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_267.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_268.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_269.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_270.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_271.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_272.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_273.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_274.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_275.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_276.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_277.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_278.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_279.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_280.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_281.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_282.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_283.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_284.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_285.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_286.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_287.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_288.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_289.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_290.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_291.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_292.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_293.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_294.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_295.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_296.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_297.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_298.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_299.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_300.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_301.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_302.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_303.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_304.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_305.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_306.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_307.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_308.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_309.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_310.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_311.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_312.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_313.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_314.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_315.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_316.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_317.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_318.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_319.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_320.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_321.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_322.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_323.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_324.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_325.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_326.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_327.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_328.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_329.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_330.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_331.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_332.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_333.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_334.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_335.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_336.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_337.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_338.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_339.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_340.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_342.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_343.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_344.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_346.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_352.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_353.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_354.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_355.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_356.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_357.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_358.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_359.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_360.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_361.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_362.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_364.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_365.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_366.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_367.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_368.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_369.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_370.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_371.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_372.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_373.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_374.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_375.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_376.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_377.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_378.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_379.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_380.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_381.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_382.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_383.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_384.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_385.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_386.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_387.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_388.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_389.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_390.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_391.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_392.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_393.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_394.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_395.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_396.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_397.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_398.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_399.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_400.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_401.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_402.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_403.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_404.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_405.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_406.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_407.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_408.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_409.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_410.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_411.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_412.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_413.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_414.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_415.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_416.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_417.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_418.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_419.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_420.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_421.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_422.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_423.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_424.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_425.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_426.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_427.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_428.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_429.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_430.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_431.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_432.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_433.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_434.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_435.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_454.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_455.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_456.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_457.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_458.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_459.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_460.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_461.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_462.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_487.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_488.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_489.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_490.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_491.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_492.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_493.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_494.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_495.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_496.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_497.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_498.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_499.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_500.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_501.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_502.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_503.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_504.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_505.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_506.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_507.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_508.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_509.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_510.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_511.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_512.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_513.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_514.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_515.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_516.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_517.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_518.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_519.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_520.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_521.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_522.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_523.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_524.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_526.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_528.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_529.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_530.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_531.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_532.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_533.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_534.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_541.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_542.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_543.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_544.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_545.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_546.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_547.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_548.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_549.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_550.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_551.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_552.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_553.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_554.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_555.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_556.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_557.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_560.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_562.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_563.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_564.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_565.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_566.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_567.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_568.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_569.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_570.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_571.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_572.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_573.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_574.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_583.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_584.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_586.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_589.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_590.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_591.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_592.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_593.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_594.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_595.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_596.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_603.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_636.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_643.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_644.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_645.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_646.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_648.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_649.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_650.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_651.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_652.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_653.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_654.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_655.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_656.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_663.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_664.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_665.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_666.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_668.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_669.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_670.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_671.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_672.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_673.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_674.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_675.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_676.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_690.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_694.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_696.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_697.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_700.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_701.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_807.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_jffs_808.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_test_link_001.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_test_link_002.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_test_link_003.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_test_linkat_001.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_test_linkat_002.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_test_linkat_003.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_test_readlink_001.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_test_symlink_001.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_test_symlink_002.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_test_symlink_003.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_test_symlinkat_001.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_test_mount_rdonly_001.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_test_mount_rdonly_002.cpp",
|
|
||||||
"$TEST_UNITTEST_DIR/fs/jffs/full/It_vfs_test_mount_rdonly_003.cpp",
|
|
||||||
]
|
|
||||||
|
|
@ -1,84 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret, dirFd, len;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME01 };
|
|
||||||
CHAR pathname2[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME01 };
|
|
||||||
DIR *dir = NULL;
|
|
||||||
struct dirent *ptr = NULL;
|
|
||||||
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
dir = opendir(pathname1);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dir, NULL, dir, EXIT1);
|
|
||||||
|
|
||||||
dirFd = dirfd(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dirFd, JFFS_IS_ERROR, dirFd, EXIT1);
|
|
||||||
|
|
||||||
fd = openat(dirFd, "test.txt", O_CREAT | O_RDWR | O_TRUNC);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, JFFS_IS_ERROR, fd, EXIT1);
|
|
||||||
|
|
||||||
len = write(fd, "01234567890123456789012345", 16); // 16 means length which will be writed
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = unlinkat(dirFd, "test.txt", 0);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = closedir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
ret = rmdir(JFFS_PATH_NAME01);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
|
|
||||||
EXIT1:
|
|
||||||
close(fd);
|
|
||||||
unlink(pathname1);
|
|
||||||
closedir(dir);
|
|
||||||
EXIT:
|
|
||||||
rmdir(JFFS_PATH_NAME01);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs001(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,54 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = "/test1/test2/test3";
|
|
||||||
CHAR pathname2[JFFS_STANDARD_NAME_LENGTH] = "/test1/test2";
|
|
||||||
CHAR *dname = NULL;
|
|
||||||
INT32 ret;
|
|
||||||
|
|
||||||
dname = dirname(pathname1);
|
|
||||||
ret = strcmp(pathname2, dname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT:
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs002(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,78 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = { JFFS_MAIN_DIR0 };
|
|
||||||
CHAR pathname2[JFFS_STANDARD_NAME_LENGTH] = { JFFS_MAIN_DIR0 };
|
|
||||||
CHAR *dname = NULL;
|
|
||||||
INT32 ret;
|
|
||||||
INT32 fd = -1;
|
|
||||||
DIR *dir1 = NULL;
|
|
||||||
DIR *dir2 = NULL;
|
|
||||||
|
|
||||||
dir1 = opendir(pathname1);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dir1, NULL, dir1, EXIT);
|
|
||||||
|
|
||||||
ret = closedir(dir1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname2, JFFS_STANDARD_NAME_LENGTH, "/test123");
|
|
||||||
fd = open(pathname2, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, JFFS_IS_ERROR, fd, EXIT1);
|
|
||||||
|
|
||||||
dir2 = fdopendir(fd);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dir2, NULL, dir2, EXIT2);
|
|
||||||
|
|
||||||
ret = unlink(pathname2);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = closedir(dir2);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT2);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT2:
|
|
||||||
closedir(dir2);
|
|
||||||
EXIT1:
|
|
||||||
unlink(pathname2);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT:
|
|
||||||
closedir(dir1);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs003(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,60 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
CHAR dname1[JFFS_STANDARD_NAME_LENGTH] = "";
|
|
||||||
CHAR *dname2 = NULL;
|
|
||||||
CHAR *pret = NULL;
|
|
||||||
INT32 ret;
|
|
||||||
|
|
||||||
pret = getcwd(dname1, JFFS_STANDARD_NAME_LENGTH);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(pret, NULL, pret, EXIT);
|
|
||||||
|
|
||||||
dname2 = get_current_dir_name();
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dname2, NULL, dname2, EXIT);
|
|
||||||
|
|
||||||
ret = strcmp(dname1, dname2);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
|
|
||||||
EXIT:
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs004(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,66 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret1, ret2;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME01 };
|
|
||||||
|
|
||||||
ret1 = getdtablesize();
|
|
||||||
|
|
||||||
fd = open(pathname1, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, JFFS_IS_ERROR, fd, EXIT2);
|
|
||||||
|
|
||||||
ret2 = getdtablesize();
|
|
||||||
ICUNIT_GOTO_EQUAL(ret2, (ret1 + 1), ret2, EXIT2);
|
|
||||||
|
|
||||||
ret1 = close(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret1, JFFS_NO_ERROR, ret1, EXIT2);
|
|
||||||
|
|
||||||
ret1 = unlink(pathname1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret1, JFFS_NO_ERROR, ret1, EXIT1);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT2:
|
|
||||||
close(fd);
|
|
||||||
EXIT1:
|
|
||||||
unlink(pathname1);
|
|
||||||
EXIT:
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs005(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,71 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret1, ret2;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME01 };
|
|
||||||
struct mntent *mnt = NULL;
|
|
||||||
FILE *fp = NULL;
|
|
||||||
|
|
||||||
ret1 = strcat_s(pathname1, JFFS_STANDARD_NAME_LENGTH, "test12");
|
|
||||||
ICUNIT_ASSERT_EQUAL(ret1, EOK, ret1);
|
|
||||||
|
|
||||||
fp = setmntent(pathname1, "w+b");
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fp, NULL, fp, EXIT);
|
|
||||||
|
|
||||||
mnt = getmntent(fp);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(mnt, NULL, mnt, EXIT);
|
|
||||||
|
|
||||||
printf("[%s:%d] mnt->mnt_fsname=%s\n", __FUNCTION__, __LINE__, mnt->mnt_fsname);
|
|
||||||
printf("[%s:%d] mnt->mnt_dir=%s\n", __FUNCTION__, __LINE__, mnt->mnt_dir);
|
|
||||||
printf("[%s:%d] mnt->mnt_type=%s\n", __FUNCTION__, __LINE__, mnt->mnt_type);
|
|
||||||
printf("[%s:%d] mnt->mnt_opts=%s\n", __FUNCTION__, __LINE__, mnt->mnt_opts);
|
|
||||||
printf("[%s:%d] mnt->mnt_freq=%d\n", __FUNCTION__, __LINE__, mnt->mnt_freq);
|
|
||||||
printf("[%s:%d] mnt->mnt_passno=%d\n", __FUNCTION__, __LINE__, mnt->mnt_passno);
|
|
||||||
|
|
||||||
endmntent(fp);
|
|
||||||
unlink(pathname1);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT:
|
|
||||||
endmntent(fp);
|
|
||||||
unlink(pathname1);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs006(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,91 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = { JFFS_MOUNT_DIR0 };
|
|
||||||
CHAR pathname2[JFFS_STANDARD_NAME_LENGTH] = { JFFS_MOUNT_DIR0 };
|
|
||||||
CHAR pathname3[JFFS_STANDARD_NAME_LENGTH] = { JFFS_MOUNT_DIR0 };
|
|
||||||
glob_t buf;
|
|
||||||
int i, ret;
|
|
||||||
int fd1 = -1;
|
|
||||||
int fd2 = -2;
|
|
||||||
|
|
||||||
(void)strcat_s(pathname1, JFFS_STANDARD_NAME_LENGTH, "/test1");
|
|
||||||
fd1 = open(pathname1, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd1, JFFS_IS_ERROR, fd1, EXIT1);
|
|
||||||
|
|
||||||
ret = close(fd1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname2, JFFS_STANDARD_NAME_LENGTH, "/test2");
|
|
||||||
fd2 = open(pathname2, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd2, JFFS_IS_ERROR, fd2, EXIT2);
|
|
||||||
|
|
||||||
ret = close(fd2);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT2);
|
|
||||||
|
|
||||||
glob("/storage/*", GLOB_NOSORT, NULL, &buf);
|
|
||||||
ICUNIT_GOTO_EQUAL(buf.gl_pathc, 2, buf.gl_pathc, EXIT1); // 2 means size of path
|
|
||||||
|
|
||||||
ret = strcmp(pathname1, buf.gl_pathv[0]);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
ret = strcmp(pathname2, buf.gl_pathv[1]);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
globfree(&buf);
|
|
||||||
|
|
||||||
ret = unlink(pathname2);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = unlink(pathname1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT2:
|
|
||||||
close(fd2);
|
|
||||||
unlink(pathname2);
|
|
||||||
EXIT1:
|
|
||||||
close(fd1);
|
|
||||||
unlink(pathname1);
|
|
||||||
EXIT:
|
|
||||||
globfree(&buf);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs007(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,68 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = { JFFS_MAIN_DIR0 };
|
|
||||||
DIR *dir = NULL;
|
|
||||||
|
|
||||||
dir = opendir(pathname1);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dir, NULL, dir, EXIT1);
|
|
||||||
|
|
||||||
fd = dirfd(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, JFFS_IS_ERROR, fd, EXIT1);
|
|
||||||
|
|
||||||
ret = mkdirat(fd, "TEST", HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = rmdir("/storage/TEST");
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = closedir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT2:
|
|
||||||
rmdir("/storage/TEST");
|
|
||||||
EXIT1:
|
|
||||||
closedir(dir);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs008(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,65 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR tempFile[] = "tmp_XXXXXX";
|
|
||||||
CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = { JFFS_MAIN_DIR0 };
|
|
||||||
|
|
||||||
ret = chdir(pathname1);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
fd = mkstemp(tempFile);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, JFFS_IS_ERROR, fd, EXIT1);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = unlink(tempFile);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT1:
|
|
||||||
close(fd);
|
|
||||||
unlink(tempFile);
|
|
||||||
EXIT:
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs009(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,65 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR tempFile[] = "tmp_XXXXXX_hello";
|
|
||||||
CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = { JFFS_MAIN_DIR0 };
|
|
||||||
|
|
||||||
ret = chdir(pathname1);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
fd = mkstemps(tempFile, 6); // 6 means size of file
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, JFFS_IS_ERROR, fd, EXIT1);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = unlink(tempFile);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT1:
|
|
||||||
close(fd);
|
|
||||||
unlink(tempFile);
|
|
||||||
EXIT:
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs010(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,70 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR tempFile[] = "test.XXXXXX";
|
|
||||||
CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = { JFFS_MAIN_DIR0 };
|
|
||||||
CHAR *pfd = NULL;
|
|
||||||
|
|
||||||
ret = chdir(pathname1);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
pfd = mktemp(tempFile);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(pfd, NULL, pfd, EXIT1);
|
|
||||||
printf("temp_file = %s\n", tempFile);
|
|
||||||
|
|
||||||
fd = open(pfd, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, JFFS_IS_ERROR, fd, EXIT1);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = unlink(pfd);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT1:
|
|
||||||
close(fd);
|
|
||||||
unlink(pfd);
|
|
||||||
EXIT:
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs011(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,64 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR tempFile[] = "test_XXXXXX";
|
|
||||||
CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = { JFFS_MAIN_DIR0 };
|
|
||||||
CHAR *pfd = NULL;
|
|
||||||
|
|
||||||
ret = chdir(pathname1);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
pfd = mkdtemp(tempFile);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(pfd, NULL, pfd, EXIT1);
|
|
||||||
printf("temp_file = %s, pfd=%s\n", tempFile, pfd);
|
|
||||||
|
|
||||||
ret = rmdir(tempFile);
|
|
||||||
printf("%s-%d temp=%s ret=%d\n", __FUNCTION__, __LINE__, tempFile, ret);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT1:
|
|
||||||
rmdir(pfd);
|
|
||||||
EXIT:
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs012(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,65 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR tempFile[] = "test_XXXXXX";
|
|
||||||
CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = { JFFS_MAIN_DIR0 };
|
|
||||||
|
|
||||||
ret = chdir(pathname1);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
fd = mkostemp(tempFile, O_APPEND);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, JFFS_IS_ERROR, fd, EXIT1);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = unlink(tempFile);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT1:
|
|
||||||
close(fd);
|
|
||||||
unlink(tempFile);
|
|
||||||
EXIT:
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs013(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,54 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret;
|
|
||||||
INT32 fd = -1;
|
|
||||||
|
|
||||||
openlog("Test", LOG_CONS | LOG_PID, LOG_USER);
|
|
||||||
syslog(LOG_INFO, "This is a massage just for test");
|
|
||||||
closelog();
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT:
|
|
||||||
close(fd);
|
|
||||||
unlink("Test");
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs014(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,54 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = { JFFS_MAIN_DIR0 };
|
|
||||||
long ret;
|
|
||||||
|
|
||||||
ret = pathconf(pathname1, _PC_LINK_MAX);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, _POSIX_LINK_MAX, ret, EXIT);
|
|
||||||
|
|
||||||
ret = pathconf(pathname1, _PC_NAME_MAX);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, NAME_MAX, ret, EXIT);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT:
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs015(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,72 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret1, ret2;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME01 };
|
|
||||||
struct mntent *mnt = NULL;
|
|
||||||
char *buf = NULL;
|
|
||||||
static struct mntent mnt1;
|
|
||||||
FILE *fp = NULL;
|
|
||||||
|
|
||||||
(void)strcat_s(pathname1, JFFS_STANDARD_NAME_LENGTH, "test12");
|
|
||||||
fp = setmntent(pathname1, "w+b");
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fp, NULL, fp, EXIT);
|
|
||||||
|
|
||||||
mnt = getmntent_r(fp, &mnt1, buf, 1);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(mnt, NULL, mnt, EXIT);
|
|
||||||
|
|
||||||
printf("[%s:%d] mnt->mnt_fsname=%s\n", __FUNCTION__, __LINE__, mnt->mnt_fsname);
|
|
||||||
printf("[%s:%d] mnt->mnt_dir=%s\n", __FUNCTION__, __LINE__, mnt->mnt_dir);
|
|
||||||
printf("[%s:%d] mnt->mnt_type=%s\n", __FUNCTION__, __LINE__, mnt->mnt_type);
|
|
||||||
printf("[%s:%d] mnt->mnt_opts=%s\n", __FUNCTION__, __LINE__, mnt->mnt_opts);
|
|
||||||
printf("[%s:%d] mnt->mnt_freq=%d\n", __FUNCTION__, __LINE__, mnt->mnt_freq);
|
|
||||||
printf("[%s:%d] mnt->mnt_passno=%d\n", __FUNCTION__, __LINE__, mnt->mnt_passno);
|
|
||||||
|
|
||||||
endmntent(fp);
|
|
||||||
unlink(pathname1);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT:
|
|
||||||
endmntent(fp);
|
|
||||||
unlink(pathname1);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
VOID ItJffs016(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,99 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static INT32 DisplayInfo(const char *fpath, const struct stat *sb, int tflag, struct FTW *ftwbuf)
|
|
||||||
{
|
|
||||||
printf("%-3s %2d ",
|
|
||||||
(tflag == FTW_D) ? "d" : (tflag == FTW_DNR) ? "dnr" :
|
|
||||||
(tflag == FTW_DP) ? "dp" : (tflag == FTW_F) ? "f" :
|
|
||||||
(tflag == FTW_NS) ? "ns" : (tflag == FTW_SL) ? "sl" :
|
|
||||||
(tflag == FTW_SLN) ? "sln" : "???",
|
|
||||||
ftwbuf->level);
|
|
||||||
|
|
||||||
if (tflag == FTW_NS) {
|
|
||||||
printf("-------");
|
|
||||||
} else {
|
|
||||||
printf("%7d", (intmax_t)sb->st_size);
|
|
||||||
}
|
|
||||||
|
|
||||||
printf(" %-40s %d %s\n", fpath, ftwbuf->base, fpath + ftwbuf->base);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret;
|
|
||||||
INT32 flags = 0;
|
|
||||||
CHAR *pathnamedir = { JFFS_MAIN_DIR0 };
|
|
||||||
CHAR pathname01[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME01 };
|
|
||||||
CHAR pathname11[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME11 };
|
|
||||||
CHAR pathname02[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME02 };
|
|
||||||
|
|
||||||
ret = mkdir(pathname01, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = mkdir(pathname11, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = mkdir(pathname02, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT3);
|
|
||||||
|
|
||||||
ret = nftw(pathnamedir, DisplayInfo, 20, flags); // 20 means max fd
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT3);
|
|
||||||
|
|
||||||
ret = rmdir(pathname02);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT3);
|
|
||||||
|
|
||||||
ret = rmdir(pathname11);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = rmdir(pathname01);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
|
|
||||||
EXIT3:
|
|
||||||
rmdir(pathname02);
|
|
||||||
EXIT2:
|
|
||||||
rmdir(pathname11);
|
|
||||||
EXIT1:
|
|
||||||
rmdir(pathname01);
|
|
||||||
return JFFS_IS_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs017(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,70 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
#define TEST_STR "hello world"
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
FILE *fd = NULL;
|
|
||||||
INT32 ret;
|
|
||||||
size_t size;
|
|
||||||
char *ptr = NULL;
|
|
||||||
char *ptr1 = TEST_STR;
|
|
||||||
|
|
||||||
fd = open_memstream(&ptr, &size);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, NULL, fd, EXIT1);
|
|
||||||
|
|
||||||
fprintf(fd, TEST_STR);
|
|
||||||
|
|
||||||
ret = fclose(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = strcmp(ptr, ptr1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
ret = strlen(ptr);
|
|
||||||
ICUNIT_GOTO_EQUAL(size, ret, size, EXIT);
|
|
||||||
|
|
||||||
free(ptr);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT1:
|
|
||||||
fclose(fd);
|
|
||||||
EXIT:
|
|
||||||
free(ptr);
|
|
||||||
return JFFS_IS_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs018(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,70 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static constexpr wchar_t* TEST_STR = L"hello world";
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
FILE *fd = NULL;
|
|
||||||
INT32 ret;
|
|
||||||
size_t size;
|
|
||||||
wchar_t *ptr = NULL;
|
|
||||||
wchar_t *ptr1 = { TEST_STR };
|
|
||||||
|
|
||||||
fd = open_wmemstream(&ptr, &size);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, NULL, fd, EXIT1);
|
|
||||||
|
|
||||||
fwprintf(fd, ptr1);
|
|
||||||
|
|
||||||
ret = fclose(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = wcscmp(ptr, ptr1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
ret = wcslen(ptr);
|
|
||||||
ICUNIT_GOTO_EQUAL(size, ret, size, EXIT);
|
|
||||||
|
|
||||||
free(ptr);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT1:
|
|
||||||
fclose(fd);
|
|
||||||
EXIT:
|
|
||||||
free(ptr);
|
|
||||||
return JFFS_IS_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs019(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,70 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
static constexpr int LINE_LENGTH = 50;
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret;
|
|
||||||
CHAR pathnamedir[LINE_LENGTH] = { JFFS_MAIN_DIR0 };
|
|
||||||
FILE *file = nullptr;
|
|
||||||
CHAR line[LINE_LENGTH];
|
|
||||||
CHAR *ptr = NULL;
|
|
||||||
|
|
||||||
ret = chdir(pathnamedir);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
file = popen("pwd", "r");
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(file, NULL, file, EXIT);
|
|
||||||
|
|
||||||
ptr = fgets(line, LINE_LENGTH, file);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT1);
|
|
||||||
|
|
||||||
(void)strcat_s(pathnamedir, LINE_LENGTH, "\n");
|
|
||||||
ret = strcmp(line, pathnamedir);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = pclose(file);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
|
|
||||||
EXIT1:
|
|
||||||
pclose(file);
|
|
||||||
EXIT:
|
|
||||||
return JFFS_IS_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs020(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,84 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
DIR *dirp = NULL;
|
|
||||||
INT32 ret;
|
|
||||||
CHAR *pathnamedir = { JFFS_MAIN_DIR0 };
|
|
||||||
CHAR pathname01[JFFS_STANDARD_NAME_LENGTH] = { JFFS_MAIN_DIR0 };
|
|
||||||
struct dirent *dp1 = (struct dirent *)malloc(sizeof(struct dirent));
|
|
||||||
struct dirent *dp2 = (struct dirent *)malloc(sizeof(struct dirent));
|
|
||||||
struct dirent *dp2Bak = dp2;
|
|
||||||
|
|
||||||
(void)strcat_s(pathname01, JFFS_STANDARD_NAME_LENGTH, "/test1");
|
|
||||||
ret = mkdir(pathname01, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
dirp = opendir(pathnamedir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dirp, NULL, dirp, EXIT2);
|
|
||||||
|
|
||||||
while (1) {
|
|
||||||
readdir_r(dirp, dp1, &dp2);
|
|
||||||
|
|
||||||
if (dp2 == NULL) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = strcmp(dp2->d_name, "test1");
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT2);
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = rmdir(pathname01);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT2);
|
|
||||||
|
|
||||||
closedir(dirp);
|
|
||||||
free(dp1);
|
|
||||||
free(dp2Bak);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT2:
|
|
||||||
rmdir(pathname01);
|
|
||||||
closedir(dirp);
|
|
||||||
free(dp1);
|
|
||||||
free(dp2Bak);
|
|
||||||
return JFFS_IS_ERROR;
|
|
||||||
EXIT1:
|
|
||||||
rmdir(pathname01);
|
|
||||||
return JFFS_IS_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs021(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,71 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static constexpr int MB = 1024 * 1024;
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret;
|
|
||||||
CHAR *pathname = { JFFS_MAIN_DIR0 };
|
|
||||||
struct statvfs vfs;
|
|
||||||
fsblkcnt_t blockSize;
|
|
||||||
fsblkcnt_t blockCount;
|
|
||||||
fsblkcnt_t totalSize;
|
|
||||||
fsblkcnt_t freeSize;
|
|
||||||
fsblkcnt_t usedSize;
|
|
||||||
fsblkcnt_t availSize;
|
|
||||||
|
|
||||||
ret = statvfs(pathname, &vfs);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
blockSize = vfs.f_bsize;
|
|
||||||
totalSize = vfs.f_blocks * blockSize;
|
|
||||||
freeSize = vfs.f_bfree * blockSize;
|
|
||||||
usedSize = (vfs.f_blocks - vfs.f_bavail) * blockSize;
|
|
||||||
availSize = vfs.f_bavail * blockSize;
|
|
||||||
|
|
||||||
printf("total_size = %0.2lf MB\n", (double)totalSize / (MB));
|
|
||||||
printf("free_size = %0.2lf MB\n", (double)freeSize / (MB));
|
|
||||||
printf("used_size = %0.2lf MB\n", (double)usedSize / (MB));
|
|
||||||
printf("avail_size = %0.2lf MB\n", (double)availSize / (MB));
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT:
|
|
||||||
return JFFS_IS_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs022(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,86 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret, dirFd, len;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME01 };
|
|
||||||
CHAR pathname2[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME01 };
|
|
||||||
DIR *dir = NULL;
|
|
||||||
struct dirent *ptr = NULL;
|
|
||||||
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
dir = opendir(pathname1);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dir, NULL, dir, EXIT1);
|
|
||||||
|
|
||||||
dirFd = dirfd(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dirFd, JFFS_IS_ERROR, dirFd, EXIT1);
|
|
||||||
printf("dirFd = %d\n", dirFd);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname2, JFFS_STANDARD_NAME_LENGTH, "/test.txt");
|
|
||||||
fd = open(pathname2, O_CREAT | O_RDWR | O_TRUNC);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, JFFS_IS_ERROR, fd, EXIT1);
|
|
||||||
|
|
||||||
len = write(fd, "01234567890123456789012345", 16); // 16 means write len
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = unlinkat(dirFd, "test.txt", 0);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = closedir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
ret = rmdir(JFFS_PATH_NAME01);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
|
|
||||||
EXIT1:
|
|
||||||
close(fd);
|
|
||||||
unlink(pathname1);
|
|
||||||
closedir(dir);
|
|
||||||
EXIT:
|
|
||||||
rmdir(JFFS_PATH_NAME01);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs023(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,94 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret, dirFd, len;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME01 };
|
|
||||||
CHAR pathname2[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME01 };
|
|
||||||
DIR *dir = NULL;
|
|
||||||
struct dirent *ptr = NULL;
|
|
||||||
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
dir = opendir(pathname1);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dir, NULL, dir, EXIT1);
|
|
||||||
|
|
||||||
dirFd = dirfd(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dirFd, JFFS_IS_ERROR, dirFd, EXIT1);
|
|
||||||
printf("dirFd = %d\n", dirFd);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname2, JFFS_STANDARD_NAME_LENGTH, "/test.txt");
|
|
||||||
fd = open(pathname2, O_CREAT | O_RDWR | O_TRUNC);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, JFFS_IS_ERROR, fd, EXIT1);
|
|
||||||
|
|
||||||
len = write(fd, "01234567890123456789012345", 16); // 16 means write len
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = renameat(dirFd, "test.txt", dirFd, "TEST.txt");
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT2);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname1, JFFS_STANDARD_NAME_LENGTH, "/TEST.txt");
|
|
||||||
ret = unlink(pathname1);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = closedir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
ret = chdir(JFFS_MAIN_DIR0);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
ret = rmdir(JFFS_PATH_NAME01);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
|
|
||||||
EXIT1:
|
|
||||||
close(fd);
|
|
||||||
EXIT2:
|
|
||||||
unlink(pathname1);
|
|
||||||
closedir(dir);
|
|
||||||
EXIT:
|
|
||||||
rmdir(JFFS_PATH_NAME01);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs024(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,62 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
FILE *fp = NULL;
|
|
||||||
INT32 ret;
|
|
||||||
CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME01 };
|
|
||||||
CHAR pathname2[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME01 };
|
|
||||||
|
|
||||||
fp = fopen(pathname1, "w+");
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fp, NULL, fp, EXIT);
|
|
||||||
|
|
||||||
ret = fclose(fp);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = unlink(pathname1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT1:
|
|
||||||
fclose(fp);
|
|
||||||
EXIT:
|
|
||||||
unlink(pathname1);
|
|
||||||
return JFFS_IS_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs025(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,60 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret;
|
|
||||||
CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME0 };
|
|
||||||
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT);
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, EEXIST, errno, EXIT);
|
|
||||||
|
|
||||||
ret = rmdir(pathname1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
|
|
||||||
EXIT:
|
|
||||||
rmdir(pathname1);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs026(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,54 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret;
|
|
||||||
CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME00 };
|
|
||||||
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT);
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, ENOENT, errno, EXIT);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
|
|
||||||
EXIT:
|
|
||||||
rmdir(pathname1);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs027(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,92 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static constexpr int TEST_STRLEN = 30;
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR pathname[TEST_STRLEN] = { JFFS_BASE_DIR };
|
|
||||||
CHAR pathname1[TEST_STRLEN] = { JFFS_PATH_NAME0 };
|
|
||||||
CHAR pathname2[TEST_STRLEN] = { JFFS_PATH_NAME0 };
|
|
||||||
CHAR *pathname3 = NULL;
|
|
||||||
CHAR buf1[TEST_STRLEN] = "";
|
|
||||||
CHAR buf2[TEST_STRLEN] = "";
|
|
||||||
CHAR *pret = NULL;
|
|
||||||
DIR *dir = NULL;
|
|
||||||
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
pathname3 = pathname2;
|
|
||||||
(void)strcat_s(pathname2, TEST_STRLEN, "/test1");
|
|
||||||
fd = open(pathname2, O_NONBLOCK | O_CREAT | O_EXCL, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT1);
|
|
||||||
|
|
||||||
pret = getcwd(buf1, TEST_STRLEN);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(pret, NULL, pret, EXIT1);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(buf1, pathname, buf1, EXIT1);
|
|
||||||
|
|
||||||
ret = fchdir(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
pret = getcwd(buf2, TEST_STRLEN);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(pret, NULL, pret, EXIT1);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(buf2, pathname3, buf2, EXIT1);
|
|
||||||
|
|
||||||
ret = chdir(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = unlink(pathname2);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = rmdir(pathname1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT1:
|
|
||||||
close(fd);
|
|
||||||
unlink(pathname2);
|
|
||||||
EXIT:
|
|
||||||
rmdir(pathname1);
|
|
||||||
return JFFS_IS_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs028(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,66 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static constexpr int TEST_STRLEN = 30;
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR pathname1[TEST_STRLEN] = { JFFS_PATH_NAME0 };
|
|
||||||
|
|
||||||
fd = open(pathname1, O_NONBLOCK | O_CREAT | O_EXCL, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT1);
|
|
||||||
|
|
||||||
ret = fchmod(fd, S_IREAD);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = unlink(pathname1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT1:
|
|
||||||
close(fd);
|
|
||||||
unlink(pathname1);
|
|
||||||
EXIT:
|
|
||||||
rmdir(pathname1);
|
|
||||||
return JFFS_IS_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs029(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,72 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME0 };
|
|
||||||
CHAR pathname2[JFFS_STANDARD_NAME_LENGTH] = { JFFS_MAIN_DIR0 };
|
|
||||||
CHAR bufname[PATH_MAX] = "";
|
|
||||||
CHAR *realName = NULL;
|
|
||||||
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
realName = realpath(pathname1, bufname);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(realName, NULL, realName, EXIT);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(realName, pathname1, realName, EXIT);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname2, JFFS_STANDARD_NAME_LENGTH, "/////");
|
|
||||||
(void)strcat_s(pathname2, JFFS_STANDARD_NAME_LENGTH, "test");
|
|
||||||
|
|
||||||
realName = realpath(pathname2, bufname);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(realName, NULL, realName, EXIT);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(realName, pathname1, realName, EXIT);
|
|
||||||
|
|
||||||
ret = rmdir(pathname2);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
|
|
||||||
EXIT:
|
|
||||||
remove(pathname1);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
VOID ItJffs030(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,78 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
#define TEST_STR "abcdefghijk"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret, len;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME0 };
|
|
||||||
CHAR buf[JFFS_STANDARD_NAME_LENGTH] = { TEST_STR };
|
|
||||||
CHAR str[JFFS_STANDARD_NAME_LENGTH];
|
|
||||||
FILE *ptr = NULL;
|
|
||||||
|
|
||||||
fd = open(pathname1, O_CREAT | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT);
|
|
||||||
|
|
||||||
len = write(fd, buf, JFFS_STANDARD_NAME_LENGTH);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(len, -1, len, EXIT);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, -1, ret, EXIT1);
|
|
||||||
|
|
||||||
ptr = freopen(pathname1, "r", stdin);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT1);
|
|
||||||
|
|
||||||
scanf_s("%s", str, sizeof(str));
|
|
||||||
ret = strcmp(buf, str);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
fclose(ptr);
|
|
||||||
|
|
||||||
ret = unlink(pathname1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT1:
|
|
||||||
close(fd);
|
|
||||||
EXIT:
|
|
||||||
unlink(pathname1);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs031(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,70 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret;
|
|
||||||
CHAR pathname1[50] = { JFFS_PATH_NAME0 };
|
|
||||||
struct stat buf1 = { 0 };
|
|
||||||
|
|
||||||
ret = lstat64(pathname1, &buf1);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, ENOENT, errno, EXIT);
|
|
||||||
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
ret = lstat64(pathname1, &buf1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname1, sizeof(pathname1), "/dir");
|
|
||||||
ret = lstat64(pathname1, &buf1);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, ENOENT, errno, EXIT1);
|
|
||||||
|
|
||||||
ret = rmdir(JFFS_PATH_NAME0);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT1:
|
|
||||||
remove(pathname1);
|
|
||||||
EXIT:
|
|
||||||
remove(JFFS_PATH_NAME0);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs032(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,70 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret;
|
|
||||||
CHAR pathname1[50] = { JFFS_PATH_NAME0 };
|
|
||||||
struct stat buf1 = { 0 };
|
|
||||||
|
|
||||||
ret = lstat(pathname1, &buf1);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, ENOENT, errno, EXIT);
|
|
||||||
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
ret = lstat(pathname1, &buf1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname1, sizeof(pathname1), "/dir");
|
|
||||||
ret = lstat(pathname1, &buf1);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, ENOENT, errno, EXIT1);
|
|
||||||
|
|
||||||
ret = rmdir(JFFS_PATH_NAME0);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT1:
|
|
||||||
remove(pathname1);
|
|
||||||
EXIT:
|
|
||||||
remove(JFFS_PATH_NAME0);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs033(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,93 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
#define TEST_STR "abcdefghijk"
|
|
||||||
#define EXPECT_TEST_STR "ghijk"
|
|
||||||
static constexpr int OFFSET_NUM = 6;
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret, len;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME0 };
|
|
||||||
CHAR buf[JFFS_STANDARD_NAME_LENGTH] = { TEST_STR };
|
|
||||||
CHAR str[JFFS_STANDARD_NAME_LENGTH];
|
|
||||||
FILE *ptr = NULL;
|
|
||||||
off_t offset = OFFSET_NUM;
|
|
||||||
size_t fret;
|
|
||||||
|
|
||||||
fd = open(pathname1, O_CREAT | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT);
|
|
||||||
|
|
||||||
len = write(fd, buf, JFFS_STANDARD_NAME_LENGTH);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(len, -1, len, EXIT);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, -1, ret, EXIT1);
|
|
||||||
|
|
||||||
ptr = fopen(pathname1, "r+");
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT2);
|
|
||||||
|
|
||||||
ret = fseeko(ptr, offset, SEEK_SET);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT2);
|
|
||||||
|
|
||||||
fret = fread(str, 1, JFFS_STANDARD_NAME_LENGTH, ptr);
|
|
||||||
ICUNIT_GOTO_EQUAL(fret, (JFFS_STANDARD_NAME_LENGTH - OFFSET_NUM), fret, EXIT2);
|
|
||||||
|
|
||||||
ret = strcmp(EXPECT_TEST_STR, str);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = fclose(ptr);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = unlink(pathname1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
|
|
||||||
EXIT2:
|
|
||||||
fclose(ptr);
|
|
||||||
unlink(pathname1);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT1:
|
|
||||||
close(fd);
|
|
||||||
EXIT:
|
|
||||||
unlink(pathname1);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs034(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,91 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
#define TEST_STR "abcdefghijk"
|
|
||||||
#define EXPECT_TEST_STR "ghijk"
|
|
||||||
static constexpr int OFFSET_NUM = 6;
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret, len;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME0 };
|
|
||||||
CHAR buf[JFFS_STANDARD_NAME_LENGTH] = { TEST_STR };
|
|
||||||
CHAR str[JFFS_STANDARD_NAME_LENGTH];
|
|
||||||
FILE *ptr = NULL;
|
|
||||||
off_t offset1 = OFFSET_NUM;
|
|
||||||
off_t offset2;
|
|
||||||
size_t fret;
|
|
||||||
|
|
||||||
fd = open(pathname1, O_CREAT | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT);
|
|
||||||
|
|
||||||
len = write(fd, buf, JFFS_STANDARD_NAME_LENGTH);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(len, -1, len, EXIT);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, -1, ret, EXIT1);
|
|
||||||
|
|
||||||
ptr = fopen(pathname1, "r+");
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT2);
|
|
||||||
|
|
||||||
ret = fseeko(ptr, offset1, SEEK_SET);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT2);
|
|
||||||
|
|
||||||
offset2 = ftello(ptr);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset2, offset1, offset2, EXIT2);
|
|
||||||
|
|
||||||
ret = fclose(ptr);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = unlink(pathname1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
|
|
||||||
EXIT2:
|
|
||||||
fclose(ptr);
|
|
||||||
unlink(pathname1);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT1:
|
|
||||||
close(fd);
|
|
||||||
EXIT:
|
|
||||||
unlink(pathname1);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs035(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,67 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = { JFFS_MAIN_DIR0 };
|
|
||||||
CHAR pathname2[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME0 };
|
|
||||||
DIR *dir = NULL;
|
|
||||||
|
|
||||||
dir = opendir(pathname1);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dir, NULL, dir, EXIT1);
|
|
||||||
|
|
||||||
ret = closedir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
dir = opendir(pathname2);
|
|
||||||
ICUNIT_GOTO_EQUAL(dir, NULL, dir, EXIT2);
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, ENOENT, errno, EXIT);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT2:
|
|
||||||
closedir(dir);
|
|
||||||
rmdir(pathname2);
|
|
||||||
return JFFS_IS_ERROR;
|
|
||||||
EXIT1:
|
|
||||||
closedir(dir);
|
|
||||||
EXIT:
|
|
||||||
return JFFS_IS_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs036(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,76 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = { JFFS_MAIN_DIR0 };
|
|
||||||
CHAR pathname2[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME0 };
|
|
||||||
DIR *dir = NULL;
|
|
||||||
|
|
||||||
dir = opendir(pathname1);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dir, NULL, dir, EXIT1);
|
|
||||||
|
|
||||||
ret = closedir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
fd = open(pathname2, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, JFFS_IS_ERROR, fd, EXIT3);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT3);
|
|
||||||
|
|
||||||
dir = opendir(pathname2);
|
|
||||||
ICUNIT_GOTO_EQUAL(dir, NULL, dir, EXIT2);
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, ENOTDIR, errno, EXIT2);
|
|
||||||
|
|
||||||
ret = unlink(pathname2);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT2);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT3:
|
|
||||||
close(fd);
|
|
||||||
EXIT2:
|
|
||||||
unlink(pathname2);
|
|
||||||
return JFFS_IS_ERROR;
|
|
||||||
EXIT1:
|
|
||||||
closedir(dir);
|
|
||||||
return JFFS_IS_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs037(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,64 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret;
|
|
||||||
CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = { JFFS_MAIN_DIR0 };
|
|
||||||
CHAR pathname2[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME0 };
|
|
||||||
DIR *dir = NULL;
|
|
||||||
struct dirent *ptr = NULL;
|
|
||||||
long offset;
|
|
||||||
|
|
||||||
dir = opendir(pathname1);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dir, NULL, dir, EXIT1);
|
|
||||||
|
|
||||||
ret = closedir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT2:
|
|
||||||
closedir(dir);
|
|
||||||
rmdir(pathname2);
|
|
||||||
return JFFS_IS_ERROR;
|
|
||||||
EXIT1:
|
|
||||||
closedir(dir);
|
|
||||||
EXIT:
|
|
||||||
return JFFS_IS_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs038(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,63 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = { JFFS_MAIN_DIR0 };
|
|
||||||
CHAR pathname2[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME0 };
|
|
||||||
DIR *dir = NULL;
|
|
||||||
|
|
||||||
dir = opendir(pathname1);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dir, NULL, dir, EXIT1);
|
|
||||||
|
|
||||||
ret = closedir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT2:
|
|
||||||
closedir(dir);
|
|
||||||
rmdir(pathname2);
|
|
||||||
return JFFS_IS_ERROR;
|
|
||||||
EXIT1:
|
|
||||||
closedir(dir);
|
|
||||||
EXIT:
|
|
||||||
return JFFS_IS_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs039(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,218 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
typedef struct __dirstream {
|
|
||||||
off_t tell;
|
|
||||||
int fd;
|
|
||||||
int bufPos;
|
|
||||||
int bufEnd;
|
|
||||||
volatile int lock[1];
|
|
||||||
void *dirk;
|
|
||||||
void *resv;
|
|
||||||
/* Any changes to this struct must preserve the property:
|
|
||||||
* offsetof(struct __dirent, buf) % sizeof(off_t) == 0 */
|
|
||||||
char buf[2048];
|
|
||||||
} DIR;
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret, scandirCount;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR pathname[50] = { JFFS_PATH_NAME0 };
|
|
||||||
DIR *dir = NULL;
|
|
||||||
DIR adir = { 0 };
|
|
||||||
DIR *dir1 = &adir;
|
|
||||||
struct dirent *ptr = NULL;
|
|
||||||
off_t offset, offset1, offset2, offset3, offset4;
|
|
||||||
struct dirent **namelist = NULL;
|
|
||||||
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname, sizeof(pathname), "/0test");
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/0file", sizeof(pathname));
|
|
||||||
fd = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT2);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/2test", sizeof(pathname));
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/1test", sizeof(pathname));
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT4);
|
|
||||||
|
|
||||||
dir = opendir(JFFS_PATH_NAME0);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dir, NULL, dir, EXIT5);
|
|
||||||
|
|
||||||
ret = closedir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT5);
|
|
||||||
|
|
||||||
offset1 = telldir(dir1);
|
|
||||||
ptr = readdir(dir1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ptr, NULL, ptr, EXIT4);
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, EBADF, errno, EXIT4);
|
|
||||||
|
|
||||||
offset2 = telldir(dir1);
|
|
||||||
ptr = readdir(dir1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ptr, NULL, ptr, EXIT4);
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, EBADF, errno, EXIT4);
|
|
||||||
|
|
||||||
offset3 = telldir(dir1);
|
|
||||||
ptr = readdir(dir1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ptr, NULL, ptr, EXIT4);
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, EBADF, errno, EXIT4);
|
|
||||||
|
|
||||||
offset4 = telldir(dir1);
|
|
||||||
ptr = readdir(dir1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ptr, NULL, ptr, EXIT4);
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, EBADF, errno, EXIT4);
|
|
||||||
|
|
||||||
dir = opendir(JFFS_PATH_NAME0);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dir, NULL, dir, EXIT5);
|
|
||||||
|
|
||||||
ptr = readdir(dir);
|
|
||||||
offset1 = ptr->d_off;
|
|
||||||
|
|
||||||
ptr = readdir(dir);
|
|
||||||
offset2 = ptr->d_off;
|
|
||||||
|
|
||||||
ptr = readdir(dir);
|
|
||||||
offset3 = ptr->d_off;
|
|
||||||
|
|
||||||
ptr = readdir(dir);
|
|
||||||
offset4 = ptr->d_off;
|
|
||||||
|
|
||||||
seekdir(dir, offset2);
|
|
||||||
offset = telldir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, offset2, offset, EXIT5);
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT5);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(ptr->d_name, "1test", ptr->d_name, EXIT5);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, ptr->d_off - 1, offset, EXIT5);
|
|
||||||
|
|
||||||
seekdir(dir, offset1);
|
|
||||||
offset = telldir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, offset1, offset, EXIT5);
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT5);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(ptr->d_name, "0file", ptr->d_name, EXIT5);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, ptr->d_off - 1, offset, EXIT5);
|
|
||||||
|
|
||||||
seekdir(dir, offset4);
|
|
||||||
offset = telldir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, offset4, offset, EXIT5);
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(ptr, NULL, ptr, EXIT5);
|
|
||||||
|
|
||||||
seekdir(dir, offset3);
|
|
||||||
offset = telldir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, offset3, offset, EXIT5);
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT5);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(ptr->d_name, "0test", ptr->d_name, EXIT5);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, ptr->d_off - 1, offset, EXIT5);
|
|
||||||
|
|
||||||
scandirCount = scandir(JFFS_PATH_NAME0, &namelist, 0, alphasort);
|
|
||||||
ICUNIT_GOTO_EQUAL(scandirCount, 4, scandirCount, EXIT5); // 4 means total scaned file
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(namelist[0]->d_name, "0file", namelist[0]->d_name, EXIT); // 0 means first file
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(namelist[1]->d_name, "0test", namelist[1]->d_name, EXIT); // 1 means second file
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(namelist[2]->d_name, "1test", namelist[2]->d_name, EXIT); // 2 means third file
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(namelist[3]->d_name, "2test", namelist[3]->d_name, EXIT); // 3 means four file
|
|
||||||
|
|
||||||
seekdir(dir, namelist[3]->d_off); // 3 means four file
|
|
||||||
offset = telldir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(offset, -1, offset, EXIT5);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset1, namelist[3]->d_off, offset1, EXIT5); // 3 means four file
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, namelist[3]->d_off, offset, EXIT5); // 3 means four file
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT5);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(ptr->d_name, "0file", ptr->d_name, EXIT5);
|
|
||||||
|
|
||||||
seekdir(dir, namelist[2]->d_off); // 2 means third file
|
|
||||||
offset = telldir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(offset, -1, offset, EXIT5);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset3, namelist[2]->d_off, offset3, EXIT5); // 2 means third file
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, namelist[2]->d_off, offset, EXIT5); // 2 means third file
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT5);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(ptr->d_name, "0test", ptr->d_name, EXIT5);
|
|
||||||
|
|
||||||
JffsScandirFree(namelist, scandirCount);
|
|
||||||
|
|
||||||
scandirCount = 0;
|
|
||||||
|
|
||||||
scandirCount = scandir(JFFS_PATH_NAME0, &namelist, 0, NULL);
|
|
||||||
ICUNIT_GOTO_EQUAL(scandirCount, 4, scandirCount, EXIT5); // 4 means total scaned file
|
|
||||||
|
|
||||||
seekdir(dir, namelist[3]->d_off); // 3 means four file
|
|
||||||
ICUNIT_GOTO_EQUAL(offset4, namelist[3]->d_off, offset4, EXIT5); // 3 means four file
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(ptr, NULL, ptr, EXIT5);
|
|
||||||
|
|
||||||
seekdir(dir, namelist[0]->d_off); // 0 means first file
|
|
||||||
ICUNIT_GOTO_EQUAL(offset1, namelist[0]->d_off, offset1, EXIT5); // 0 means first file
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(ptr->d_name, "0file", ptr->d_name, EXIT5);
|
|
||||||
|
|
||||||
EXIT6:
|
|
||||||
JffsScandirFree(namelist, scandirCount);
|
|
||||||
EXIT5:
|
|
||||||
ret = closedir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT5);
|
|
||||||
EXIT4:
|
|
||||||
JffsStrcat2(pathname, "/1test", sizeof(pathname));
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT3:
|
|
||||||
JffsStrcat2(pathname, "/2test", sizeof(pathname));
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT2:
|
|
||||||
JffsStrcat2(pathname, "/0file", sizeof(pathname));
|
|
||||||
close(fd);
|
|
||||||
remove(pathname);
|
|
||||||
EXIT1:
|
|
||||||
JffsStrcat2(pathname, "/0test", sizeof(pathname));
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT:
|
|
||||||
rmdir(JFFS_PATH_NAME0);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs040(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,223 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
typedef struct __dirstream {
|
|
||||||
off_t tell;
|
|
||||||
int fd;
|
|
||||||
int bufPos;
|
|
||||||
int bufEnd;
|
|
||||||
volatile int lock[1];
|
|
||||||
void *dirk;
|
|
||||||
void *resv;
|
|
||||||
/* Any changes to this struct must preserve the property:
|
|
||||||
* offsetof(struct __dirent, buf) % sizeof(off_t) == 0 */
|
|
||||||
char buf[2048];
|
|
||||||
} DIR;
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret, scandirCount;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR pathname[50] = { JFFS_PATH_NAME0 };
|
|
||||||
DIR *dir = NULL;
|
|
||||||
DIR adir = { 0 };
|
|
||||||
DIR *dir1 = &adir;
|
|
||||||
struct dirent *ptr = NULL;
|
|
||||||
off_t offset, offset1, offset2, offset3, offset4;
|
|
||||||
struct dirent **namelist = NULL;
|
|
||||||
|
|
||||||
errno = 0;
|
|
||||||
scandirCount = scandir(JFFS_PATH_NAME0, &namelist, 0, NULL);
|
|
||||||
ICUNIT_GOTO_EQUAL(scandirCount, -1, scandirCount, EXIT);
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, ENOENT, errno, EXIT);
|
|
||||||
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname, sizeof(pathname), "/0test");
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/0file", sizeof(pathname));
|
|
||||||
fd = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT2);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/2test", sizeof(pathname));
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/1test", sizeof(pathname));
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT4);
|
|
||||||
|
|
||||||
dir = opendir(JFFS_PATH_NAME0);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dir, NULL, dir, EXIT5);
|
|
||||||
|
|
||||||
ret = closedir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT5);
|
|
||||||
|
|
||||||
offset1 = telldir(dir1);
|
|
||||||
ptr = readdir(dir1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ptr, NULL, ptr, EXIT4);
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, EBADF, errno, EXIT4);
|
|
||||||
|
|
||||||
offset2 = telldir(dir1);
|
|
||||||
ptr = readdir(dir1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ptr, NULL, ptr, EXIT4);
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, EBADF, errno, EXIT4);
|
|
||||||
|
|
||||||
offset3 = telldir(dir1);
|
|
||||||
ptr = readdir(dir1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ptr, NULL, ptr, EXIT4);
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, EBADF, errno, EXIT4);
|
|
||||||
|
|
||||||
offset4 = telldir(dir1);
|
|
||||||
ptr = readdir(dir1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ptr, NULL, ptr, EXIT4);
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, EBADF, errno, EXIT4);
|
|
||||||
|
|
||||||
dir = opendir(JFFS_PATH_NAME0);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dir, NULL, dir, EXIT5);
|
|
||||||
|
|
||||||
ptr = readdir(dir);
|
|
||||||
offset1 = ptr->d_off;
|
|
||||||
|
|
||||||
ptr = readdir(dir);
|
|
||||||
offset2 = ptr->d_off;
|
|
||||||
|
|
||||||
ptr = readdir(dir);
|
|
||||||
offset3 = ptr->d_off;
|
|
||||||
|
|
||||||
ptr = readdir(dir);
|
|
||||||
offset4 = ptr->d_off;
|
|
||||||
|
|
||||||
seekdir(dir, offset2);
|
|
||||||
offset = telldir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, offset2, offset, EXIT5);
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT5);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(ptr->d_name, "1test", ptr->d_name, EXIT5);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, ptr->d_off - 1, offset, EXIT5);
|
|
||||||
|
|
||||||
seekdir(dir, offset1);
|
|
||||||
offset = telldir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, offset1, offset, EXIT5);
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT5);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(ptr->d_name, "0file", ptr->d_name, EXIT5);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, ptr->d_off - 1, offset, EXIT5);
|
|
||||||
|
|
||||||
seekdir(dir, offset4);
|
|
||||||
offset = telldir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, offset4, offset, EXIT5);
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(ptr, NULL, ptr, EXIT5);
|
|
||||||
|
|
||||||
seekdir(dir, offset3);
|
|
||||||
offset = telldir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, offset3, offset, EXIT5);
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT5);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(ptr->d_name, "0test", ptr->d_name, EXIT5);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, ptr->d_off - 1, offset, EXIT5);
|
|
||||||
|
|
||||||
scandirCount = scandir(JFFS_PATH_NAME0, &namelist, 0, alphasort);
|
|
||||||
ICUNIT_GOTO_EQUAL(scandirCount, 4, scandirCount, EXIT5); // 4 means total scaned file
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(namelist[0]->d_name, "0file", namelist[0]->d_name, EXIT); // 0 means first file
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(namelist[1]->d_name, "0test", namelist[1]->d_name, EXIT); // 1 means second file
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(namelist[2]->d_name, "1test", namelist[2]->d_name, EXIT); // 2 means third file
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(namelist[3]->d_name, "2test", namelist[3]->d_name, EXIT); // 3 means four file
|
|
||||||
|
|
||||||
seekdir(dir, namelist[3]->d_off); // 3 means four file
|
|
||||||
offset = telldir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(offset, -1, offset, EXIT5);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset1, namelist[3]->d_off, offset1, EXIT5); // 3 means four file
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, namelist[3]->d_off, offset, EXIT5); // 3 means four file
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT5);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(ptr->d_name, "0file", ptr->d_name, EXIT5);
|
|
||||||
|
|
||||||
seekdir(dir, namelist[2]->d_off); // 2 means third file
|
|
||||||
offset = telldir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(offset, -1, offset, EXIT5);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset3, namelist[2]->d_off, offset3, EXIT5); // 2 means third file
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, namelist[2]->d_off, offset, EXIT5); // 2 means third file
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT5);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(ptr->d_name, "0test", ptr->d_name, EXIT5);
|
|
||||||
|
|
||||||
JffsScandirFree(namelist, scandirCount);
|
|
||||||
|
|
||||||
scandirCount = 0;
|
|
||||||
|
|
||||||
scandirCount = scandir(JFFS_PATH_NAME0, &namelist, 0, NULL);
|
|
||||||
ICUNIT_GOTO_EQUAL(scandirCount, 4, scandirCount, EXIT5); // 4 means total scaned file
|
|
||||||
|
|
||||||
seekdir(dir, namelist[3]->d_off); // 3 means four file
|
|
||||||
ICUNIT_GOTO_EQUAL(offset4, namelist[3]->d_off, offset4, EXIT5); // 3 means four file
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(ptr, NULL, ptr, EXIT5);
|
|
||||||
|
|
||||||
seekdir(dir, namelist[0]->d_off); // 0 means first file
|
|
||||||
ICUNIT_GOTO_EQUAL(offset1, namelist[0]->d_off, offset1, EXIT5); // 0 means first file
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(ptr->d_name, "0file", ptr->d_name, EXIT5);
|
|
||||||
|
|
||||||
EXIT6:
|
|
||||||
JffsScandirFree(namelist, scandirCount);
|
|
||||||
EXIT5:
|
|
||||||
ret = closedir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT5);
|
|
||||||
EXIT4:
|
|
||||||
JffsStrcat2(pathname, "/1test", sizeof(pathname));
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT3:
|
|
||||||
JffsStrcat2(pathname, "/2test", sizeof(pathname));
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT2:
|
|
||||||
JffsStrcat2(pathname, "/0file", sizeof(pathname));
|
|
||||||
close(fd);
|
|
||||||
remove(pathname);
|
|
||||||
EXIT1:
|
|
||||||
JffsStrcat2(pathname, "/0test", sizeof(pathname));
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT:
|
|
||||||
rmdir(JFFS_PATH_NAME0);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs041(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,77 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret, scandirCount;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = { JFFS_MAIN_DIR0 };
|
|
||||||
CHAR pathname2[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME0 };
|
|
||||||
DIR *dir = NULL;
|
|
||||||
struct dirent **namelist = NULL;
|
|
||||||
|
|
||||||
dir = opendir(pathname1);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dir, NULL, dir, EXIT1);
|
|
||||||
|
|
||||||
ret = closedir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
fd = open(pathname2, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, JFFS_IS_ERROR, fd, EXIT3);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT3);
|
|
||||||
|
|
||||||
scandirCount = scandir(pathname2, &namelist, 0, NULL);
|
|
||||||
ICUNIT_GOTO_EQUAL(scandirCount, -1, scandirCount, EXIT2);
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, ENOTDIR, errno, EXIT2);
|
|
||||||
|
|
||||||
ret = unlink(pathname2);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT2);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT3:
|
|
||||||
close(fd);
|
|
||||||
EXIT2:
|
|
||||||
unlink(pathname2);
|
|
||||||
return JFFS_IS_ERROR;
|
|
||||||
EXIT1:
|
|
||||||
closedir(dir);
|
|
||||||
return JFFS_IS_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs042(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,98 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
typedef struct __dirstream {
|
|
||||||
off_t tell;
|
|
||||||
int fd;
|
|
||||||
int bufPos;
|
|
||||||
int bufEnd;
|
|
||||||
volatile int lock[1];
|
|
||||||
void *dirk;
|
|
||||||
void *resv;
|
|
||||||
/* Any changes to this struct must preserve the property:
|
|
||||||
* offsetof(struct __dirent, buf) % sizeof(off_t) == 0 */
|
|
||||||
char buf[2048];
|
|
||||||
} DIR;
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
DIR *dirp = NULL;
|
|
||||||
INT32 ret;
|
|
||||||
CHAR *pathnamedir = (CHAR *)JFFS_MAIN_DIR0;
|
|
||||||
CHAR pathname01[JFFS_STANDARD_NAME_LENGTH] = { JFFS_MAIN_DIR0 };
|
|
||||||
struct dirent *dp1 = (struct dirent *)malloc(sizeof(struct dirent));
|
|
||||||
struct dirent *dp2 = (struct dirent *)malloc(sizeof(struct dirent));
|
|
||||||
struct dirent *dp2Bak = dp2;
|
|
||||||
DIR adir = { 0 };
|
|
||||||
DIR *dir1 = &adir;
|
|
||||||
|
|
||||||
(void)strcat_s(pathname01, JFFS_STANDARD_NAME_LENGTH, "/test1");
|
|
||||||
ret = mkdir(pathname01, HIGHEST_AUTHORITY);
|
|
||||||
if (ret != 0) {
|
|
||||||
if (errno != EEXIST) {
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dirp = opendir(pathnamedir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dirp, NULL, dirp, EXIT2);
|
|
||||||
|
|
||||||
while (1) {
|
|
||||||
ret = readdir_r(dir1, dp1, &dp2);
|
|
||||||
printf("ret=%d\n", ret);
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, EBADF, errno, EXIT2);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = rmdir(pathname01);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT2);
|
|
||||||
|
|
||||||
closedir(dirp);
|
|
||||||
free(dp1);
|
|
||||||
free(dp2Bak);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT2:
|
|
||||||
rmdir(pathname01);
|
|
||||||
if (dirp) closedir(dirp);
|
|
||||||
free(dp1);
|
|
||||||
free(dp2Bak);
|
|
||||||
return JFFS_IS_ERROR;
|
|
||||||
EXIT1:
|
|
||||||
rmdir(pathname01);
|
|
||||||
return JFFS_IS_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs043(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,195 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
typedef struct __dirstream {
|
|
||||||
off_t tell;
|
|
||||||
int fd;
|
|
||||||
int bufPos;
|
|
||||||
int bufEnd;
|
|
||||||
volatile int lock[1];
|
|
||||||
void *dirk;
|
|
||||||
void *resv;
|
|
||||||
/* Any changes to this struct must preserve the property:
|
|
||||||
* offsetof(struct __dirent, buf) % sizeof(off_t) == 0 */
|
|
||||||
char buf[2048];
|
|
||||||
} DIR;
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret, scandirCount;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR pathname[50] = { JFFS_PATH_NAME0 };
|
|
||||||
DIR *dir = NULL;
|
|
||||||
DIR adir = { 0 };
|
|
||||||
DIR *dir1 = &adir;
|
|
||||||
struct dirent *ptr = NULL;
|
|
||||||
off_t offset, offset1, offset2, offset3, offset4;
|
|
||||||
off_t offsetTest;
|
|
||||||
struct dirent **namelist = NULL;
|
|
||||||
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname, sizeof(pathname), "/0test");
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/0file", sizeof(pathname));
|
|
||||||
fd = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT2);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/2test", sizeof(pathname));
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/1test", sizeof(pathname));
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT4);
|
|
||||||
|
|
||||||
dir = opendir(JFFS_PATH_NAME0);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dir, NULL, dir, EXIT5);
|
|
||||||
|
|
||||||
ptr = readdir(dir);
|
|
||||||
offset1 = ptr->d_off;
|
|
||||||
|
|
||||||
ptr = readdir(dir);
|
|
||||||
offset2 = ptr->d_off;
|
|
||||||
|
|
||||||
ptr = readdir(dir);
|
|
||||||
offset3 = ptr->d_off;
|
|
||||||
|
|
||||||
ptr = readdir(dir);
|
|
||||||
offset4 = ptr->d_off;
|
|
||||||
|
|
||||||
errno = 0;
|
|
||||||
seekdir(dir, offset2);
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, 0, errno, EXIT5);
|
|
||||||
offset = telldir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, offset2, offset, EXIT5);
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT5);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(ptr->d_name, "1test", ptr->d_name, EXIT5);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, ptr->d_off - 1, offset, EXIT5);
|
|
||||||
|
|
||||||
seekdir(dir, offset1);
|
|
||||||
offset = telldir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, offset1, offset, EXIT5);
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT5);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(ptr->d_name, "0file", ptr->d_name, EXIT5);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, ptr->d_off - 1, offset, EXIT5);
|
|
||||||
|
|
||||||
seekdir(dir, offset4);
|
|
||||||
offset = telldir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, offset4, offset, EXIT5);
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(ptr, NULL, ptr, EXIT5);
|
|
||||||
|
|
||||||
seekdir(dir, offset3);
|
|
||||||
offset = telldir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, offset3, offset, EXIT5);
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT5);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(ptr->d_name, "0test", ptr->d_name, EXIT5);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, ptr->d_off - 1, offset, EXIT5);
|
|
||||||
|
|
||||||
scandirCount = scandir(JFFS_PATH_NAME0, &namelist, 0, alphasort);
|
|
||||||
ICUNIT_GOTO_EQUAL(scandirCount, 4, scandirCount, EXIT5); // 4 means total scaned file
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(namelist[0]->d_name, "0file", namelist[0]->d_name, EXIT); // 0 means first file
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(namelist[1]->d_name, "0test", namelist[1]->d_name, EXIT); // 1 means second file
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(namelist[2]->d_name, "1test", namelist[2]->d_name, EXIT); // 2 means third file
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(namelist[3]->d_name, "2test", namelist[3]->d_name, EXIT); // 3 means four file
|
|
||||||
|
|
||||||
seekdir(dir, namelist[3]->d_off); // 3 means four file
|
|
||||||
offset = telldir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(offset, -1, offset, EXIT5);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset1, namelist[3]->d_off, offset1, EXIT5); // 3 means four file
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, namelist[3]->d_off, offset, EXIT5); // 3 means four file
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT5);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(ptr->d_name, "0file", ptr->d_name, EXIT5);
|
|
||||||
|
|
||||||
seekdir(dir, namelist[2]->d_off); // 2 means third file
|
|
||||||
offset = telldir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(offset, -1, offset, EXIT5);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset3, namelist[2]->d_off, offset3, EXIT5); // 2 means third file
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, namelist[2]->d_off, offset, EXIT5); // 2 means third file
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT5);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(ptr->d_name, "0test", ptr->d_name, EXIT5);
|
|
||||||
|
|
||||||
JffsScandirFree(namelist, scandirCount);
|
|
||||||
|
|
||||||
scandirCount = 0;
|
|
||||||
|
|
||||||
scandirCount = scandir(JFFS_PATH_NAME0, &namelist, 0, NULL);
|
|
||||||
ICUNIT_GOTO_EQUAL(scandirCount, 4, scandirCount, EXIT5); // 4 means total scaned file
|
|
||||||
|
|
||||||
seekdir(dir, namelist[3]->d_off); // 3 means four file
|
|
||||||
ICUNIT_GOTO_EQUAL(offset4, namelist[3]->d_off, offset4, EXIT5); // 3 means four file
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(ptr, NULL, ptr, EXIT5);
|
|
||||||
|
|
||||||
seekdir(dir, namelist[0]->d_off); // 0 means first file
|
|
||||||
ICUNIT_GOTO_EQUAL(offset1, namelist[0]->d_off, offset1, EXIT5); // 0 means first file
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(ptr->d_name, "0file", ptr->d_name, EXIT5);
|
|
||||||
|
|
||||||
EXIT6:
|
|
||||||
JffsScandirFree(namelist, scandirCount);
|
|
||||||
EXIT5:
|
|
||||||
ret = closedir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT5);
|
|
||||||
EXIT4:
|
|
||||||
JffsStrcat2(pathname, "/1test", sizeof(pathname));
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT3:
|
|
||||||
JffsStrcat2(pathname, "/2test", sizeof(pathname));
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT2:
|
|
||||||
JffsStrcat2(pathname, "/0file", sizeof(pathname));
|
|
||||||
close(fd);
|
|
||||||
remove(pathname);
|
|
||||||
EXIT1:
|
|
||||||
JffsStrcat2(pathname, "/0test", sizeof(pathname));
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT:
|
|
||||||
rmdir(JFFS_PATH_NAME0);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItJffs044(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,69 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
int ret = 0;
|
|
||||||
int argc = 2;
|
|
||||||
char *argv[2];
|
|
||||||
|
|
||||||
argv[1] = (char *)"/lib/libc.so";
|
|
||||||
|
|
||||||
if (argc != 2) {
|
|
||||||
printf("Usage: %s <pathname>\n", argv[0]);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = faccessat(AT_FDCWD, argv[1], R_OK, AT_EACCESS);
|
|
||||||
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
|
|
||||||
if (ret < 0) {
|
|
||||||
printf("faccessat error for %s\n", argv[1]);
|
|
||||||
} else {
|
|
||||||
printf("read access OK\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (open(argv[1], O_RDONLY) < 0) {
|
|
||||||
printf("open error for %s\n", argv[1]);
|
|
||||||
} else {
|
|
||||||
printf("open for reading OK\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
return LOS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID IO_TEST_FACCESSAT_001(void)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, Testcase, TEST_LIB, TEST_LIBC, TEST_LEVEL1, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
@ -1,64 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
|
|
||||||
static UINT32 testcase(VOID)
|
|
||||||
{
|
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
open(FILEPATH_000, O_RDWR | O_EXCL | O_CREAT, 0);
|
|
||||||
|
|
||||||
errno = 0;
|
|
||||||
ret = faccessat(AT_FDCWD, FILEPATH_000, R_OK, AT_EACCESS);
|
|
||||||
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
|
|
||||||
TEST_PRINT("[INFO]%s:%d,%s,ret=%d,errno=%d,errstr=%s\n", __FILE__, __LINE__, __func__, ret, errno, strerror(errno));
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, 0, errno, OUT);
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
errno = 0;
|
|
||||||
ret = open(FILEPATH_000, O_RDONLY);
|
|
||||||
ICUNIT_ASSERT_EQUAL(ret, -1, ret);
|
|
||||||
TEST_PRINT("[INFO]%s:%d,%s,ret=%d,errno=%d,errstr=%s\n", __FILE__, __LINE__, __func__, ret, errno, strerror(errno));
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, 0, errno, OUT);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return LOS_OK;
|
|
||||||
OUT:
|
|
||||||
return LOS_NOK;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID IO_TEST_FACCESSAT_002(void)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, testcase, TEST_LIB, TEST_LIBC, TEST_LEVEL1, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
@ -1,144 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
#include "sys/stat.h"
|
|
||||||
|
|
||||||
static UINT32 testcase1(VOID)
|
|
||||||
{
|
|
||||||
struct stat buf;
|
|
||||||
char *pathname = (char *)FILEPATH_775;
|
|
||||||
int ret = 0;
|
|
||||||
int fd = 0;
|
|
||||||
|
|
||||||
errno = 0;
|
|
||||||
fd = open(pathname, O_RDWR | O_CREAT);
|
|
||||||
TEST_PRINT("[INFO]%s:%d,%s,fd=%d,errno=%d,errstr=%s\n", __FILE__, __LINE__, __func__, fd, errno, strerror(errno));
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, OUT);
|
|
||||||
|
|
||||||
errno = 0;
|
|
||||||
ret = fstatat(fd, pathname, &buf, 0);
|
|
||||||
TEST_PRINT("[INFO]%s:%d,%s,ret=%d,errno=%d,errstr=%s\n", __FILE__, __LINE__, __func__, ret, errno, strerror(errno));
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, OUT);
|
|
||||||
ICUNIT_GOTO_EQUAL(buf.st_ino, 0, -1, OUT);
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, 0, errno, OUT);
|
|
||||||
|
|
||||||
return LOS_OK;
|
|
||||||
OUT:
|
|
||||||
return LOS_NOK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static UINT32 testcase2(VOID)
|
|
||||||
{
|
|
||||||
struct stat buf;
|
|
||||||
char *pathname = (char *)"./fstatat.tmp";
|
|
||||||
int ret = 0;
|
|
||||||
int fd = 0;
|
|
||||||
|
|
||||||
errno = 0;
|
|
||||||
fd = open(pathname, O_RDWR | O_CREAT);
|
|
||||||
TEST_PRINT("[INFO]%s:%d,%s,fd=%d,errno=%d,errstr=%s\n", __FILE__, __LINE__, __func__, fd, errno, strerror(errno));
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, OUT);
|
|
||||||
|
|
||||||
errno = 0;
|
|
||||||
ret = fstatat(AT_FDCWD, pathname, &buf, 0);
|
|
||||||
TEST_PRINT("[INFO]%s:%d,%s,ret=%d,errno=%d,errstr=%s\n", __FILE__, __LINE__, __func__, ret, errno, strerror(errno));
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, OUT);
|
|
||||||
ICUNIT_GOTO_EQUAL(buf.st_ino, 0, -1, OUT);
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, 0, errno, OUT);
|
|
||||||
|
|
||||||
return LOS_OK;
|
|
||||||
OUT:
|
|
||||||
return LOS_NOK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static UINT32 testcase3(VOID)
|
|
||||||
{
|
|
||||||
struct stat buf;
|
|
||||||
char *pathname = (char *)FILEPATH_775;
|
|
||||||
int ret = 0;
|
|
||||||
int fd = 0;
|
|
||||||
|
|
||||||
errno = 0;
|
|
||||||
fd = open(pathname, O_RDWR | O_CREAT);
|
|
||||||
TEST_PRINT("[INFO]%s:%d,%s,fd=%d,errno=%d,errstr=%s\n", __FILE__, __LINE__, __func__, fd, errno, strerror(errno));
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, OUT);
|
|
||||||
|
|
||||||
errno = 0;
|
|
||||||
ret = fstatat(fd, pathname, &buf, 0);
|
|
||||||
TEST_PRINT("[INFO]%s:%d,%s,ret=%d,errno=%d,errstr=%s\n", __FILE__, __LINE__, __func__, ret, errno, strerror(errno));
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, OUT);
|
|
||||||
ICUNIT_GOTO_EQUAL(buf.st_ino, 0, -1, OUT);
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, 0, errno, OUT);
|
|
||||||
|
|
||||||
return LOS_OK;
|
|
||||||
OUT:
|
|
||||||
return LOS_NOK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static UINT32 testcase4(VOID)
|
|
||||||
{
|
|
||||||
struct stat buf;
|
|
||||||
char *pathname = (char *)FILEPATH_775;
|
|
||||||
int ret = 0;
|
|
||||||
int fd = 0;
|
|
||||||
|
|
||||||
errno = 0;
|
|
||||||
fd = open(pathname, O_RDWR | O_CREAT);
|
|
||||||
TEST_PRINT("[INFO]%s:%d,%s,fd=%d,errno=%d,errstr=%s\n", __FILE__, __LINE__, __func__, fd, errno, strerror(errno));
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, OUT);
|
|
||||||
|
|
||||||
errno = 0;
|
|
||||||
ret = fstatat(fd, pathname, &buf, 0);
|
|
||||||
TEST_PRINT("[INFO]%s:%d,%s,ret=%d,errno=%d,errstr=%s\n", __FILE__, __LINE__, __func__, ret, errno, strerror(errno));
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, OUT);
|
|
||||||
ICUNIT_GOTO_EQUAL(buf.st_ino, 0, -1, OUT);
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, 0, errno, OUT);
|
|
||||||
|
|
||||||
return LOS_OK;
|
|
||||||
OUT:
|
|
||||||
return LOS_NOK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static UINT32 testcase(VOID)
|
|
||||||
{
|
|
||||||
testcase1();
|
|
||||||
testcase2();
|
|
||||||
testcase3();
|
|
||||||
testcase4();
|
|
||||||
|
|
||||||
return LOS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID IO_TEST_FSTATAT_001(void)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, testcase, TEST_LIB, TEST_LIBC, TEST_LEVEL1, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
@ -1,198 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include "sys/stat.h"
|
|
||||||
#include "string.h"
|
|
||||||
|
|
||||||
static UINT32 testcase8(VOID)
|
|
||||||
{
|
|
||||||
struct stat buf;
|
|
||||||
char pathname[200] = FILEPATH_775;
|
|
||||||
int ret = 0;
|
|
||||||
int fd = 0;
|
|
||||||
|
|
||||||
/* omit to create test file dynamicly,use prepared test files in /storage instand. */
|
|
||||||
errno = 0;
|
|
||||||
fd = open(pathname, O_CREAT, 0777);
|
|
||||||
TEST_PRINT("[INFO]%s:%d,%s,fd=%d,errno=%d,errstr=%s\n", __FILE__, __LINE__, __func__, fd, errno, strerror(errno));
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, OUT);
|
|
||||||
|
|
||||||
errno = 0;
|
|
||||||
ret = fstatat(fd, FILEPATH_RELATIVE, &buf, 0);
|
|
||||||
TEST_PRINT("[INFO]%s:%d,%s,ret=%d,errno=%d,errstr=%s\n", __FILE__, __LINE__, __func__, ret, errno, strerror(errno));
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, -1, ret, OUT);
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, ENOTDIR, errno, OUT);
|
|
||||||
|
|
||||||
return LOS_OK;
|
|
||||||
OUT:
|
|
||||||
return LOS_NOK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static UINT32 testcase7(VOID)
|
|
||||||
{
|
|
||||||
struct stat buf;
|
|
||||||
char pathname[] = FILEPATH_NOACCESS;
|
|
||||||
char dirname[] = DIRPATH_775;
|
|
||||||
DIR *dir = NULL;
|
|
||||||
int ret = 0;
|
|
||||||
int fd = 0;
|
|
||||||
|
|
||||||
errno = 0;
|
|
||||||
dir = opendir(dirname);
|
|
||||||
fd = dirfd(dir);
|
|
||||||
TEST_PRINT("[INFO]%s:%d,%s,fd=%d,errno=%d,errstr=%s\n", __FILE__, __LINE__, __func__, fd, errno, strerror(errno));
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, OUT);
|
|
||||||
|
|
||||||
errno = 0;
|
|
||||||
ret = fstatat(fd, pathname, &buf, 0);
|
|
||||||
TEST_PRINT("[INFO]%s:%d,%s,ret=%d,errno=%d,errstr=%s\n", __FILE__, __LINE__, __func__, ret, errno, strerror(errno));
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, -1, ret, OUT);
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, EACCES, errno, OUT);
|
|
||||||
|
|
||||||
return LOS_OK;
|
|
||||||
OUT:
|
|
||||||
return LOS_NOK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static UINT32 testcase6(VOID)
|
|
||||||
{
|
|
||||||
struct stat buf;
|
|
||||||
/* let the pathname more than 4096 characters,to generate the ENAMETOOLONG errno. */
|
|
||||||
char pathname[] = PATHNAME_ENAMETOOLONG;
|
|
||||||
int ret = 0;
|
|
||||||
char dirname[] = DIRPATH_775;
|
|
||||||
DIR *dir = NULL;
|
|
||||||
int fd = 0;
|
|
||||||
|
|
||||||
errno = 0;
|
|
||||||
dir = opendir(dirname);
|
|
||||||
fd = dirfd(dir);
|
|
||||||
TEST_PRINT("[INFO]%s:%d,%s,fd=%d,errno=%d,errstr=%s\n", __FILE__, __LINE__, __func__, fd, errno, strerror(errno));
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, OUT);
|
|
||||||
|
|
||||||
errno = 0;
|
|
||||||
ret = fstatat(fd, pathname, &buf, 0);
|
|
||||||
TEST_PRINT("[INFO]%s:%d,%s,ret=%d,errno=%d,errstr=%s\n", __FILE__, __LINE__, __func__, ret, errno, strerror(errno));
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, -1, ret, OUT);
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, ENAMETOOLONG, errno, OUT);
|
|
||||||
|
|
||||||
return LOS_OK;
|
|
||||||
OUT:
|
|
||||||
return LOS_NOK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static UINT32 testcase5(VOID)
|
|
||||||
{
|
|
||||||
struct stat buf;
|
|
||||||
char pathname[] = FILEPATH_ENOENT;
|
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
errno = 0;
|
|
||||||
ret = fstatat(FD_EBADF, pathname, &buf, 0);
|
|
||||||
TEST_PRINT("[INFO]%s:%d,%s,ret=%d,errno=%d,errstr=%s\n", __FILE__, __LINE__, __func__, ret, errno, strerror(errno));
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, -1, ret, OUT);
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, ENOENT, errno, OUT);
|
|
||||||
|
|
||||||
return LOS_OK;
|
|
||||||
OUT:
|
|
||||||
return LOS_NOK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static UINT32 testcase3(VOID)
|
|
||||||
{
|
|
||||||
struct stat buf;
|
|
||||||
char pathname[] = "";
|
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
errno = 0;
|
|
||||||
ret = fstatat(AT_FDCWD, pathname, &buf, 0);
|
|
||||||
TEST_PRINT("[INFO]%s:%d,%s,ret=%d,errno=%d,errstr=%s\n", __FILE__, __LINE__, __func__, ret, errno, strerror(errno));
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, -1, ret, OUT);
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, ENOENT, errno, OUT);
|
|
||||||
|
|
||||||
return LOS_OK;
|
|
||||||
OUT:
|
|
||||||
return LOS_NOK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static UINT32 testcase2(VOID)
|
|
||||||
{
|
|
||||||
struct stat buf;
|
|
||||||
char pathname[] = FILEPATH_ENOENT;
|
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
errno = 0;
|
|
||||||
ret = fstatat(AT_FDCWD, pathname, &buf, 0);
|
|
||||||
TEST_PRINT("[INFO]%s:%d,%s,ret=%d,errno=%d,errstr=%s\n", __FILE__, __LINE__, __func__, ret, errno, strerror(errno));
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, -1, ret, OUT);
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, ENOENT, errno, OUT);
|
|
||||||
|
|
||||||
return LOS_OK;
|
|
||||||
OUT:
|
|
||||||
return LOS_NOK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static UINT32 testcase1(VOID)
|
|
||||||
{
|
|
||||||
struct stat buf;
|
|
||||||
char pathname[] = FILEPATH_000;
|
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
errno = 0;
|
|
||||||
ret = fstatat(1, pathname, &buf, 0);
|
|
||||||
TEST_PRINT("[INFO]%s:%d,%s,ret=%d,errno=%d,errstr=%s\n", __FILE__, __LINE__, __func__, ret, errno, strerror(errno));
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, -1, ret, OUT);
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, EACCES, errno, OUT);
|
|
||||||
|
|
||||||
return LOS_OK;
|
|
||||||
OUT:
|
|
||||||
return LOS_NOK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static UINT32 testcase(VOID)
|
|
||||||
{
|
|
||||||
testcase8(); /* CASE:fd is no a dirfd */
|
|
||||||
/* testcase7(); omitted as program can not create file with no access privilege. */
|
|
||||||
testcase6();
|
|
||||||
testcase5();
|
|
||||||
testcase3();
|
|
||||||
testcase2();
|
|
||||||
/* testcase1(); CASE:no access */
|
|
||||||
|
|
||||||
return LOS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID IO_TEST_FSTATAT_002(void)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, testcase, TEST_LIB, TEST_LIBC, TEST_LEVEL1, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
@ -1,68 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include "fcntl.h"
|
|
||||||
#include "sys/vfs.h"
|
|
||||||
|
|
||||||
static UINT32 testcase1(VOID)
|
|
||||||
{
|
|
||||||
int fd;
|
|
||||||
struct statfs buf;
|
|
||||||
int ret;
|
|
||||||
errno = 0;
|
|
||||||
|
|
||||||
fd = open("/lib/libc.so", O_RDONLY);
|
|
||||||
ret = fstatfs(fd, &buf);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, OUT);
|
|
||||||
TEST_PRINT("[INFO]The \"/lib/libc.so\" 's,buf->f_type=0x%x\n", buf.f_type);
|
|
||||||
TEST_PRINT("[INFO]Check the file's filesystem type:./musl/kernel/include/sys/statfs.h:#define JFFS2_SUPER_MAGIC 0x72b6,#define MSDOS_SUPER_MAGIC 0x4d44\n");
|
|
||||||
TEST_PRINT("[INFO]%s:%d,%s,ret=%d,errno=%d,errstr=%s\n", __FILE__, __LINE__, __func__, ret, errno, strerror(errno));
|
|
||||||
ICUNIT_ASSERT_EQUAL(buf.f_type, 0x4d44, -1);
|
|
||||||
ICUNIT_GOTO_EQUAL(buf.f_type, 0x4d44, -1, OUT);
|
|
||||||
|
|
||||||
return LOS_OK;
|
|
||||||
OUT:
|
|
||||||
return LOS_NOK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static UINT32 testcase(VOID)
|
|
||||||
{
|
|
||||||
testcase1();
|
|
||||||
|
|
||||||
return LOS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID IO_TEST_FSTATFS_001(void)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, testcase, TEST_LIB, TEST_LIBC, TEST_LEVEL1, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
@ -1,142 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include "fcntl.h"
|
|
||||||
#include "sys/vfs.h"
|
|
||||||
|
|
||||||
static UINT32 testcase1(VOID)
|
|
||||||
{
|
|
||||||
struct statfs buf;
|
|
||||||
char pathname[] = "./fstatfs.tmp";
|
|
||||||
int ret = 0;
|
|
||||||
int fd = 0;
|
|
||||||
errno = 0;
|
|
||||||
|
|
||||||
fd = open(pathname, O_RDWR | O_CREAT);
|
|
||||||
TEST_PRINT("[INFO]%s:%d,%s,fd=%d,errno=%d,errstr=%s\n", __FILE__, __LINE__, __func__, fd, errno, strerror(errno));
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, OUT);
|
|
||||||
|
|
||||||
errno = 0;
|
|
||||||
ret = chmod(pathname, 0);
|
|
||||||
TEST_PRINT("[INFO]%s:%d,%s,ret=%d,errno=%d,errstr=%s\n", __FILE__, __LINE__, __func__, ret, errno, strerror(errno));
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, OUT);
|
|
||||||
|
|
||||||
errno = 0;
|
|
||||||
ret = fstatfs(fd, &buf);
|
|
||||||
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
|
|
||||||
TEST_PRINT("[INFO]%s:%d,%s,ret=%d,errno=%d,errstr=%s\n", __FILE__, __LINE__, __func__, ret, errno, strerror(errno));
|
|
||||||
/* ICUNIT_GOTO_EQUAL(ret, -1, ret, OUT); omitted temprorily,as chmod does no works. */
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, OUT);
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, EACCES, errno, OUT);
|
|
||||||
|
|
||||||
return LOS_OK;
|
|
||||||
OUT:
|
|
||||||
return LOS_NOK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static UINT32 testcase2(VOID)
|
|
||||||
{
|
|
||||||
struct statfs buf;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
errno = 0;
|
|
||||||
ret = fstatfs(0xffffffff, &buf);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, -1, ret, OUT);
|
|
||||||
TEST_PRINT("[INFO]%s:%d,%s,ret=%d,errno=%d,errstr=%s\n", __FILE__, __LINE__, __func__, ret, errno, strerror(errno));
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, EBADF, errno, OUT);
|
|
||||||
|
|
||||||
return LOS_OK;
|
|
||||||
OUT:
|
|
||||||
return LOS_NOK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static UINT32 testcase3(VOID)
|
|
||||||
{
|
|
||||||
struct statfs buf;
|
|
||||||
int ret;
|
|
||||||
int fd;
|
|
||||||
char *pathname = (char *)"./fstatfs2.tmp";
|
|
||||||
|
|
||||||
errno = 0;
|
|
||||||
fd = open(pathname, O_RDONLY | O_CREAT);
|
|
||||||
|
|
||||||
errno = 0;
|
|
||||||
ret = fstatfs(fd, &buf);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, OUT);
|
|
||||||
TEST_PRINT("[INFO]%s:%d,%s,ret=%d,errno=%d,errstr=%s\n", __FILE__, __LINE__, __func__, ret, errno, strerror(errno));
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, EINVAL, errno, OUT);
|
|
||||||
|
|
||||||
return LOS_OK;
|
|
||||||
OUT:
|
|
||||||
return LOS_NOK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static UINT32 test()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static UINT32 testcase4(VOID)
|
|
||||||
{
|
|
||||||
struct statfs *buf = nullptr;
|
|
||||||
int ret;
|
|
||||||
int fd;
|
|
||||||
|
|
||||||
errno = 0;
|
|
||||||
fd = open("/lib/libc.so", O_RDONLY);
|
|
||||||
|
|
||||||
errno = 0;
|
|
||||||
ret = fstatfs(fd, (struct statfs *)nullptr);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, OUT);
|
|
||||||
TEST_PRINT("[INFO]%s:%d,%s,ret=%d,errno=%d,errstr=%s\n", __FILE__, __LINE__, __func__, ret, errno, strerror(errno));
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, EINVAL, errno, OUT);
|
|
||||||
|
|
||||||
return LOS_OK;
|
|
||||||
OUT:
|
|
||||||
return LOS_NOK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static UINT32 testcase(VOID)
|
|
||||||
{
|
|
||||||
/* testcase1(); 本用例因chmod函数无法改文件权限而无法测,故注释*/
|
|
||||||
testcase2();
|
|
||||||
/* testcase3(); 本用例传非法参数由内核检测返回EINVAL,但musl部分代码会对空地址赋值进而跑飞,故注释*/
|
|
||||||
/* testcase4(); 本用例传非法参数由内核检测返回EINVAL,但musl部分代码会对空地址赋值进而跑飞,故注释*/
|
|
||||||
|
|
||||||
return LOS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID IO_TEST_FSTATFS_002(void)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE(__FUNCTION__, testcase, TEST_LIB, TEST_LIBC, TEST_LEVEL1, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
@ -1,179 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret, scandirCount;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR pathname[50] = { JFFS_PATH_NAME0 };
|
|
||||||
DIR *dir = NULL;
|
|
||||||
struct dirent *ptr = NULL;
|
|
||||||
off_t offset, offset1, offset2, offset3, offset4;
|
|
||||||
struct dirent **namelist = NULL;
|
|
||||||
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname, sizeof(pathname), "/0test");
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/0file", sizeof(pathname));
|
|
||||||
fd = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT2);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/2test", sizeof(pathname));
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/1test", sizeof(pathname));
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT4);
|
|
||||||
|
|
||||||
dir = opendir(JFFS_PATH_NAME0);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dir, NULL, dir, EXIT5);
|
|
||||||
|
|
||||||
ptr = readdir(dir);
|
|
||||||
offset1 = ptr->d_off;
|
|
||||||
|
|
||||||
ptr = readdir(dir);
|
|
||||||
offset2 = ptr->d_off;
|
|
||||||
|
|
||||||
ptr = readdir(dir);
|
|
||||||
offset3 = ptr->d_off;
|
|
||||||
|
|
||||||
ptr = readdir(dir);
|
|
||||||
offset4 = ptr->d_off;
|
|
||||||
|
|
||||||
seekdir(dir, offset2);
|
|
||||||
offset = telldir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, offset2, offset, EXIT5);
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT5);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(ptr->d_name, "1test", ptr->d_name, EXIT5);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, ptr->d_off - 1, offset, EXIT5);
|
|
||||||
|
|
||||||
seekdir(dir, offset1);
|
|
||||||
offset = telldir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, offset1, offset, EXIT5);
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT5);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(ptr->d_name, "0file", ptr->d_name, EXIT5);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, ptr->d_off - 1, offset, EXIT5);
|
|
||||||
|
|
||||||
seekdir(dir, offset4);
|
|
||||||
offset = telldir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, offset4, offset, EXIT5);
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(ptr, NULL, ptr, EXIT5);
|
|
||||||
|
|
||||||
seekdir(dir, offset3);
|
|
||||||
offset = telldir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, offset3, offset, EXIT5);
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT5);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(ptr->d_name, "0test", ptr->d_name, EXIT5);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, ptr->d_off - 1, offset, EXIT5);
|
|
||||||
|
|
||||||
scandirCount = scandir(JFFS_PATH_NAME0, &namelist, 0, alphasort);
|
|
||||||
ICUNIT_GOTO_EQUAL(scandirCount, 4, scandirCount, EXIT5); // 4 means total scaned file
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(namelist[0]->d_name, "0file", namelist[0]->d_name, EXIT); // 0 means first file
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(namelist[1]->d_name, "0test", namelist[1]->d_name, EXIT); // 1 means second file
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(namelist[2]->d_name, "1test", namelist[2]->d_name, EXIT); // 2 means third file
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(namelist[3]->d_name, "2test", namelist[3]->d_name, EXIT); // 3 means four file
|
|
||||||
|
|
||||||
seekdir(dir, namelist[3]->d_off); // 3 means four file
|
|
||||||
offset = telldir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(offset, -1, offset, EXIT5);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset1, namelist[3]->d_off, offset1, EXIT5); // 3 means four file
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, namelist[3]->d_off, offset, EXIT5); // 3 means four file
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT5);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(ptr->d_name, "0file", ptr->d_name, EXIT5);
|
|
||||||
|
|
||||||
seekdir(dir, namelist[2]->d_off); // 2 means third file
|
|
||||||
offset = telldir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(offset, -1, offset, EXIT5);
|
|
||||||
ICUNIT_GOTO_EQUAL(offset3, namelist[2]->d_off, offset3, EXIT5); // 2 means third file
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, namelist[2]->d_off, offset, EXIT5); // 2 means third file
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT5);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(ptr->d_name, "0test", ptr->d_name, EXIT5);
|
|
||||||
|
|
||||||
JffsScandirFree(namelist, scandirCount);
|
|
||||||
|
|
||||||
scandirCount = 0;
|
|
||||||
|
|
||||||
scandirCount = scandir(JFFS_PATH_NAME0, &namelist, 0, NULL);
|
|
||||||
ICUNIT_GOTO_EQUAL(scandirCount, 4, scandirCount, EXIT5); // 4 means total scaned file
|
|
||||||
|
|
||||||
seekdir(dir, namelist[3]->d_off); // 3 means four file
|
|
||||||
ICUNIT_GOTO_EQUAL(offset4, namelist[3]->d_off, offset4, EXIT5); // 3 means four file
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(ptr, NULL, ptr, EXIT5);
|
|
||||||
|
|
||||||
seekdir(dir, namelist[0]->d_off); // 0 means first file
|
|
||||||
ICUNIT_GOTO_EQUAL(offset1, namelist[0]->d_off, offset1, EXIT5); // 0 means first file
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(ptr->d_name, "0file", ptr->d_name, EXIT5);
|
|
||||||
|
|
||||||
EXIT6:
|
|
||||||
JffsScandirFree(namelist, scandirCount);
|
|
||||||
EXIT5:
|
|
||||||
ret = closedir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT5);
|
|
||||||
EXIT4:
|
|
||||||
JffsStrcat2(pathname, "/1test", sizeof(pathname));
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT3:
|
|
||||||
JffsStrcat2(pathname, "/2test", sizeof(pathname));
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT2:
|
|
||||||
JffsStrcat2(pathname, "/0file", sizeof(pathname));
|
|
||||||
close(fd);
|
|
||||||
remove(pathname);
|
|
||||||
EXIT1:
|
|
||||||
JffsStrcat2(pathname, "/0test", sizeof(pathname));
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT:
|
|
||||||
rmdir(JFFS_PATH_NAME0);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
VOID ItFsJffs004(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_004", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,125 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 fd = -1;
|
|
||||||
INT32 fd1 = -1;
|
|
||||||
INT32 ret;
|
|
||||||
CHAR *pret = NULL;
|
|
||||||
CHAR pathname[50] = { JFFS_PATH_NAME0 };
|
|
||||||
CHAR buf[30] = "";
|
|
||||||
struct dirent *ptr = NULL;
|
|
||||||
INT32 offset, offset1, offset2, offset3, offset4;
|
|
||||||
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
ret = chdir(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
pret = getcwd(buf, 30); // 30 means name length
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(pret, NULL, pret, EXIT);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(buf, pathname, buf, EXIT);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname, sizeof(pathname), "/0test");
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = chdir(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
pret = getcwd(buf, 30); // 30 means name length
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(pret, NULL, pret, EXIT1);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(buf, pathname, buf, EXIT1);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/0file", sizeof(pathname));
|
|
||||||
fd = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT2);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/2test", sizeof(pathname));
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
|
|
||||||
ret = chdir(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
pret = getcwd(buf, 30); // 30 means name length
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(pret, NULL, pret, EXIT3);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(buf, pathname, buf, EXIT3);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname, sizeof(pathname), "/1file");
|
|
||||||
fd1 = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT4);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/1test", sizeof(pathname));
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT5);
|
|
||||||
|
|
||||||
ret = chdir(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT5);
|
|
||||||
pret = getcwd(buf, 30); // 30 means name length
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(pret, NULL, pret, EXIT5);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(buf, pathname, buf, EXIT5);
|
|
||||||
|
|
||||||
ret = chdir("/storage");
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT5);
|
|
||||||
pret = getcwd(buf, 30); // 30 means name length
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(pret, NULL, pret, EXIT5);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(buf, "/storage", buf, EXIT5);
|
|
||||||
|
|
||||||
EXIT5:
|
|
||||||
JffsStrcat2(pathname, "/1test", sizeof(pathname));
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT4:
|
|
||||||
JffsStrcat2(pathname, "/2test/1file", sizeof(pathname));
|
|
||||||
close(fd1);
|
|
||||||
remove(pathname);
|
|
||||||
EXIT3:
|
|
||||||
JffsStrcat2(pathname, "/2test", sizeof(pathname));
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT2:
|
|
||||||
JffsStrcat2(pathname, "/0file", sizeof(pathname));
|
|
||||||
close(fd);
|
|
||||||
remove(pathname);
|
|
||||||
EXIT1:
|
|
||||||
JffsStrcat2(pathname, "/0test", sizeof(pathname));
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT:
|
|
||||||
rmdir(JFFS_PATH_NAME0);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
VOID ItFsJffs006(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_006", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,184 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 fd = -1;
|
|
||||||
INT32 fd1 = -1;
|
|
||||||
INT32 fd2 = -1;
|
|
||||||
INT32 fd3 = -1;
|
|
||||||
INT32 ret, scandirCount;
|
|
||||||
CHAR *pret = NULL;
|
|
||||||
CHAR pathname[50] = { JFFS_PATH_NAME0 };
|
|
||||||
CHAR buf[50] = "";
|
|
||||||
DIR *dir = NULL;
|
|
||||||
struct dirent *ptr = NULL;
|
|
||||||
struct stat statfile;
|
|
||||||
struct statfs statfsfile;
|
|
||||||
struct dirent **namelist = NULL;
|
|
||||||
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
ret = chdir(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
pret = getcwd(buf, 20); // 20 means path name len
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(pret, NULL, pret, EXIT);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(buf, pathname, buf, EXIT);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname, sizeof(pathname), "/0test");
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/0file", sizeof(pathname));
|
|
||||||
fd = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT2);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/2test", sizeof(pathname));
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname, sizeof(pathname), "/1file");
|
|
||||||
fd1 = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd1, -1, fd1, EXIT4);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/1test", sizeof(pathname));
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT5);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/2test", sizeof(pathname));
|
|
||||||
ret = chdir(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT5);
|
|
||||||
|
|
||||||
pret = getcwd(buf, 20); // 20 means path name len
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(pret, NULL, pret, EXIT5);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(buf, pathname, buf, EXIT5);
|
|
||||||
|
|
||||||
fd2 = open("2file", O_NONBLOCK | O_CREAT | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd2, -1, fd2, EXIT6);
|
|
||||||
|
|
||||||
fd3 = open("2file", O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(fd3, -1, fd3, EXIT6);
|
|
||||||
|
|
||||||
ret = mkdir("3dir", HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT7);
|
|
||||||
|
|
||||||
ret = mkdir("3dir", HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, 0, ret, EXIT7);
|
|
||||||
|
|
||||||
dir = opendir("3dir");
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dir, NULL, dir, EXIT8);
|
|
||||||
|
|
||||||
scandirCount = scandir(".", &namelist, 0, alphasort);
|
|
||||||
ICUNIT_GOTO_EQUAL(scandirCount, 3, scandirCount, EXIT8); // 3 means scan file num
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(namelist[0]->d_name, "1file", namelist[0]->d_name, EXIT9); // 0 means first file
|
|
||||||
|
|
||||||
ret = rename("2file", "file2");
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT10);
|
|
||||||
|
|
||||||
ret = stat("file2", &statfile);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT10);
|
|
||||||
ICUNIT_GOTO_EQUAL(statfile.st_size, 0, statfile.st_size, EXIT10);
|
|
||||||
|
|
||||||
ret = statfs("file2", &statfsfile);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT10);
|
|
||||||
|
|
||||||
ret = access("file2", R_OK);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT10);
|
|
||||||
|
|
||||||
ret = close(fd2);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT10);
|
|
||||||
|
|
||||||
ret = unlink("file2");
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT10);
|
|
||||||
|
|
||||||
ret = chdir("3dir");
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT9);
|
|
||||||
(void)strcat_s(pathname, sizeof(pathname), "/3dir");
|
|
||||||
pret = getcwd(buf, 30); // 30 means path name len
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(pret, NULL, pret, EXIT9);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(buf, pathname, buf, EXIT9);
|
|
||||||
|
|
||||||
ret = chdir("../");
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT9);
|
|
||||||
JffsStrcat2(pathname, "/2test", sizeof(pathname));
|
|
||||||
pret = getcwd(buf, 20); // 20 means path name len
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(pret, NULL, pret, EXIT9);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(buf, pathname, buf, EXIT9);
|
|
||||||
|
|
||||||
EXIT10:
|
|
||||||
JffsStrcat2(pathname, "/2test/file2", sizeof(pathname));
|
|
||||||
close(fd2);
|
|
||||||
remove(pathname);
|
|
||||||
EXIT9:
|
|
||||||
JffsScandirFree(namelist, scandirCount);
|
|
||||||
EXIT8:
|
|
||||||
ret = closedir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT8);
|
|
||||||
EXIT7:
|
|
||||||
JffsStrcat2(pathname, "/2test/3dir", sizeof(pathname));
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT6:
|
|
||||||
JffsStrcat2(pathname, "/2test/2file", sizeof(pathname));
|
|
||||||
close(fd2);
|
|
||||||
close(fd3);
|
|
||||||
remove(pathname);
|
|
||||||
EXIT5:
|
|
||||||
JffsStrcat2(pathname, "/1test", sizeof(pathname));
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT4:
|
|
||||||
JffsStrcat2(pathname, "/2test/1file", sizeof(pathname));
|
|
||||||
close(fd1);
|
|
||||||
remove(pathname);
|
|
||||||
EXIT3:
|
|
||||||
JffsStrcat2(pathname, "/2test", sizeof(pathname));
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT2:
|
|
||||||
JffsStrcat2(pathname, "/0file", sizeof(pathname));
|
|
||||||
close(fd);
|
|
||||||
remove(pathname);
|
|
||||||
EXIT1:
|
|
||||||
JffsStrcat2(pathname, "/0test", sizeof(pathname));
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT:
|
|
||||||
rmdir(JFFS_PATH_NAME0);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
VOID ItFsJffs007(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_007", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,135 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 fd = -1;
|
|
||||||
INT32 fd1 = -1;
|
|
||||||
INT32 ret, scandirCount;
|
|
||||||
CHAR *pret = NULL;
|
|
||||||
CHAR pathname[50] = { JFFS_PATH_NAME0 };
|
|
||||||
DIR *dir = NULL;
|
|
||||||
struct dirent *ptr = NULL;
|
|
||||||
struct dirent **namelist = NULL;
|
|
||||||
INT32 offset, offset1, offset2, offset3, offset4;
|
|
||||||
CHAR buf[20];
|
|
||||||
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname, sizeof(pathname), "/0test");
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/0file", sizeof(pathname));
|
|
||||||
fd = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT2);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/2test", sizeof(pathname));
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname, sizeof(pathname), "/1file");
|
|
||||||
fd1 = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd1, -1, fd1, EXIT4);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/1test", sizeof(pathname));
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT5);
|
|
||||||
|
|
||||||
dir = opendir(JFFS_PATH_NAME0);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dir, NULL, dir, EXIT6);
|
|
||||||
|
|
||||||
offset = telldir(dir);
|
|
||||||
ptr = readdir(dir);
|
|
||||||
offset1 = ptr->d_off;
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, offset1 - 1, offset, EXIT6);
|
|
||||||
|
|
||||||
offset = telldir(dir);
|
|
||||||
ptr = readdir(dir);
|
|
||||||
offset2 = ptr->d_off;
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, offset2 - 1, offset, EXIT6);
|
|
||||||
|
|
||||||
offset = telldir(dir);
|
|
||||||
ptr = readdir(dir);
|
|
||||||
offset3 = ptr->d_off;
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, offset3 - 1, offset, EXIT6);
|
|
||||||
|
|
||||||
offset = telldir(dir);
|
|
||||||
ptr = readdir(dir);
|
|
||||||
offset4 = ptr->d_off;
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, offset4 - 1, offset, EXIT6);
|
|
||||||
|
|
||||||
scandirCount = scandir(JFFS_PATH_NAME0, &namelist, NULL, alphasort);
|
|
||||||
ICUNIT_GOTO_EQUAL(scandirCount, 4, scandirCount, EXIT6); // 4 means total scaned file
|
|
||||||
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(namelist[0]->d_name, "0file", namelist[0]->d_name, EXIT7); // 0 means first file
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(namelist[1]->d_name, "0test", namelist[1]->d_name, EXIT7); // 1 means second file
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(namelist[2]->d_name, "1test", namelist[2]->d_name, EXIT7); // 2 means third file
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(namelist[3]->d_name, "2test", namelist[3]->d_name, EXIT7); // 3 means four file
|
|
||||||
ICUNIT_GOTO_EQUAL(namelist[0]->d_off, offset2, namelist[0]->d_off, EXIT7); // 0 means first file
|
|
||||||
ICUNIT_GOTO_EQUAL(namelist[2]->d_off, offset3, namelist[2]->d_off, EXIT7); // 2 means third file
|
|
||||||
|
|
||||||
EXIT7:
|
|
||||||
JffsScandirFree(namelist, scandirCount);
|
|
||||||
EXIT6:
|
|
||||||
ret = closedir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT6);
|
|
||||||
EXIT5:
|
|
||||||
JffsStrcat2(pathname, "/1test", sizeof(pathname));
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT4:
|
|
||||||
JffsStrcat2(pathname, "/2test/1file", sizeof(pathname));
|
|
||||||
close(fd1);
|
|
||||||
remove(pathname);
|
|
||||||
EXIT3:
|
|
||||||
JffsStrcat2(pathname, "/2test", sizeof(pathname));
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT2:
|
|
||||||
JffsStrcat2(pathname, "/0file", sizeof(pathname));
|
|
||||||
close(fd);
|
|
||||||
remove(pathname);
|
|
||||||
EXIT1:
|
|
||||||
JffsStrcat2(pathname, "/0test", sizeof(pathname));
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT:
|
|
||||||
rmdir(JFFS_PATH_NAME0);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
VOID ItFsJffs008(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_008", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,135 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static INT32 ScandirF01(const struct dirent *ent)
|
|
||||||
{
|
|
||||||
// read out a file while the name begined with "test"
|
|
||||||
return (strncmp(ent->d_name, "test", 4) == 0);
|
|
||||||
}
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 fd = -1;
|
|
||||||
INT32 fd1 = -1;
|
|
||||||
INT32 ret, scandirCount;
|
|
||||||
CHAR *pret = NULL;
|
|
||||||
CHAR pathname[50] = { JFFS_PATH_NAME0 };
|
|
||||||
DIR *dir = NULL;
|
|
||||||
struct dirent *ptr = NULL;
|
|
||||||
struct dirent **namelist = NULL;
|
|
||||||
INT32 offset, offset1, offset2, offset3, offset4;
|
|
||||||
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname, sizeof(pathname), "/test");
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/testfile", 50); // 50 means name length
|
|
||||||
fd = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT2);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/0test1", 50); // 50 means name length
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname, sizeof(pathname), "/test1file");
|
|
||||||
fd1 = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT4);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/test2", 50); // 50 means name length
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT5);
|
|
||||||
|
|
||||||
dir = opendir(JFFS_PATH_NAME0);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dir, NULL, dir, EXIT6);
|
|
||||||
|
|
||||||
offset = telldir(dir);
|
|
||||||
ptr = readdir(dir);
|
|
||||||
offset1 = ptr->d_off;
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, offset1 - 1, offset, EXIT6);
|
|
||||||
|
|
||||||
offset = telldir(dir);
|
|
||||||
ptr = readdir(dir);
|
|
||||||
offset2 = ptr->d_off;
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, offset2 - 1, offset, EXIT6);
|
|
||||||
|
|
||||||
offset = telldir(dir);
|
|
||||||
ptr = readdir(dir);
|
|
||||||
offset3 = ptr->d_off;
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, offset3 - 1, offset, EXIT6);
|
|
||||||
|
|
||||||
offset = telldir(dir);
|
|
||||||
ptr = readdir(dir);
|
|
||||||
offset4 = ptr->d_off;
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, offset4 - 1, offset, EXIT6);
|
|
||||||
|
|
||||||
scandirCount = scandir(JFFS_PATH_NAME0, &namelist, ScandirF01, alphasort);
|
|
||||||
ICUNIT_GOTO_EQUAL(scandirCount, 3, scandirCount, EXIT6); // 3 means total scaned file
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(namelist[0]->d_name, "test", namelist[0]->d_name, EXIT7); // 0 means first file
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(namelist[1]->d_name, "test2", namelist[1]->d_name, EXIT7); // 1 means second file
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(namelist[2]->d_name, "testfile", namelist[2]->d_name, EXIT7); // 2 means third file
|
|
||||||
ICUNIT_GOTO_EQUAL(namelist[0]->d_type, DT_DIR, namelist[0]->d_name, EXIT7); // 0 means first file
|
|
||||||
|
|
||||||
EXIT7:
|
|
||||||
JffsScandirFree(namelist, scandirCount);
|
|
||||||
EXIT6:
|
|
||||||
ret = closedir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT6);
|
|
||||||
EXIT5:
|
|
||||||
JffsStrcat2(pathname, "/test2", sizeof(pathname));
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT4:
|
|
||||||
JffsStrcat2(pathname, "/0test1/test1file", sizeof(pathname));
|
|
||||||
close(fd1);
|
|
||||||
remove(pathname);
|
|
||||||
EXIT3:
|
|
||||||
JffsStrcat2(pathname, "/0test1", sizeof(pathname));
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT2:
|
|
||||||
JffsStrcat2(pathname, "/testfile", sizeof(pathname));
|
|
||||||
close(fd);
|
|
||||||
remove(pathname);
|
|
||||||
EXIT1:
|
|
||||||
JffsStrcat2(pathname, "/test", sizeof(pathname));
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT:
|
|
||||||
rmdir(JFFS_PATH_NAME0);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs009(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_009", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,140 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static INT32 ScandirF01(const struct dirent *ent)
|
|
||||||
{
|
|
||||||
return (strncmp(ent->d_name, "test", 4) == 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
static INT32 ScandirF02(const struct dirent **a, const struct dirent **b)
|
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 fd = -1;
|
|
||||||
INT32 fd1 = -1;
|
|
||||||
INT32 ret, scandirCount;
|
|
||||||
CHAR *pret = NULL;
|
|
||||||
CHAR pathname[50] = { JFFS_PATH_NAME0 };
|
|
||||||
DIR *dir = NULL;
|
|
||||||
struct dirent *ptr = NULL;
|
|
||||||
struct dirent **namelist = NULL;
|
|
||||||
INT32 offset, offset1, offset2, offset3, offset4;
|
|
||||||
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname, sizeof(pathname), "/test0");
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/testfile", sizeof(pathname));
|
|
||||||
fd = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT2);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/0test1", sizeof(pathname));
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname, sizeof(pathname), "/test1file");
|
|
||||||
fd1 = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT4);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/test1", sizeof(pathname));
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT5);
|
|
||||||
|
|
||||||
dir = opendir(JFFS_PATH_NAME0);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dir, NULL, dir, EXIT6);
|
|
||||||
|
|
||||||
offset = telldir(dir);
|
|
||||||
ptr = readdir(dir);
|
|
||||||
offset1 = ptr->d_off;
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, offset1, offset, EXIT6);
|
|
||||||
|
|
||||||
offset = telldir(dir);
|
|
||||||
ptr = readdir(dir);
|
|
||||||
offset2 = ptr->d_off;
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, offset2, offset, EXIT6);
|
|
||||||
|
|
||||||
offset = telldir(dir);
|
|
||||||
ptr = readdir(dir);
|
|
||||||
offset3 = ptr->d_off;
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, offset3, offset, EXIT6);
|
|
||||||
|
|
||||||
offset = telldir(dir);
|
|
||||||
ptr = readdir(dir);
|
|
||||||
offset4 = ptr->d_off;
|
|
||||||
ICUNIT_GOTO_EQUAL(offset, offset4, offset, EXIT6);
|
|
||||||
|
|
||||||
scandirCount = scandir(JFFS_PATH_NAME0, &namelist, ScandirF01, ScandirF02);
|
|
||||||
ICUNIT_GOTO_EQUAL(scandirCount, 3, scandirCount, EXIT7); // 3 means total scaned file
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(namelist[0]->d_name, "test0", namelist[0]->d_name, EXIT7); // 0 means first file
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(namelist[1]->d_name, "test1", namelist[1]->d_name, EXIT7); // 1 means second file
|
|
||||||
ICUNIT_GOTO_EQUAL(namelist[0]->d_type, DT_DIR, namelist[0]->d_name, EXIT7); // 0 means first file
|
|
||||||
|
|
||||||
EXIT7:
|
|
||||||
JffsScandirFree(namelist, scandirCount);
|
|
||||||
EXIT6:
|
|
||||||
ret = closedir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT6);
|
|
||||||
EXIT5:
|
|
||||||
JffsStrcat2(pathname, "/test1", sizeof(pathname));
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT4:
|
|
||||||
JffsStrcat2(pathname, "/0test1/test1file", sizeof(pathname));
|
|
||||||
close(fd1);
|
|
||||||
remove(pathname);
|
|
||||||
EXIT3:
|
|
||||||
JffsStrcat2(pathname, "/0test1", sizeof(pathname));
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT2:
|
|
||||||
JffsStrcat2(pathname, "/testfile", sizeof(pathname));
|
|
||||||
close(fd);
|
|
||||||
remove(pathname);
|
|
||||||
EXIT1:
|
|
||||||
JffsStrcat2(pathname, "/test0", sizeof(pathname));
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT:
|
|
||||||
rmdir(JFFS_PATH_NAME0);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
VOID ItFsJffs010(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_010", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,134 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR pathname[50] = { JFFS_PATH_NAME0 };
|
|
||||||
DIR *dir = NULL;
|
|
||||||
struct dirent *ptr = NULL;
|
|
||||||
INT32 offset;
|
|
||||||
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
dir = opendir(JFFS_PATH_NAME0);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dir, NULL, dir, EXIT1);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname, sizeof(pathname), "/0test");
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT2);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname, sizeof(pathname), "/1test");
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname, sizeof(pathname), "/2test");
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT4);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname, sizeof(pathname), "/0file");
|
|
||||||
fd = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT5);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/0test/1test/2test", sizeof(pathname));
|
|
||||||
ret = rmdir(pathname);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, 0, ret, EXIT5);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/0test/1test", sizeof(pathname));
|
|
||||||
ret = rmdir(pathname);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, 0, ret, EXIT5);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/0test", sizeof(pathname));
|
|
||||||
ret = rmdir(pathname);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, 0, ret, EXIT5);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/0test/1test/2test/0file", sizeof(pathname));
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT5);
|
|
||||||
ret = remove(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT5);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/0test/1test/2test", sizeof(pathname));
|
|
||||||
ret = rmdir(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT4);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/0test", sizeof(pathname));
|
|
||||||
ret = rmdir(pathname);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, 0, ret, EXIT4);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/0test/1test", sizeof(pathname));
|
|
||||||
ret = rmdir(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/0test", sizeof(pathname));
|
|
||||||
ret = rmdir(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = closedir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = rmdir(JFFS_PATH_NAME0);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
ret = rmdir(JFFS_PATH_NAME0);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
|
|
||||||
EXIT5:
|
|
||||||
JffsStrcat2(pathname, "/0test/1test/2test/0file", sizeof(pathname));
|
|
||||||
close(fd);
|
|
||||||
remove(pathname);
|
|
||||||
EXIT4:
|
|
||||||
JffsStrcat2(pathname, "/0test/1test/2test", sizeof(pathname));
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT3:
|
|
||||||
JffsStrcat2(pathname, "/0test/1test", sizeof(pathname));
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT2:
|
|
||||||
JffsStrcat2(pathname, "/0test", sizeof(pathname));
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT1:
|
|
||||||
ret = closedir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
EXIT:
|
|
||||||
rmdir(JFFS_PATH_NAME0);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs011(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_011", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,146 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR pathname[50] = { JFFS_PATH_NAME0 };
|
|
||||||
DIR *dir1 = NULL;
|
|
||||||
DIR *dir2 = NULL;
|
|
||||||
DIR *dir3 = NULL;
|
|
||||||
DIR *dir4 = NULL;
|
|
||||||
struct dirent *ptr = NULL;
|
|
||||||
INT32 offset;
|
|
||||||
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
dir1 = opendir(pathname);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dir1, NULL, dir1, EXIT1);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname, sizeof(pathname), "/0test");
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT2);
|
|
||||||
|
|
||||||
dir2 = opendir(pathname);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dir2, NULL, dir2, EXIT3);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname, sizeof(pathname), "/1test");
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT4);
|
|
||||||
|
|
||||||
dir3 = opendir(pathname);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dir3, NULL, dir3, EXIT5);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname, sizeof(pathname), "/2test");
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT6);
|
|
||||||
|
|
||||||
dir4 = opendir(pathname);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dir4, NULL, dir4, EXIT7);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname, sizeof(pathname), "/0file");
|
|
||||||
fd = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT8);
|
|
||||||
|
|
||||||
ret = closedir(dir1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT8);
|
|
||||||
|
|
||||||
ret = closedir(dir2);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT8);
|
|
||||||
|
|
||||||
ret = closedir(dir3);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT8);
|
|
||||||
|
|
||||||
ret = closedir(dir4);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT8);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/0test/1test/2test/0file", sizeof(pathname));
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT8);
|
|
||||||
ret = remove(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT8);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/0test/1test/2test", sizeof(pathname));
|
|
||||||
ret = rmdir(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT6);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/0test", sizeof(pathname));
|
|
||||||
ret = rmdir(pathname);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, 0, ret, EXIT4);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/0test/1test", sizeof(pathname));
|
|
||||||
ret = rmdir(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT4);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/0test", sizeof(pathname));
|
|
||||||
ret = rmdir(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = rmdir(JFFS_PATH_NAME0);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
|
|
||||||
EXIT8:
|
|
||||||
JffsStrcat2(pathname, "/0test/1test/2test/0file", sizeof(pathname));
|
|
||||||
close(fd);
|
|
||||||
remove(pathname);
|
|
||||||
EXIT7:
|
|
||||||
closedir(dir4);
|
|
||||||
EXIT6:
|
|
||||||
JffsStrcat2(pathname, "/0test/1test/2test", sizeof(pathname));
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT5:
|
|
||||||
closedir(dir3);
|
|
||||||
EXIT4:
|
|
||||||
JffsStrcat2(pathname, "/0test/1test", sizeof(pathname));
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT3:
|
|
||||||
closedir(dir2);
|
|
||||||
EXIT2:
|
|
||||||
JffsStrcat2(pathname, "/0test", sizeof(pathname));
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT1:
|
|
||||||
closedir(dir1);
|
|
||||||
EXIT:
|
|
||||||
rmdir(JFFS_PATH_NAME0);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
VOID ItFsJffs012(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_012", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,138 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 fd[5] = { -1 };
|
|
||||||
INT32 ret, len;
|
|
||||||
CHAR filebuf[20] = "1234567890";
|
|
||||||
CHAR readbuf[100] = { 0 };
|
|
||||||
CHAR pathname[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME0 };
|
|
||||||
off_t off;
|
|
||||||
|
|
||||||
fd[0] = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR, HIGHEST_AUTHORITY); // 0 means first fd
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd[0], -1, fd[0], EXIT); // 0 means first fd
|
|
||||||
|
|
||||||
(void)strcat_s(pathname, sizeof(pathname), "0");
|
|
||||||
fd[1] = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR, HIGHEST_AUTHORITY); // 1 means second fd
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd[1], -1, fd[1], EXIT1); // 1 means second fd
|
|
||||||
|
|
||||||
(void)strcat_s(pathname, sizeof(pathname), "1");
|
|
||||||
fd[2] = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR, HIGHEST_AUTHORITY); // 2 means third fd
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd[2], -1, fd[2], EXIT2); // 2 means third fd
|
|
||||||
|
|
||||||
(void)strcat_s(pathname, sizeof(pathname), "2");
|
|
||||||
fd[3] = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR, HIGHEST_AUTHORITY); // 3 means four fd
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd[3], -1, fd[3], EXIT3); // 3 means four fd
|
|
||||||
|
|
||||||
(void)strcat_s(pathname, sizeof(pathname), "3");
|
|
||||||
fd[4] = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR, HIGHEST_AUTHORITY); // 4 means fifth fd
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd[4], -1, fd[4], EXIT4); // 4 means fifth fd
|
|
||||||
|
|
||||||
len = write(fd[0], filebuf, strlen(filebuf)); // 0 means first fd
|
|
||||||
ICUNIT_GOTO_EQUAL(len, JFFS_SHORT_ARRAY_LENGTH, len, EXIT4);
|
|
||||||
|
|
||||||
off = lseek(fd[0], 0, SEEK_SET); // 0 means first fd
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(off, -1, off, EXIT4);
|
|
||||||
|
|
||||||
len = read(fd[0], readbuf, JFFS_STANDARD_NAME_LENGTH); // 0 means first fd
|
|
||||||
ICUNIT_GOTO_EQUAL(len, JFFS_SHORT_ARRAY_LENGTH, len, EXIT4);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, filebuf, readbuf, EXIT4);
|
|
||||||
|
|
||||||
len = write(fd[1], filebuf, strlen(filebuf)); // 1 means second fd
|
|
||||||
ICUNIT_GOTO_EQUAL(len, JFFS_SHORT_ARRAY_LENGTH, len, EXIT4);
|
|
||||||
|
|
||||||
off = lseek(fd[1], 0, SEEK_SET); // 1 means second fd
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(off, -1, off, EXIT4);
|
|
||||||
|
|
||||||
len = read(fd[1], readbuf, JFFS_STANDARD_NAME_LENGTH); // 1 means second fd
|
|
||||||
ICUNIT_GOTO_EQUAL(len, JFFS_SHORT_ARRAY_LENGTH, len, EXIT4);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, filebuf, readbuf, EXIT4);
|
|
||||||
|
|
||||||
len = write(fd[2], filebuf, strlen(filebuf)); // 2 means third fd
|
|
||||||
ICUNIT_GOTO_EQUAL(len, JFFS_SHORT_ARRAY_LENGTH, len, EXIT4);
|
|
||||||
|
|
||||||
off = lseek(fd[2], 0, SEEK_SET); // 2 means third fd
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(off, -1, off, EXIT4);
|
|
||||||
|
|
||||||
len = read(fd[2], readbuf, JFFS_STANDARD_NAME_LENGTH); // 2 means third fd
|
|
||||||
ICUNIT_GOTO_EQUAL(len, JFFS_SHORT_ARRAY_LENGTH, len, EXIT4);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, filebuf, readbuf, EXIT4);
|
|
||||||
|
|
||||||
len = write(fd[3], filebuf, strlen(filebuf)); // 3 means four fd
|
|
||||||
ICUNIT_GOTO_EQUAL(len, JFFS_SHORT_ARRAY_LENGTH, len, EXIT4);
|
|
||||||
|
|
||||||
off = lseek(fd[3], 0, SEEK_SET); // 3 means four fd
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(off, -1, off, EXIT4);
|
|
||||||
|
|
||||||
len = read(fd[3], readbuf, JFFS_STANDARD_NAME_LENGTH); // 3 means four fd
|
|
||||||
ICUNIT_GOTO_EQUAL(len, JFFS_SHORT_ARRAY_LENGTH, len, EXIT4);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, filebuf, readbuf, EXIT4);
|
|
||||||
|
|
||||||
len = write(fd[4], filebuf, strlen(filebuf)); // 4 means fifth fd
|
|
||||||
ICUNIT_GOTO_EQUAL(len, JFFS_SHORT_ARRAY_LENGTH, len, EXIT4);
|
|
||||||
|
|
||||||
off = lseek(fd[4], 0, SEEK_SET); // 4 means fifth fd
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(off, -1, off, EXIT4);
|
|
||||||
|
|
||||||
len = read(fd[4], readbuf, JFFS_STANDARD_NAME_LENGTH); // 4 means fifth fd
|
|
||||||
ICUNIT_GOTO_EQUAL(len, JFFS_SHORT_ARRAY_LENGTH, len, EXIT4);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, filebuf, readbuf, EXIT4);
|
|
||||||
|
|
||||||
EXIT4:
|
|
||||||
JffsStrcat2(pathname, "0123", sizeof(pathname));
|
|
||||||
close(fd[4]); // 4 means fifth fd
|
|
||||||
remove(pathname);
|
|
||||||
EXIT3:
|
|
||||||
JffsStrcat2(pathname, "012", sizeof(pathname));
|
|
||||||
close(fd[3]); // 3 means four fd
|
|
||||||
remove(pathname);
|
|
||||||
EXIT2:
|
|
||||||
JffsStrcat2(pathname, "01", sizeof(pathname));
|
|
||||||
close(fd[2]); // 2 means third fd
|
|
||||||
remove(pathname);
|
|
||||||
EXIT1:
|
|
||||||
JffsStrcat2(pathname, "0", sizeof(pathname));
|
|
||||||
close(fd[1]); // 1 means second fd
|
|
||||||
remove(pathname);
|
|
||||||
EXIT:
|
|
||||||
close(fd[0]); // 0 means first fd
|
|
||||||
remove(JFFS_PATH_NAME0);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs013(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_013", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,127 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 fd[3] = { -1 };
|
|
||||||
INT32 ret, len;
|
|
||||||
CHAR filebuf[20] = "1234567890";
|
|
||||||
CHAR readbuf[100] = { 0 };
|
|
||||||
CHAR pathname[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME0 };
|
|
||||||
|
|
||||||
fd[0] = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY); // 0 means first fd
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd[0], -1, fd[0], EXIT1); // 0 means first fd
|
|
||||||
|
|
||||||
fd[1] = open(pathname, O_NONBLOCK | O_RDWR, HIGHEST_AUTHORITY); // 1 means second fd
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd[1], -1, fd[1], EXIT2); // 1 means second fd
|
|
||||||
|
|
||||||
fd[2] = open(pathname, O_NONBLOCK | O_RDWR, HIGHEST_AUTHORITY); // 2 means third fd
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd[2], -1, fd[2], EXIT3); // 2 means third fd
|
|
||||||
|
|
||||||
len = write(fd[0], filebuf, strlen(filebuf)); // 0 means first fd
|
|
||||||
ICUNIT_GOTO_EQUAL(len, JFFS_SHORT_ARRAY_LENGTH, len, EXIT3);
|
|
||||||
|
|
||||||
len = read(fd[1], readbuf, JFFS_STANDARD_NAME_LENGTH); // 1 means second fd
|
|
||||||
ICUNIT_GOTO_EQUAL(len, JFFS_SHORT_ARRAY_LENGTH, len, EXIT3);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, filebuf, readbuf, EXIT3);
|
|
||||||
|
|
||||||
len = read(fd[2], readbuf, JFFS_STANDARD_NAME_LENGTH); // 2 means third fd
|
|
||||||
ICUNIT_GOTO_EQUAL(len, JFFS_SHORT_ARRAY_LENGTH, len, EXIT3);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, filebuf, readbuf, EXIT3);
|
|
||||||
|
|
||||||
len = write(fd[2], filebuf, strlen(filebuf)); // 2 means third fd
|
|
||||||
ICUNIT_GOTO_EQUAL(len, JFFS_SHORT_ARRAY_LENGTH, len, EXIT3);
|
|
||||||
|
|
||||||
len = read(fd[1], readbuf, JFFS_STANDARD_NAME_LENGTH); // 1 means second fd
|
|
||||||
ICUNIT_GOTO_EQUAL(len, JFFS_SHORT_ARRAY_LENGTH, len, EXIT3);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, filebuf, readbuf, EXIT3);
|
|
||||||
|
|
||||||
len = read(fd[0], readbuf, JFFS_STANDARD_NAME_LENGTH); // 0 means first fd
|
|
||||||
ICUNIT_GOTO_EQUAL(len, JFFS_SHORT_ARRAY_LENGTH, len, EXIT3);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, filebuf, readbuf, EXIT3);
|
|
||||||
|
|
||||||
(void)strcpy_s(filebuf, sizeof(filebuf), "abcdeabcde1");
|
|
||||||
len = write(fd[1], filebuf, strlen(filebuf)); // 1 means second fd
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 11, len, EXIT3); // 11 means write len
|
|
||||||
|
|
||||||
len = read(fd[2], readbuf, JFFS_STANDARD_NAME_LENGTH); // 2 means third fd
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 11, len, EXIT3); // 11 means read len
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, filebuf, readbuf, EXIT3);
|
|
||||||
|
|
||||||
len = read(fd[0], readbuf, JFFS_STANDARD_NAME_LENGTH); // 0 means first fd
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 11, len, EXIT3); // 11 means read len
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, filebuf, readbuf, EXIT3);
|
|
||||||
|
|
||||||
(void)strcpy_s(filebuf, sizeof(filebuf), "fghjkfghjk12");
|
|
||||||
len = write(fd[0], filebuf, strlen(filebuf)); // 0 means first fd
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 12, len, EXIT3); // 12 means write len
|
|
||||||
|
|
||||||
(void)strcpy_s(filebuf, sizeof(filebuf), "qqqqqppppp12");
|
|
||||||
len = write(fd[2], filebuf, strlen(filebuf)); // 2 means third fd
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 12, len, EXIT3); // 12 means write len
|
|
||||||
|
|
||||||
len = read(fd[1], readbuf, JFFS_STANDARD_NAME_LENGTH); // 1 means second fd
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 12, len, EXIT3); // 12 means read len
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, "qqqqqppppp12", readbuf, EXIT3);
|
|
||||||
|
|
||||||
ret = close(fd[2]); // 2 means third fd
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT3);
|
|
||||||
|
|
||||||
ret = close(fd[1]); // 1 means second fd
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = close(fd[0]); // 0 means first fd
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = unlink(JFFS_PATH_NAME0);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
ret = unlink(pathname);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT3:
|
|
||||||
close(fd[2]); // 2 means third fd
|
|
||||||
EXIT2:
|
|
||||||
close(fd[1]); // 1 means second fd
|
|
||||||
EXIT1:
|
|
||||||
close(fd[0]); // 0 means first fd
|
|
||||||
EXIT:
|
|
||||||
remove(pathname);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs014(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_014", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,124 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 fd = -1;
|
|
||||||
INT32 fd1 = -1;
|
|
||||||
INT32 ret, len;
|
|
||||||
CHAR filebuf[20] = "1234567890";
|
|
||||||
CHAR readbuf[20] = { 0 };
|
|
||||||
CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME0 };
|
|
||||||
CHAR pathname2[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME0 };
|
|
||||||
CHAR pathname3[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME0 };
|
|
||||||
off_t off;
|
|
||||||
DIR *dir = NULL;
|
|
||||||
struct dirent *ptr = NULL;
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname2, sizeof(pathname2), "/jffs_1015.txt");
|
|
||||||
fd = creat(pathname2, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname3, sizeof(pathname3), "/1015_123.txt");
|
|
||||||
ret = rename(pathname2, pathname3);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
fd = open(pathname2, O_NONBLOCK | O_RDWR | O_EXCL, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(fd, -1, fd, EXIT);
|
|
||||||
|
|
||||||
fd = open(pathname3, O_NONBLOCK | O_RDWR | O_EXCL, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT3);
|
|
||||||
|
|
||||||
len = write(fd, filebuf, strlen(filebuf));
|
|
||||||
ICUNIT_GOTO_EQUAL(len, JFFS_SHORT_ARRAY_LENGTH, len, EXIT3);
|
|
||||||
|
|
||||||
fd1 = open(pathname3, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(fd1, -1, fd1, EXIT4);
|
|
||||||
|
|
||||||
dir = opendir(pathname1);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dir, NULL, dir, EXIT5);
|
|
||||||
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT5);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(ptr->d_name, "1015_123.txt", ptr->d_name, EXIT5);
|
|
||||||
|
|
||||||
ret = closedir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT5);
|
|
||||||
|
|
||||||
off = lseek(fd, 0, SEEK_SET);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(off, -1, off, EXIT3);
|
|
||||||
|
|
||||||
len = read(fd, readbuf, 20); // 20 means read len
|
|
||||||
ICUNIT_GOTO_EQUAL(len, JFFS_SHORT_ARRAY_LENGTH, len, EXIT3);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, "1234567890", readbuf, EXIT3);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT3);
|
|
||||||
|
|
||||||
ret = unlink(pathname3);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT3);
|
|
||||||
|
|
||||||
ret = rmdir(pathname1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT2);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT5:
|
|
||||||
if (dir) ret = closedir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT5);
|
|
||||||
EXIT4:
|
|
||||||
close(fd1);
|
|
||||||
EXIT3:
|
|
||||||
(void)strcat_s(pathname3, sizeof(pathname3), "/1015_123.txt");
|
|
||||||
close(fd);
|
|
||||||
remove(pathname3);
|
|
||||||
EXIT2:
|
|
||||||
rmdir(JFFS_PATH_NAME0);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT1:
|
|
||||||
(void)strcat_s(pathname2, sizeof(pathname2), "/jffs_1015.txt");
|
|
||||||
close(fd);
|
|
||||||
remove(pathname2);
|
|
||||||
EXIT:
|
|
||||||
rmdir(JFFS_PATH_NAME0);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs015(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_015", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,109 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 fd = -1;
|
|
||||||
INT32 fd1 = -1;
|
|
||||||
INT32 ret, len;
|
|
||||||
CHAR pathname[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME0 };
|
|
||||||
CHAR filebuf[20] = "1234567890";
|
|
||||||
CHAR readbuf[20] = { 0 };
|
|
||||||
off_t off;
|
|
||||||
|
|
||||||
fd = open(JFFS_PATH_NAME0, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT1);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname, sizeof(pathname), "123");
|
|
||||||
fd1 = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd1, -1, fd1, EXIT3);
|
|
||||||
|
|
||||||
len = write(fd1, filebuf, strlen(filebuf));
|
|
||||||
ICUNIT_GOTO_EQUAL(len, JFFS_SHORT_ARRAY_LENGTH, len, EXIT3);
|
|
||||||
|
|
||||||
off = lseek(fd1, 0, SEEK_SET);
|
|
||||||
ICUNIT_GOTO_EQUAL(off, 0, off, EXIT3);
|
|
||||||
len = read(fd1, readbuf, 20); // 20 means read len
|
|
||||||
ICUNIT_GOTO_EQUAL(len, JFFS_SHORT_ARRAY_LENGTH, len, EXIT3);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, filebuf, readbuf, EXIT3);
|
|
||||||
|
|
||||||
ret = close(fd1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT3);
|
|
||||||
|
|
||||||
ret = rename(JFFS_PATH_NAME0, pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
|
|
||||||
fd1 = open(pathname, O_NONBLOCK | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd1, -1, fd1, EXIT3);
|
|
||||||
|
|
||||||
len = read(fd1, readbuf, 20); // 20 means read len
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 0, len, EXIT3);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT3);
|
|
||||||
|
|
||||||
ret = unlink(JFFS_PATH_NAME0);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT3);
|
|
||||||
|
|
||||||
ret = close(fd1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT5);
|
|
||||||
|
|
||||||
ret = unlink(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT4);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
|
|
||||||
EXIT5:
|
|
||||||
close(fd1);
|
|
||||||
EXIT4:
|
|
||||||
JffsStrcat2(pathname, "123", strlen(pathname));
|
|
||||||
remove(pathname);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
|
|
||||||
EXIT3:
|
|
||||||
close(fd1);
|
|
||||||
EXIT2:
|
|
||||||
JffsStrcat2(pathname, "123", strlen(pathname));
|
|
||||||
remove(pathname);
|
|
||||||
EXIT1:
|
|
||||||
close(fd);
|
|
||||||
EXIT:
|
|
||||||
JffsStrcat2(pathname, JFFS_PATH_NAME0, strlen(pathname));
|
|
||||||
remove(pathname);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs016(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_016", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,79 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret;
|
|
||||||
CHAR pathname[50] = { JFFS_PATH_NAME0 };
|
|
||||||
CHAR pathname1[50] = { JFFS_PATH_NAME0 };
|
|
||||||
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname1, sizeof(pathname1), "/0test");
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname, sizeof(pathname), "/dirfiles");
|
|
||||||
|
|
||||||
ret = rename(pathname1, pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT2);
|
|
||||||
ret = rmdir(pathname1);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, 0, ret, EXIT2); // ²»´æÔÚ
|
|
||||||
|
|
||||||
ret = rmdir(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = chdir(JFFS_MAIN_DIR0);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
ret = rmdir(JFFS_PATH_NAME0);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
|
|
||||||
EXIT2:
|
|
||||||
JffsStrcat2(pathname, "/dirfiles", strlen(pathname));
|
|
||||||
remove(pathname);
|
|
||||||
EXIT1:
|
|
||||||
JffsStrcat2(pathname1, "/0test", strlen(pathname1));
|
|
||||||
remove(pathname1);
|
|
||||||
EXIT:
|
|
||||||
remove(JFFS_PATH_NAME0);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs017(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_017", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,80 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret;
|
|
||||||
CHAR pathname[50] = { JFFS_PATH_NAME0 };
|
|
||||||
CHAR pathname1[50] = { JFFS_PATH_NAME0 };
|
|
||||||
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname1, sizeof(pathname1), "/0test");
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname, sizeof(pathname), "/dirfiles");
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = rename(pathname1, pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT2);
|
|
||||||
ret = rmdir(pathname1);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, 0, ret, EXIT2); // ²»´æÔÚ
|
|
||||||
|
|
||||||
ret = rmdir(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = chdir(JFFS_MAIN_DIR0);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
ret = rmdir(JFFS_PATH_NAME0);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT2:
|
|
||||||
JffsStrcat2(pathname, "/dirfiles", strlen(pathname));
|
|
||||||
remove(pathname);
|
|
||||||
EXIT1:
|
|
||||||
JffsStrcat2(pathname1, "/0test", strlen(pathname1));
|
|
||||||
remove(pathname1);
|
|
||||||
EXIT:
|
|
||||||
remove(JFFS_PATH_NAME0);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs018(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_018", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,115 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 fd = -1;
|
|
||||||
INT32 ret, len;
|
|
||||||
CHAR pathname1[50] = { JFFS_PATH_NAME0 };
|
|
||||||
CHAR pathname2[50] = { JFFS_PATH_NAME0 };
|
|
||||||
CHAR pathname3[50] = { JFFS_PATH_NAME0 };
|
|
||||||
CHAR filebuf[20] = "1234567890";
|
|
||||||
|
|
||||||
ret = chdir(JFFS_MAIN_DIR0);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
ret = mkdir(pathname2, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname2, sizeof(pathname2), "/0test");
|
|
||||||
ret = mkdir(pathname2, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname1, sizeof(pathname1), "/dirfiles");
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT2);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname3, sizeof(pathname3), "/dirfiles/files");
|
|
||||||
fd = open(pathname3, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT4);
|
|
||||||
|
|
||||||
printf("pathname1: %s pathname2: %s pathname3: %s\n", pathname1, pathname2, pathname3);
|
|
||||||
|
|
||||||
len = write(fd, filebuf, strlen(filebuf));
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 10, len, EXIT4); // 10 means file name length
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT4);
|
|
||||||
|
|
||||||
ret = rename(pathname2, pathname1);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, 0, ret, EXIT5);
|
|
||||||
|
|
||||||
ret = rename(pathname1, pathname2);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT5);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname3, "/0test/files", sizeof(pathname3));
|
|
||||||
ret = unlink(pathname3);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT5);
|
|
||||||
|
|
||||||
ret = rmdir(pathname2);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = rmdir(pathname1);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, 0, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = chdir(JFFS_MAIN_DIR0);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
ret = rmdir(JFFS_PATH_NAME0);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT5:
|
|
||||||
JffsStrcat2(pathname3, "/0test/files", strlen(pathname3));
|
|
||||||
remove(pathname3);
|
|
||||||
EXIT4:
|
|
||||||
close(fd);
|
|
||||||
EXIT3:
|
|
||||||
JffsStrcat2(pathname3, "/dirfiles/files", strlen(pathname3));
|
|
||||||
remove(pathname3);
|
|
||||||
EXIT2:
|
|
||||||
JffsStrcat2(pathname2, "/dirfiles", strlen(pathname2));
|
|
||||||
remove(pathname2);
|
|
||||||
EXIT1:
|
|
||||||
JffsStrcat2(pathname1, "/0test", strlen(pathname1));
|
|
||||||
remove(pathname1);
|
|
||||||
EXIT:
|
|
||||||
remove(JFFS_PATH_NAME0);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
VOID ItFsJffs019(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_019", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,92 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR pathname[50] = { JFFS_PATH_NAME0 };
|
|
||||||
CHAR pathname1[20] = { JFFS_PATH_NAME0 };
|
|
||||||
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname1, sizeof(pathname1), "/dir");
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname, sizeof(pathname), "/files");
|
|
||||||
fd = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT3);
|
|
||||||
|
|
||||||
ret = rename(pathname1, pathname);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
|
|
||||||
ret = rename(pathname, pathname1);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT3);
|
|
||||||
|
|
||||||
ret = unlink(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = rmdir(pathname1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = chdir(JFFS_MAIN_DIR0);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
ret = rmdir(JFFS_PATH_NAME0);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
|
|
||||||
EXIT3:
|
|
||||||
close(fd);
|
|
||||||
EXIT2:
|
|
||||||
JffsStrcat2(pathname1, "/files", strlen(pathname1));
|
|
||||||
remove(pathname1);
|
|
||||||
EXIT1:
|
|
||||||
JffsStrcat2(pathname1, "dir1", strlen(pathname1));
|
|
||||||
remove(pathname1);
|
|
||||||
EXIT:
|
|
||||||
remove(JFFS_PATH_NAME0);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
VOID ItFsJffs020(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_020", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,97 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 fd1 = -1;
|
|
||||||
INT32 fd2 = -1;
|
|
||||||
INT32 ret;
|
|
||||||
CHAR pathname1[50] = { JFFS_PATH_NAME0 };
|
|
||||||
CHAR bufdir1[50] = { JFFS_PATH_NAME0 };
|
|
||||||
CHAR bufdir2[50] = { JFFS_PATH_NAME0 };
|
|
||||||
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname1, sizeof(pathname1), "/dir");
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
(void)strcat_s(bufdir1, sizeof(bufdir1), "/dir/dirfile1");
|
|
||||||
ret = mkdir(bufdir1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT2);
|
|
||||||
|
|
||||||
(void)strcat_s(bufdir2, sizeof(bufdir2), "/dir/dirfile1/dirfile2");
|
|
||||||
ret = mkdir(bufdir2, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
|
|
||||||
ret = rename(bufdir1, bufdir2);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
|
|
||||||
ret = rename(bufdir2, bufdir1);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
ret = rmdir(bufdir1);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
|
|
||||||
ret = rmdir(bufdir2);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
|
|
||||||
ret = rmdir(bufdir1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = rmdir(pathname1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = rmdir(JFFS_PATH_NAME0);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
|
|
||||||
EXIT3:
|
|
||||||
JffsStrcat2(pathname1, "/dir/dirfile1/dirfile2", strlen(pathname1));
|
|
||||||
remove(pathname1);
|
|
||||||
EXIT2:
|
|
||||||
JffsStrcat2(pathname1, "/dir/dirfile1", strlen(pathname1));
|
|
||||||
remove(pathname1);
|
|
||||||
EXIT1:
|
|
||||||
JffsStrcat2(pathname1, "dir", strlen(pathname1));
|
|
||||||
remove(pathname1);
|
|
||||||
EXIT:
|
|
||||||
remove(JFFS_PATH_NAME0);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs023(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_023", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,91 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 fd1 = -1;
|
|
||||||
INT32 ret;
|
|
||||||
CHAR pathname1[50] = { JFFS_PATH_NAME0 };
|
|
||||||
CHAR buffile1[50] = { JFFS_PATH_NAME0 };
|
|
||||||
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname1, sizeof(pathname1), "/dir");
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = rename(pathname1, pathname1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
(void)strcat_s(buffile1, sizeof(buffile1), "/dir/file1");
|
|
||||||
fd1 = open(buffile1, O_NONBLOCK | O_CREAT | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd1, -1, fd1, EXIT3);
|
|
||||||
|
|
||||||
ret = close(fd1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT3);
|
|
||||||
|
|
||||||
ret = rename(buffile1, buffile1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
|
|
||||||
ret = unlink(buffile1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = rmdir(pathname1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = chdir(JFFS_MAIN_DIR0);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
ret = rmdir(JFFS_PATH_NAME0);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
|
|
||||||
EXIT3:
|
|
||||||
close(fd1);
|
|
||||||
EXIT2:
|
|
||||||
JffsStrcat2(pathname1, "/dir/file1", strlen(pathname1));
|
|
||||||
remove(pathname1);
|
|
||||||
EXIT1:
|
|
||||||
JffsStrcat2(pathname1, "dir", strlen(pathname1));
|
|
||||||
remove(pathname1);
|
|
||||||
EXIT:
|
|
||||||
remove(JFFS_PATH_NAME0);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs024(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_024", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,88 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret;
|
|
||||||
CHAR pathname1[50] = { JFFS_PATH_NAME0 };
|
|
||||||
CHAR bufdir1[50] = { JFFS_PATH_NAME0 };
|
|
||||||
CHAR bufdir2[50] = { JFFS_PATH_NAME0 };
|
|
||||||
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname1, sizeof(pathname1), "/dir");
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
(void)strcat_s(bufdir1, sizeof(bufdir1), "/dir/dirfile1");
|
|
||||||
ret = mkdir(bufdir1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT2);
|
|
||||||
|
|
||||||
(void)strcat_s(bufdir2, sizeof(bufdir2), "/dir/dirfile1/dirfile2");
|
|
||||||
ret = rename(bufdir2, bufdir1);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
|
|
||||||
ret = rmdir(bufdir1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = rmdir(bufdir2);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
|
|
||||||
ret = rmdir(pathname1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = rmdir(JFFS_PATH_NAME0);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
|
|
||||||
EXIT3:
|
|
||||||
JffsStrcat2(pathname1, "/dir/dirfile1/dirfile2", strlen(pathname1));
|
|
||||||
remove(pathname1);
|
|
||||||
goto EXIT1;
|
|
||||||
EXIT2:
|
|
||||||
JffsStrcat2(pathname1, "/dir/dirfile1", strlen(pathname1));
|
|
||||||
remove(pathname1);
|
|
||||||
EXIT1:
|
|
||||||
JffsStrcat2(pathname1, "dir", strlen(pathname1));
|
|
||||||
remove(pathname1);
|
|
||||||
EXIT:
|
|
||||||
remove(JFFS_PATH_NAME0);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs025(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_025", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,103 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret, len;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR pathname1[50] = { JFFS_PATH_NAME0 };
|
|
||||||
CHAR buffile[50] = { JFFS_PATH_NAME0 };
|
|
||||||
struct stat buf1 = { 0 };
|
|
||||||
struct stat buf2 = { 0 };
|
|
||||||
struct stat buf3 = { 0 };
|
|
||||||
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname1, sizeof(pathname1), "/dir");
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
(void)strcat_s(buffile, sizeof(buffile), "/dir/files");
|
|
||||||
fd = open(buffile, O_NONBLOCK | O_CREAT | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT3);
|
|
||||||
|
|
||||||
len = write(fd, "012345678901234567890123456789", 30); // 30 means write len
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 30, len, EXIT3); // 30 means write len
|
|
||||||
|
|
||||||
ret = stat(buffile, &buf1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
JffsStatPrintf(buf1);
|
|
||||||
|
|
||||||
ret = fstat(fd, &buf2);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
JffsStatPrintf(buf2);
|
|
||||||
|
|
||||||
ICUNIT_GOTO_EQUAL(buf1.st_blocks, buf2.st_blocks, buf1.st_blocks, EXIT3);
|
|
||||||
ICUNIT_GOTO_EQUAL(buf1.st_size, buf2.st_size, buf1.st_size, EXIT3);
|
|
||||||
ICUNIT_GOTO_EQUAL(buf1.st_blksize, buf2.st_blksize, buf1.st_blksize, EXIT3);
|
|
||||||
ICUNIT_GOTO_EQUAL(buf1.st_ino, buf2.st_ino, buf1.st_ino, EXIT3);
|
|
||||||
ICUNIT_GOTO_EQUAL(buf1.st_mode, buf2.st_mode, buf1.st_mode, EXIT3);
|
|
||||||
ICUNIT_GOTO_EQUAL(buf1.st_mtim.tv_nsec, buf2.st_mtim.tv_nsec, buf1.st_mtim.tv_nsec, EXIT3);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT3);
|
|
||||||
|
|
||||||
ret = unlink(buffile);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = rmdir(pathname1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = rmdir(JFFS_PATH_NAME0);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT3:
|
|
||||||
close(fd);
|
|
||||||
EXIT2:
|
|
||||||
JffsStrcat2(pathname1, "/dir/files", strlen(pathname1));
|
|
||||||
remove(pathname1);
|
|
||||||
EXIT1:
|
|
||||||
JffsStrcat2(pathname1, "dir", strlen(pathname1));
|
|
||||||
remove(pathname1);
|
|
||||||
EXIT:
|
|
||||||
remove(JFFS_PATH_NAME0);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs028(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_028", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,107 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret, len;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR pathname1[50] = { JFFS_PATH_NAME0 };
|
|
||||||
CHAR buffile[50] = { JFFS_PATH_NAME0 };
|
|
||||||
struct stat buf1 = { 0 };
|
|
||||||
struct stat buf2 = { 0 };
|
|
||||||
struct stat buf3 = { 0 };
|
|
||||||
INT32 n = 103;
|
|
||||||
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname1, sizeof(pathname1), "/dir");
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
(void)strcat_s(buffile, sizeof(buffile), "/dir/files");
|
|
||||||
fd = open(buffile, O_NONBLOCK | O_CREAT | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT3);
|
|
||||||
|
|
||||||
while (n--) {
|
|
||||||
len = write(fd, "0123456789012345678901234567890123456789", 40); // 40 means write len
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 40, len, EXIT3); // 40 means write len
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = stat(buffile, &buf1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
JffsStatPrintf(buf1);
|
|
||||||
|
|
||||||
ret = fstat(fd, &buf2);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
JffsStatPrintf(buf2);
|
|
||||||
|
|
||||||
ICUNIT_GOTO_EQUAL(buf1.st_blocks, buf2.st_blocks, buf1.st_blocks, EXIT3);
|
|
||||||
ICUNIT_GOTO_EQUAL(buf1.st_size, buf2.st_size, buf1.st_size, EXIT3);
|
|
||||||
ICUNIT_GOTO_EQUAL(buf1.st_blksize, buf2.st_blksize, buf1.st_blksize, EXIT3);
|
|
||||||
ICUNIT_GOTO_EQUAL(buf1.st_ino, buf2.st_ino, buf1.st_ino, EXIT3);
|
|
||||||
ICUNIT_GOTO_EQUAL(buf1.st_mode, buf2.st_mode, buf1.st_mode, EXIT3);
|
|
||||||
ICUNIT_GOTO_EQUAL(buf1.st_mtim.tv_nsec, buf2.st_mtim.tv_nsec, buf1.st_mtim.tv_nsec, EXIT3);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT3);
|
|
||||||
|
|
||||||
ret = unlink(buffile);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = rmdir(pathname1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = rmdir(JFFS_PATH_NAME0);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
|
|
||||||
EXIT3:
|
|
||||||
close(fd);
|
|
||||||
EXIT2:
|
|
||||||
JffsStrcat2(pathname1, "/dir/files", strlen(pathname1));
|
|
||||||
remove(pathname1);
|
|
||||||
EXIT1:
|
|
||||||
JffsStrcat2(pathname1, "dir", strlen(pathname1));
|
|
||||||
remove(pathname1);
|
|
||||||
EXIT:
|
|
||||||
remove(JFFS_PATH_NAME0);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs029(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_029", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,103 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret, len;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR pathname1[50] = { JFFS_PATH_NAME0 };
|
|
||||||
CHAR buffile[50] = { JFFS_PATH_NAME0 };
|
|
||||||
struct stat buf1 = { 0 };
|
|
||||||
struct stat buf2 = { 0 };
|
|
||||||
struct stat buf3 = { 0 };
|
|
||||||
INT32 n = 256;
|
|
||||||
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname1, sizeof(pathname1), "/dir");
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
(void)strcat_s(buffile, sizeof(buffile), "/dir/files");
|
|
||||||
fd = open(buffile, O_NONBLOCK | O_CREAT | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT3);
|
|
||||||
|
|
||||||
while (n--) {
|
|
||||||
len = write(fd, "01234567890123456789012345", 16); // 16 means write len
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 16, len, EXIT3); // 16 means write len
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = stat(buffile, &buf1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
JffsStatPrintf(buf1);
|
|
||||||
|
|
||||||
ret = fstat(fd, &buf2);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
JffsStatPrintf(buf2);
|
|
||||||
|
|
||||||
ICUNIT_GOTO_EQUAL(buf1.st_size, buf2.st_size, buf1.st_size, EXIT3);
|
|
||||||
ICUNIT_GOTO_EQUAL(buf1.st_blksize, buf2.st_blksize, buf1.st_blksize, EXIT3);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT3);
|
|
||||||
|
|
||||||
ret = unlink(buffile);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = rmdir(pathname1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = rmdir(JFFS_PATH_NAME0);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
|
|
||||||
EXIT3:
|
|
||||||
close(fd);
|
|
||||||
EXIT2:
|
|
||||||
JffsStrcat2(pathname1, "/dir/files", strlen(pathname1));
|
|
||||||
remove(pathname1);
|
|
||||||
EXIT1:
|
|
||||||
JffsStrcat2(pathname1, "dir", strlen(pathname1));
|
|
||||||
remove(pathname1);
|
|
||||||
EXIT:
|
|
||||||
remove(JFFS_PATH_NAME0);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs030(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_030", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,91 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret, len;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR pathname1[50] = { JFFS_PATH_NAME0 };
|
|
||||||
CHAR buffile[50] = { JFFS_PATH_NAME0 };
|
|
||||||
struct stat buf1 = { 0 };
|
|
||||||
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname1, sizeof(pathname1), "/dir");
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
(void)strcat_s(buffile, sizeof(buffile), "/dir/files");
|
|
||||||
fd = open(buffile, O_NONBLOCK | O_CREAT | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT3);
|
|
||||||
|
|
||||||
len = write(fd, "01234567890123456789012345", 16); // 16 means write len
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 16, len, EXIT3); // 16 means write len
|
|
||||||
|
|
||||||
ret = stat(pathname1, &buf1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
JffsStatPrintf(buf1);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT3);
|
|
||||||
|
|
||||||
ret = unlink(buffile);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = rmdir(pathname1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = rmdir(JFFS_PATH_NAME0);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
|
|
||||||
EXIT3:
|
|
||||||
close(fd);
|
|
||||||
EXIT2:
|
|
||||||
JffsStrcat2(pathname1, "/dir/files", strlen(pathname1));
|
|
||||||
remove(pathname1);
|
|
||||||
EXIT1:
|
|
||||||
JffsStrcat2(pathname1, "dir", strlen(pathname1));
|
|
||||||
remove(pathname1);
|
|
||||||
EXIT:
|
|
||||||
remove(JFFS_PATH_NAME0);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs031(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_031", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,117 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret, len;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR pathname1[50] = { JFFS_PATH_NAME0 };
|
|
||||||
CHAR buffile[50] = { JFFS_PATH_NAME0 };
|
|
||||||
struct stat buf1 = { 0 };
|
|
||||||
CHAR readbuf[20] = { 0 };
|
|
||||||
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname1, sizeof(pathname1), "/dir");
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
(void)strcat_s(buffile, sizeof(buffile), "/dir/files");
|
|
||||||
fd = open(buffile, O_NONBLOCK | O_CREAT | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT3);
|
|
||||||
|
|
||||||
ret = fstat(fd, &buf1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
JffsStatPrintf(buf1);
|
|
||||||
|
|
||||||
ret = stat(buffile, &buf1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
JffsStatPrintf(buf1);
|
|
||||||
|
|
||||||
LosTaskDelay(20); // 20 means timedelay length
|
|
||||||
len = read(fd, readbuf, 20); // 20 means read length
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 0, len, EXIT3);
|
|
||||||
|
|
||||||
ret = fstat(fd, &buf1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
JffsStatPrintf(buf1);
|
|
||||||
|
|
||||||
ret = stat(buffile, &buf1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
JffsStatPrintf(buf1);
|
|
||||||
|
|
||||||
LosTaskDelay(20); // 20 means timedelay length
|
|
||||||
len = write(fd, "01234567890123456789012345", 16); // 16 means write len
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 16, len, EXIT3); // 16 means write len
|
|
||||||
|
|
||||||
ret = fstat(fd, &buf1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
JffsStatPrintf(buf1);
|
|
||||||
|
|
||||||
ret = stat(buffile, &buf1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
JffsStatPrintf(buf1);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT3);
|
|
||||||
|
|
||||||
ret = unlink(buffile);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = rmdir(pathname1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = rmdir(JFFS_PATH_NAME0);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
|
|
||||||
EXIT3:
|
|
||||||
close(fd);
|
|
||||||
EXIT2:
|
|
||||||
JffsStrcat2(pathname1, "/dir/files", strlen(pathname1));
|
|
||||||
remove(pathname1);
|
|
||||||
EXIT1:
|
|
||||||
JffsStrcat2(pathname1, "dir", strlen(pathname1));
|
|
||||||
remove(pathname1);
|
|
||||||
EXIT:
|
|
||||||
remove(JFFS_PATH_NAME0);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
VOID ItFsJffs032(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_032", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,106 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret, len;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR pathname1[50] = { JFFS_PATH_NAME0 };
|
|
||||||
CHAR buffile[50] = { JFFS_PATH_NAME0 };
|
|
||||||
struct stat buf1 = { 0 };
|
|
||||||
CHAR readbuf[20] = { 0 };
|
|
||||||
|
|
||||||
LosTaskDelay(10); // 10 means delay time length
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname1, sizeof(pathname1), "/dir");
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
LosTaskDelay(10); // 10 means delay time length
|
|
||||||
(void)strcat_s(buffile, sizeof(buffile), "/dir/files");
|
|
||||||
fd = open(buffile, O_NONBLOCK | O_CREAT | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT3);
|
|
||||||
|
|
||||||
ret = stat(pathname1, &buf1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
JffsStatPrintf(buf1);
|
|
||||||
|
|
||||||
LosTaskDelay(10); // 10 means delay time length
|
|
||||||
len = read(fd, readbuf, 20); // 20 means read len
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 0, len, EXIT3);
|
|
||||||
|
|
||||||
ret = stat(pathname1, &buf1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
JffsStatPrintf(buf1);
|
|
||||||
|
|
||||||
LosTaskDelay(10); // 10 means delay time length
|
|
||||||
len = write(fd, "01234567890123456789012345", 16); // 16 means write len
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 16, len, EXIT3); // 16 means write len
|
|
||||||
|
|
||||||
ret = stat(pathname1, &buf1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
JffsStatPrintf(buf1);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT3);
|
|
||||||
|
|
||||||
ret = unlink(buffile);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = rmdir(pathname1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = rmdir(JFFS_PATH_NAME0);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
|
|
||||||
EXIT3:
|
|
||||||
close(fd);
|
|
||||||
EXIT2:
|
|
||||||
JffsStrcat2(pathname1, "/dir/files", strlen(pathname1));
|
|
||||||
remove(pathname1);
|
|
||||||
EXIT1:
|
|
||||||
JffsStrcat2(pathname1, "dir", strlen(pathname1));
|
|
||||||
remove(pathname1);
|
|
||||||
EXIT:
|
|
||||||
remove(JFFS_PATH_NAME0);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs033(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_033", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,104 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 fd = -1;
|
|
||||||
INT32 fd1 = -1;
|
|
||||||
INT32 fd2 = -1;
|
|
||||||
INT32 ret, len;
|
|
||||||
CHAR filebuf[20] = "1234567890";
|
|
||||||
CHAR readbuf[50] = { 0 };
|
|
||||||
CHAR pathname[50] = "/storage/liteos";
|
|
||||||
CHAR pathname1[50] = "/storage/liteosliteosli";
|
|
||||||
CHAR pathname2[50] = "/storage/liteosliteoslit";
|
|
||||||
CHAR pathname3[50] = "/storage/liteos";
|
|
||||||
CHAR pathname4[50] = "/storage/liteosliteosli";
|
|
||||||
CHAR pathname5[50] = "/jffs/liteosliteoslit";
|
|
||||||
off_t off;
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
ret = rmdir(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
ret = rmdir(pathname1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = mkdir(pathname2, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = rmdir(pathname2);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT2);
|
|
||||||
|
|
||||||
fd = open(pathname3, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT3);
|
|
||||||
JffsDeletefile(fd, pathname3);
|
|
||||||
|
|
||||||
fd = open(pathname4, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT4);
|
|
||||||
JffsDeletefile(fd, pathname4);
|
|
||||||
|
|
||||||
fd = open(pathname5, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(fd, -1, fd, EXIT5);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT5:
|
|
||||||
close(fd);
|
|
||||||
remove(pathname5);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT4:
|
|
||||||
close(fd);
|
|
||||||
remove(pathname4);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT3:
|
|
||||||
close(fd);
|
|
||||||
remove(pathname3);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT2:
|
|
||||||
remove(pathname2);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT1:
|
|
||||||
remove(pathname1);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT:
|
|
||||||
remove(pathname);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs037(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_037", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,79 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 fd = -1;
|
|
||||||
INT32 ret, len;
|
|
||||||
CHAR filebuf[20] = "abcdeabcde";
|
|
||||||
CHAR readbuf[JFFS_STANDARD_NAME_LENGTH] = "liteos";
|
|
||||||
CHAR pathname[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME0 };
|
|
||||||
off_t off;
|
|
||||||
struct stat buf1;
|
|
||||||
|
|
||||||
fd = creat(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT1);
|
|
||||||
|
|
||||||
len = read(fd, readbuf, JFFS_STANDARD_NAME_LENGTH);
|
|
||||||
ICUNIT_GOTO_EQUAL(len, -1, len, EXIT1);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, "liteos", readbuf, EXIT1);
|
|
||||||
|
|
||||||
ret = stat(pathname, &buf1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
ICUNIT_GOTO_EQUAL(buf1.st_size, 0, buf1.st_size, EXIT1);
|
|
||||||
|
|
||||||
len = write(fd, filebuf, strlen(filebuf));
|
|
||||||
ICUNIT_GOTO_EQUAL(len, JFFS_SHORT_ARRAY_LENGTH, len, EXIT1);
|
|
||||||
|
|
||||||
len = read(fd, readbuf, JFFS_STANDARD_NAME_LENGTH);
|
|
||||||
ICUNIT_GOTO_EQUAL(len, -1, len, EXIT1);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = unlink(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT1:
|
|
||||||
close(fd);
|
|
||||||
EXIT:
|
|
||||||
remove(pathname);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs038(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_038", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,67 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 fd = -1;
|
|
||||||
INT32 fd1 = -1;
|
|
||||||
INT32 ret, len;
|
|
||||||
CHAR filebuf[20] = "1234567890";
|
|
||||||
CHAR readbuf[50] = " ";
|
|
||||||
CHAR pathname[50] = { JFFS_PATH_NAME0 };
|
|
||||||
|
|
||||||
fd = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT1);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = unlink(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT1:
|
|
||||||
close(fd);
|
|
||||||
EXIT:
|
|
||||||
remove(JFFS_PATH_NAME0);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs039(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_039", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,101 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 fd = -1;
|
|
||||||
INT32 ret, i;
|
|
||||||
CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME0 };
|
|
||||||
CHAR pathname2[JFFS_STANDARD_NAME_LENGTH][JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME0, };
|
|
||||||
CHAR bufname[JFFS_SHORT_ARRAY_LENGTH] = "";
|
|
||||||
DIR *dir = NULL;
|
|
||||||
DIR *dir1[JFFS_STANDARD_NAME_LENGTH] = { NULL, };
|
|
||||||
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
dir = opendir(pathname1);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dir, NULL, dir, EXIT1);
|
|
||||||
|
|
||||||
for (i = 0; i < JFFS_STANDARD_NAME_LENGTH; i++) {
|
|
||||||
(void)memset_s(bufname, JFFS_SHORT_ARRAY_LENGTH, 0, JFFS_SHORT_ARRAY_LENGTH);
|
|
||||||
(void)memset_s(pathname2[i], JFFS_SHORT_ARRAY_LENGTH, 0, JFFS_SHORT_ARRAY_LENGTH);
|
|
||||||
(void)snprintf_s(bufname, JFFS_SHORT_ARRAY_LENGTH - 1, JFFS_SHORT_ARRAY_LENGTH, "/test%d", i);
|
|
||||||
JffsStrcat2(pathname2[i], bufname, strlen(bufname));
|
|
||||||
|
|
||||||
ret = mkdir(pathname2[i], HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT2);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < JFFS_STANDARD_NAME_LENGTH; i++) {
|
|
||||||
dir1[i] = opendir(pathname2[i]);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dir1[i], NULL, dir1[i], EXIT3);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < JFFS_STANDARD_NAME_LENGTH; i++) {
|
|
||||||
ret = closedir(dir1[i]);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT3);
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = closedir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT2);
|
|
||||||
|
|
||||||
for (i = 0; i < JFFS_STANDARD_NAME_LENGTH; i++) {
|
|
||||||
ret = remove(pathname2[i]);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT2);
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = rmdir(pathname1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT3:
|
|
||||||
for (i = 0; i < JFFS_STANDARD_NAME_LENGTH; i++) {
|
|
||||||
closedir(dir1[i]);
|
|
||||||
}
|
|
||||||
EXIT2:
|
|
||||||
for (i = 0; i < JFFS_STANDARD_NAME_LENGTH; i++) {
|
|
||||||
remove(pathname2[i]);
|
|
||||||
}
|
|
||||||
EXIT1:
|
|
||||||
closedir(dir);
|
|
||||||
EXIT:
|
|
||||||
remove(pathname1);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs040(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_040", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL3, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,90 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 fd = -1;
|
|
||||||
INT32 fd1 = -1;
|
|
||||||
INT32 ret, len;
|
|
||||||
CHAR filebuf[20] = "1234567890";
|
|
||||||
CHAR readbuf[JFFS_STANDARD_NAME_LENGTH] = { 0 };
|
|
||||||
CHAR pathname[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME0 };
|
|
||||||
off_t off;
|
|
||||||
|
|
||||||
fd = open(pathname, O_NONBLOCK | O_CREAT | O_RDONLY, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT1);
|
|
||||||
|
|
||||||
len = write(fd, filebuf, strlen(filebuf));
|
|
||||||
ICUNIT_GOTO_EQUAL(len, -1, len, EXIT1);
|
|
||||||
|
|
||||||
len = read(fd, readbuf, JFFS_STANDARD_NAME_LENGTH);
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 0, len, EXIT1);
|
|
||||||
ICUNIT_GOTO_EQUAL(readbuf[0], 0, readbuf[0], EXIT1);
|
|
||||||
|
|
||||||
fd1 = open(pathname, O_NONBLOCK | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT2);
|
|
||||||
|
|
||||||
len = write(fd1, filebuf, strlen(filebuf));
|
|
||||||
ICUNIT_GOTO_EQUAL(len, JFFS_SHORT_ARRAY_LENGTH, len, EXIT2);
|
|
||||||
|
|
||||||
off = lseek(fd1, 0, SEEK_SET);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(off, -1, off, EXIT2);
|
|
||||||
|
|
||||||
len = read(fd1, readbuf, JFFS_STANDARD_NAME_LENGTH);
|
|
||||||
ICUNIT_GOTO_EQUAL(len, JFFS_SHORT_ARRAY_LENGTH, len, EXIT2);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, "1234567890", readbuf, EXIT2);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = close(fd1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = unlink(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT2:
|
|
||||||
close(fd1);
|
|
||||||
EXIT1:
|
|
||||||
close(fd);
|
|
||||||
EXIT:
|
|
||||||
remove(JFFS_PATH_NAME0);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs041(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_041", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,84 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 fd = -1;
|
|
||||||
INT32 fd1 = -1;
|
|
||||||
INT32 ret, len;
|
|
||||||
CHAR filebuf[20] = "1234567890";
|
|
||||||
CHAR readbuf[JFFS_STANDARD_NAME_LENGTH] = "";
|
|
||||||
CHAR pathname[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME0 };
|
|
||||||
off_t off;
|
|
||||||
|
|
||||||
fd = open(pathname, O_NONBLOCK | O_CREAT | O_WRONLY, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT1);
|
|
||||||
|
|
||||||
len = write(fd, filebuf, strlen(filebuf));
|
|
||||||
ICUNIT_GOTO_EQUAL(len, JFFS_SHORT_ARRAY_LENGTH, len, EXIT1);
|
|
||||||
|
|
||||||
len = read(fd, readbuf, JFFS_STANDARD_NAME_LENGTH);
|
|
||||||
ICUNIT_GOTO_EQUAL(len, -1, len, EXIT1);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, "", readbuf, EXIT1);
|
|
||||||
|
|
||||||
fd1 = open(pathname, O_NONBLOCK | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd1, -1, fd1, EXIT2);
|
|
||||||
|
|
||||||
len = read(fd1, readbuf, JFFS_STANDARD_NAME_LENGTH);
|
|
||||||
ICUNIT_GOTO_EQUAL(len, JFFS_SHORT_ARRAY_LENGTH, len, EXIT2);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, "1234567890", readbuf, EXIT2);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = close(fd1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = unlink(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT2:
|
|
||||||
close(fd1);
|
|
||||||
EXIT1:
|
|
||||||
close(fd);
|
|
||||||
EXIT:
|
|
||||||
remove(JFFS_PATH_NAME0);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs042(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_042", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,53 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR pathname[50] = { JFFS_PATH_NAME0 };
|
|
||||||
|
|
||||||
fd = open(pathname, O_NONBLOCK | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(fd, -1, fd, EXIT1);
|
|
||||||
|
|
||||||
EXIT1:
|
|
||||||
close(fd);
|
|
||||||
EXIT:
|
|
||||||
remove(pathname);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs043(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_043", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,59 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 fd = -1;
|
|
||||||
INT32 fd1 = -1;
|
|
||||||
CHAR pathname[50] = { JFFS_PATH_NAME0 };
|
|
||||||
|
|
||||||
fd = open(pathname, O_NONBLOCK | O_CREAT | O_WRONLY, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT2);
|
|
||||||
|
|
||||||
fd1 = open(pathname, O_NONBLOCK | O_CREAT | O_EXCL | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(fd1, -1, fd1, EXIT2);
|
|
||||||
|
|
||||||
EXIT2:
|
|
||||||
close(fd1);
|
|
||||||
EXIT1:
|
|
||||||
close(fd);
|
|
||||||
EXIT:
|
|
||||||
remove(pathname);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs044(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_044", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,97 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 fd = -1;
|
|
||||||
INT32 fd1 = -1;
|
|
||||||
INT32 fd2 = -1;
|
|
||||||
INT32 ret, len;
|
|
||||||
CHAR filebuf[20] = "1234567890";
|
|
||||||
CHAR readbuf[JFFS_STANDARD_NAME_LENGTH] = { 0 };
|
|
||||||
CHAR pathname[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME0 };
|
|
||||||
off_t off;
|
|
||||||
|
|
||||||
fd = open(pathname, O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT1);
|
|
||||||
|
|
||||||
fd2 = open(pathname, O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(fd2, -1, fd2, EXIT2);
|
|
||||||
|
|
||||||
len = write(fd, filebuf, strlen(filebuf));
|
|
||||||
ICUNIT_GOTO_EQUAL(len, JFFS_SHORT_ARRAY_LENGTH, len, EXIT2);
|
|
||||||
|
|
||||||
fd1 = open(pathname, O_APPEND | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd1, -1, fd1, EXIT3);
|
|
||||||
|
|
||||||
len = read(fd1, readbuf, JFFS_STANDARD_NAME_LENGTH);
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 10, len, EXIT3); // 10 means read size
|
|
||||||
|
|
||||||
len = write(fd1, "abcde", 6); // 6 means write len
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 6, len, EXIT3);
|
|
||||||
|
|
||||||
off = lseek(fd1, 0, SEEK_SET);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(off, -1, off, EXIT3);
|
|
||||||
|
|
||||||
len = read(fd1, readbuf, JFFS_STANDARD_NAME_LENGTH);
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 16, len, EXIT3); // 16 means path name len
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, "1234567890abcde", readbuf, EXIT3);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT3);
|
|
||||||
|
|
||||||
ret = close(fd1);
|
|
||||||
ICUNIT_ASSERT_EQUAL(ret, JFFS_NO_ERROR, ret);
|
|
||||||
|
|
||||||
ret = unlink(pathname);
|
|
||||||
ICUNIT_ASSERT_EQUAL(ret, JFFS_NO_ERROR, ret);
|
|
||||||
#if 1
|
|
||||||
close(fd1);
|
|
||||||
#endif
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT3:
|
|
||||||
close(fd1);
|
|
||||||
EXIT2:
|
|
||||||
close(fd2);
|
|
||||||
EXIT1:
|
|
||||||
close(fd);
|
|
||||||
EXIT:
|
|
||||||
remove(JFFS_PATH_NAME0);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs045(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_045", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,80 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 fd = -1;
|
|
||||||
INT32 fd1 = -1;
|
|
||||||
INT32 ret, len;
|
|
||||||
CHAR filebuf[20] = "1234567890";
|
|
||||||
CHAR readbuf[JFFS_STANDARD_NAME_LENGTH] = " ";
|
|
||||||
CHAR pathname[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME0 };
|
|
||||||
|
|
||||||
fd = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT1);
|
|
||||||
|
|
||||||
len = write(fd, filebuf, strlen(filebuf));
|
|
||||||
ICUNIT_GOTO_EQUAL(len, JFFS_SHORT_ARRAY_LENGTH, len, EXIT1);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
fd1 = open(pathname, O_NONBLOCK | O_TRUNC | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd1, -1, fd1, EXIT2);
|
|
||||||
|
|
||||||
len = read(fd1, readbuf, JFFS_STANDARD_NAME_LENGTH);
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 0, len, EXIT2);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, " ", readbuf, EXIT2);
|
|
||||||
|
|
||||||
ret = close(fd1);
|
|
||||||
ICUNIT_ASSERT_EQUAL(ret, JFFS_NO_ERROR, ret);
|
|
||||||
|
|
||||||
ret = unlink(pathname);
|
|
||||||
ICUNIT_ASSERT_EQUAL(ret, JFFS_NO_ERROR, ret);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT2:
|
|
||||||
close(fd1);
|
|
||||||
goto EXIT;
|
|
||||||
EXIT1:
|
|
||||||
close(fd);
|
|
||||||
EXIT:
|
|
||||||
remove(pathname);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs046(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_046", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,82 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 fd = -1;
|
|
||||||
INT32 len, ret;
|
|
||||||
CHAR filebuf[20] = "1234567890abcde";
|
|
||||||
CHAR readbuf[7] = { 0 };
|
|
||||||
CHAR pathname[50] = { JFFS_PATH_NAME0 };
|
|
||||||
off_t off;
|
|
||||||
|
|
||||||
fd = open(pathname, O_CREAT | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT1);
|
|
||||||
|
|
||||||
len = write(fd, filebuf, strlen(filebuf));
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 15, len, EXIT1); // 15 means write len
|
|
||||||
|
|
||||||
off = lseek(fd, 0, SEEK_SET);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(off, -1, off, EXIT1);
|
|
||||||
|
|
||||||
len = read(fd, readbuf, 4); // 4 means read len
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 4, len, EXIT1); // 4 means read len
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, "1234", readbuf, EXIT1);
|
|
||||||
|
|
||||||
len = read(fd, readbuf, 5); // 5 means read len
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 5, len, EXIT1); // 5 means read len
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, "56789", readbuf, EXIT1);
|
|
||||||
|
|
||||||
len = read(fd, readbuf, 6); // 6 means read len
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 6, len, EXIT1); // 6 means read len
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, "0abcde", readbuf, EXIT1);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = unlink(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT1:
|
|
||||||
close(fd);
|
|
||||||
EXIT:
|
|
||||||
remove(pathname);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs048(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_048", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,88 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 fd = -1;
|
|
||||||
INT32 len, ret;
|
|
||||||
CHAR filebuf[10] = "123456";
|
|
||||||
CHAR readbuf[10] = { 0 };
|
|
||||||
CHAR pathname[50] = { JFFS_PATH_NAME0 };
|
|
||||||
off_t off;
|
|
||||||
|
|
||||||
fd = open(pathname, O_CREAT | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT1);
|
|
||||||
|
|
||||||
len = write(fd, filebuf, strlen(filebuf));
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 6, len, EXIT1); // 6 means write len
|
|
||||||
|
|
||||||
off = lseek(fd, 0, SEEK_SET);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(off, -1, off, EXIT1);
|
|
||||||
|
|
||||||
len = read(fd, readbuf, 9); // 9 means length of data to be read
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 6, len, EXIT1); // 6 means length of actually read data
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, "123456", readbuf, EXIT1);
|
|
||||||
|
|
||||||
off = lseek(fd, 0, SEEK_SET);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(off, -1, off, EXIT1);
|
|
||||||
|
|
||||||
len = read(fd, readbuf, 10); // 10 means length of data to be read
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 6, len, EXIT1); // 6 means length of actually read data
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, "123456", readbuf, EXIT1);
|
|
||||||
|
|
||||||
off = lseek(fd, 0, SEEK_SET);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(off, -1, off, EXIT1);
|
|
||||||
len = read(fd, readbuf, 11); // 11 means length of data to be read
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 6, len, EXIT1); // 6 means length of actually read data
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, "123456", readbuf, EXIT1);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = unlink(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
|
|
||||||
EXIT1:
|
|
||||||
close(fd);
|
|
||||||
EXIT:
|
|
||||||
remove(pathname);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs049(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_049", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,101 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 fd = -1;
|
|
||||||
INT32 len, ret;
|
|
||||||
CHAR filebuf[10] = "123456";
|
|
||||||
CHAR readbuf[10] = { 0 };
|
|
||||||
CHAR pathname[50] = { JFFS_PATH_NAME0 };
|
|
||||||
off_t off;
|
|
||||||
|
|
||||||
fd = open(pathname, O_CREAT | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT1);
|
|
||||||
|
|
||||||
len = read(fd, readbuf, 0);
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 0, len, EXIT1);
|
|
||||||
|
|
||||||
len = write(fd, filebuf, strlen(filebuf));
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 6, len, EXIT1); // 6 means write len
|
|
||||||
|
|
||||||
off = lseek(fd, 0, SEEK_SET);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(off, -1, off, EXIT1);
|
|
||||||
|
|
||||||
len = read(fd, readbuf, 0);
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 0, len, EXIT1);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = unlink(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
fd = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT1);
|
|
||||||
|
|
||||||
len = read(fd, readbuf, 0);
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 0, len, EXIT1);
|
|
||||||
|
|
||||||
len = write(fd, filebuf, strlen(filebuf));
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 6, len, EXIT1); // 6 means write len
|
|
||||||
|
|
||||||
off = lseek(fd, 0, SEEK_SET);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(off, -1, off, EXIT1);
|
|
||||||
|
|
||||||
len = read(fd, readbuf, 1);
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 1, len, EXIT1);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, "1", readbuf, EXIT1);
|
|
||||||
|
|
||||||
len = read(fd, readbuf, 0);
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 0, len, EXIT1);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = unlink(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT1:
|
|
||||||
close(fd);
|
|
||||||
EXIT:
|
|
||||||
remove(pathname);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs050(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_050", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,276 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 fd[10] = { -1 };
|
|
||||||
INT32 ret;
|
|
||||||
CHAR pathname[JFFS_NAME_LIMITTED_SIZE] = { JFFS_PATH_NAME0 };
|
|
||||||
DIR *dir = NULL;
|
|
||||||
struct dirent *ptr = NULL;
|
|
||||||
INT32 offset;
|
|
||||||
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
dir = opendir(pathname);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dir, NULL, dir, EXIT0);
|
|
||||||
|
|
||||||
ret = closedir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT0);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname, JFFS_NAME_LIMITTED_SIZE, "/0testwe12rttyututututqweqqfsdfsdfsdf.exe");
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/0testwe12rttyututututqweqqfsdfsdfsdffsdf1234567890.TXT", JFFS_NAME_LIMITTED_SIZE);
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT2);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname,
|
|
||||||
"/0testwe12rttyututututqweqqfsdfsdfsdffsdf12345678900testwe12rttyututututqweqqfsdfsdfsdffsdf1234567890.123",
|
|
||||||
JFFS_NAME_LIMITTED_SIZE);
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT3);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/12345678901234567890123456789012345678901234567890.123", JFFS_NAME_LIMITTED_SIZE);
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT4);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/ABCDEFGHJKLMNOPQRSTUVWXYZabcdefghjklmnopqrstuvwxyz.123", JFFS_NAME_LIMITTED_SIZE);
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT5);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/<2F><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȱ<EFBFBD>δ<EFBFBD>δ<EFBFBD>.123", JFFS_NAME_LIMITTED_SIZE);
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT6);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/<2F><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȱ<EFBFBD>δ<EFBFBD>δ<EFBFBD>123ttt.www", JFFS_NAME_LIMITTED_SIZE);
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT7);
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/<2F><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȱ<EFBFBD>δ<EFBFBD>δ<EFBFBD>123ttt.www", JFFS_NAME_LIMITTED_SIZE);
|
|
||||||
fd[0] = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY); // 0 means first fd
|
|
||||||
ICUNIT_GOTO_EQUAL(fd[0], -1, fd[0], EXIT7); // 0 means first fd
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/0testwe12rttyututututqweqqfsdfsdfsdf.exe", JFFS_NAME_LIMITTED_SIZE);
|
|
||||||
fd[0] = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY); // 0 means first fd
|
|
||||||
ICUNIT_GOTO_EQUAL(fd[0], -1, fd[0], EXIT7); // 0 means first fd
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/0testwe12rttyututututqweqqfsdfsdfsdf.txt", JFFS_NAME_LIMITTED_SIZE);
|
|
||||||
fd[0] = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY); // 0 means first fd
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd[0], -1, fd[0], EXIT8); // 0 means first fd
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/0testwe12rttyututututqweqqfsdfsdfsdffsdf1234567890.WWW", JFFS_NAME_LIMITTED_SIZE);
|
|
||||||
fd[1] = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY); // 1 means second fd
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd[1], -1, fd[1], EXIT9); // 1 means second fd
|
|
||||||
|
|
||||||
JffsStrcat2(pathname,
|
|
||||||
"/0testwe12rttyututututqweqqfsdfsdfsdffsdf12345678900testwe12rttyututututqweqqfsdfsdfsdffsdf1234567890.AAA",
|
|
||||||
JFFS_NAME_LIMITTED_SIZE);
|
|
||||||
fd[2] = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY); // 2 means third fd
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd[2], -1, fd[2], EXIT10); // 2 means third fd
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/12345678901234567890123456789012345678901234567890.456", JFFS_NAME_LIMITTED_SIZE);
|
|
||||||
fd[3] = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY); // 3 means four fd
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd[3], -1, fd[3], EXIT11); // 3 means four fd
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/ABCDEFGHJKLMNOPQRSTUVWXYZabcdefghjklmnopqrstuvwxyz.456", JFFS_NAME_LIMITTED_SIZE);
|
|
||||||
fd[4] = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY); // 4 means fifth fd
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd[4], -1, fd[4], EXIT12); // 4 means fifth fd
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/<2F><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȱ<EFBFBD>δ<EFBFBD>δ<EFBFBD>.123.456", JFFS_NAME_LIMITTED_SIZE);
|
|
||||||
fd[5] = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY); // 5 means six fd
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd[5], -1, fd[5], EXIT13); // 5 means six fd
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/<2F><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȱ<EFBFBD>δ<EFBFBD>δ<EFBFBD>123ttt.www", JFFS_NAME_LIMITTED_SIZE);
|
|
||||||
fd[6] = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY); // 6 means seven fd
|
|
||||||
ICUNIT_GOTO_EQUAL(fd[6], -1, fd[6], EXIT13); // 6 means seven fd
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/<2F><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȱ<EFBFBD>δ<EFBFBD>δ<EFBFBD>123ttt.AAA", JFFS_NAME_LIMITTED_SIZE);
|
|
||||||
fd[6] = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY); // 6 means seven fd
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd[6], -1, fd[6], EXIT14); // 6 means seven fd
|
|
||||||
|
|
||||||
JffsStrcat2(pathname, "/<2F><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȱ<EFBFBD>δ<EFBFBD>δ<EFBFBD>123ttt.AAA", JFFS_NAME_LIMITTED_SIZE);
|
|
||||||
fd[7] = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY); // 7 means eight fd
|
|
||||||
ICUNIT_GOTO_EQUAL(fd[7], -1, fd[7], EXIT14); // 7 means eight fd
|
|
||||||
|
|
||||||
dir = opendir(JFFS_PATH_NAME0);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dir, NULL, dir, EXIT15);
|
|
||||||
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT15);
|
|
||||||
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT15);
|
|
||||||
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT15);
|
|
||||||
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT15);
|
|
||||||
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT15);
|
|
||||||
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT15);
|
|
||||||
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT15);
|
|
||||||
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT15);
|
|
||||||
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT15);
|
|
||||||
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT15);
|
|
||||||
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT15);
|
|
||||||
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT15);
|
|
||||||
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT15);
|
|
||||||
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ptr, NULL, ptr, EXIT15);
|
|
||||||
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(ptr, NULL, ptr, EXIT15);
|
|
||||||
|
|
||||||
ret = closedir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT15);
|
|
||||||
LosTaskDelay(5); // 5 means timedelay len
|
|
||||||
|
|
||||||
EXIT14:
|
|
||||||
JffsStrcat2(pathname, "/<2F><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȱ<EFBFBD>δ<EFBFBD>δ<EFBFBD>123ttt.AAA", JFFS_NAME_LIMITTED_SIZE);
|
|
||||||
ret = close(fd[6]); // 6 means seven fd
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT14_1);
|
|
||||||
EXIT14_1:
|
|
||||||
ret = unlink(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT13);
|
|
||||||
|
|
||||||
EXIT13:
|
|
||||||
JffsStrcat2(pathname, "/<2F><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȱ<EFBFBD>δ<EFBFBD>δ<EFBFBD>.123.456", JFFS_NAME_LIMITTED_SIZE);
|
|
||||||
ret = close(fd[5]); // 5 means six fd
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT13_1);
|
|
||||||
EXIT13_1:
|
|
||||||
ret = unlink(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT12);
|
|
||||||
EXIT12:
|
|
||||||
JffsStrcat2(pathname, "/ABCDEFGHJKLMNOPQRSTUVWXYZabcdefghjklmnopqrstuvwxyz.456", JFFS_NAME_LIMITTED_SIZE);
|
|
||||||
ret = close(fd[4]); // 4 means fifth fd
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT12_1);
|
|
||||||
EXIT12_1:
|
|
||||||
ret = unlink(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT11);
|
|
||||||
EXIT11:
|
|
||||||
JffsStrcat2(pathname, "/12345678901234567890123456789012345678901234567890.456", JFFS_NAME_LIMITTED_SIZE);
|
|
||||||
ret = close(fd[3]); // 3 means four fd
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT11_1);
|
|
||||||
EXIT11_1:
|
|
||||||
ret = unlink(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT10);
|
|
||||||
EXIT10:
|
|
||||||
JffsStrcat2(pathname,
|
|
||||||
"/0testwe12rttyututututqweqqfsdfsdfsdffsdf12345678900testwe12rttyututututqweqqfsdfsdfsdffsdf1234567890.AAA",
|
|
||||||
JFFS_NAME_LIMITTED_SIZE);
|
|
||||||
ret = close(fd[2]); // 2 means third fd
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT10_1);
|
|
||||||
EXIT10_1:
|
|
||||||
ret = unlink(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT9);
|
|
||||||
EXIT9:
|
|
||||||
JffsStrcat2(pathname, "/0testwe12rttyututututqweqqfsdfsdfsdffsdf1234567890.WWW", JFFS_NAME_LIMITTED_SIZE);
|
|
||||||
ret = close(fd[1]); // 1 means second fd
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT9_1);
|
|
||||||
EXIT9_1:
|
|
||||||
ret = unlink(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT8);
|
|
||||||
|
|
||||||
EXIT8:
|
|
||||||
JffsStrcat2(pathname, "/0testwe12rttyututututqweqqfsdfsdfsdf.txt", JFFS_NAME_LIMITTED_SIZE);
|
|
||||||
ret = close(fd[0]); // 0 means first fd
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT8_1);
|
|
||||||
EXIT8_1:
|
|
||||||
ret = unlink(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT7);
|
|
||||||
|
|
||||||
EXIT7:
|
|
||||||
JffsStrcat2(pathname, "/<2F><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȱ<EFBFBD>δ<EFBFBD>δ<EFBFBD>123ttt.www", JFFS_NAME_LIMITTED_SIZE);
|
|
||||||
rmdir(pathname);
|
|
||||||
|
|
||||||
EXIT6:
|
|
||||||
JffsStrcat2(pathname, "/<2F><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȱ<EFBFBD>δ<EFBFBD>δ<EFBFBD>.123", JFFS_NAME_LIMITTED_SIZE);
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT5:
|
|
||||||
JffsStrcat2(pathname, "/ABCDEFGHJKLMNOPQRSTUVWXYZabcdefghjklmnopqrstuvwxyz.123", JFFS_NAME_LIMITTED_SIZE);
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT4:
|
|
||||||
JffsStrcat2(pathname, "/12345678901234567890123456789012345678901234567890.123", JFFS_NAME_LIMITTED_SIZE);
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT3:
|
|
||||||
JffsStrcat2(pathname,
|
|
||||||
"/0testwe12rttyututututqweqqfsdfsdfsdffsdf12345678900testwe12rttyututututqweqqfsdfsdfsdffsdf1234567890.123",
|
|
||||||
JFFS_NAME_LIMITTED_SIZE);
|
|
||||||
rmdir(pathname);
|
|
||||||
|
|
||||||
EXIT2:
|
|
||||||
JffsStrcat2(pathname, "/0testwe12rttyututututqweqqfsdfsdfsdffsdf1234567890.TXT", JFFS_NAME_LIMITTED_SIZE);
|
|
||||||
rmdir(pathname);
|
|
||||||
|
|
||||||
EXIT1:
|
|
||||||
JffsStrcat2(pathname, "/0testwe12rttyututututqweqqfsdfsdfsdf.exe", JFFS_NAME_LIMITTED_SIZE);
|
|
||||||
rmdir(pathname);
|
|
||||||
EXIT:
|
|
||||||
rmdir(JFFS_PATH_NAME0);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT15:
|
|
||||||
closedir(dir);
|
|
||||||
goto EXIT14;
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT0:
|
|
||||||
closedir(dir);
|
|
||||||
goto EXIT;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs051(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_051", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,110 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 fd = -1;
|
|
||||||
INT32 len, ret;
|
|
||||||
CHAR filebuf[20] = "1234567890abcde";
|
|
||||||
CHAR readbuf[JFFS_SHORT_ARRAY_LENGTH] = { 0 };
|
|
||||||
CHAR pathname[50] = { JFFS_PATH_NAME0 };
|
|
||||||
off_t off;
|
|
||||||
|
|
||||||
fd = open(pathname, O_CREAT | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT1);
|
|
||||||
|
|
||||||
len = write(fd, filebuf, strlen(filebuf));
|
|
||||||
ICUNIT_GOTO_EQUAL(len, strlen(filebuf), len, EXIT1);
|
|
||||||
|
|
||||||
off = lseek(fd, 0, SEEK_SET);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(off, -1, off, EXIT1);
|
|
||||||
|
|
||||||
len = read(fd, readbuf, 4); // 4 means read len
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 4, len, EXIT1); // 4 means read len
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, "1234", readbuf, EXIT1);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
(void)memset_s(readbuf, JFFS_SHORT_ARRAY_LENGTH, 0, JFFS_SHORT_ARRAY_LENGTH);
|
|
||||||
|
|
||||||
len = read(fd, readbuf, 2); // 2 means read len
|
|
||||||
ICUNIT_GOTO_EQUAL(len, -1, len, EXIT);
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, EBADF, errno, EXIT);
|
|
||||||
ICUNIT_GOTO_EQUAL(readbuf[0], 0, readbuf[0], EXIT);
|
|
||||||
|
|
||||||
len = write(fd, filebuf, strlen(filebuf));
|
|
||||||
ICUNIT_GOTO_EQUAL(len, -1, len, EXIT);
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, EBADF, errno, EXIT);
|
|
||||||
|
|
||||||
fd = open(pathname, O_CREAT | O_RDWR, HIGHEST_AUTHORITY); // Ôٴδò¿ªÎļþ
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT1);
|
|
||||||
|
|
||||||
len = write(fd, filebuf, strlen(filebuf));
|
|
||||||
ICUNIT_GOTO_EQUAL(len, strlen(filebuf), len, EXIT1);
|
|
||||||
|
|
||||||
off = lseek(fd, 0, SEEK_SET);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(off, -1, off, EXIT1);
|
|
||||||
|
|
||||||
len = read(fd, readbuf, 4); // 4 means read len
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 4, len, EXIT1); // 4 means read len
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, "1234", readbuf, EXIT1);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = unlink(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
len = read(fd, readbuf, 2); // 2 means read len
|
|
||||||
ICUNIT_GOTO_EQUAL(len, -1, len, EXIT);
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, EBADF, errno, EXIT);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, "1234", readbuf, EXIT);
|
|
||||||
|
|
||||||
len = write(fd, filebuf, strlen(filebuf));
|
|
||||||
ICUNIT_GOTO_EQUAL(len, -1, len, EXIT);
|
|
||||||
ICUNIT_GOTO_EQUAL(errno, EBADF, errno, EXIT);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT1:
|
|
||||||
close(fd);
|
|
||||||
EXIT:
|
|
||||||
remove(pathname);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs053(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_053", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,73 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 fd = -1;
|
|
||||||
INT32 len, ret;
|
|
||||||
CHAR filebuf[20] = "1234567890abcde&";
|
|
||||||
CHAR readbuf[5] = { 0 };
|
|
||||||
CHAR pathname[50] = { JFFS_PATH_NAME0 };
|
|
||||||
off_t off;
|
|
||||||
|
|
||||||
fd = open(pathname, O_CREAT | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT1);
|
|
||||||
|
|
||||||
len = write(fd, filebuf, strlen(filebuf));
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 16, len, EXIT1); // 16 means write len
|
|
||||||
|
|
||||||
len = write(fd, filebuf, strlen(filebuf) + 1);
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 17, len, EXIT1); // 17 means write len
|
|
||||||
|
|
||||||
len = write(fd, filebuf, strlen(filebuf) - 1);
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 15, len, EXIT1); // 15 means write len
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = unlink(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT1:
|
|
||||||
close(fd);
|
|
||||||
EXIT:
|
|
||||||
remove(pathname);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs055(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_055", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,136 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 fd = -1;
|
|
||||||
INT32 len, ret;
|
|
||||||
CHAR filebuf[20] = "1234567890abcde&";
|
|
||||||
CHAR readbuf[50] = { 0 };
|
|
||||||
CHAR pathname[50] = { JFFS_PATH_NAME0 };
|
|
||||||
off_t off;
|
|
||||||
|
|
||||||
fd = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT1);
|
|
||||||
|
|
||||||
len = write(fd, filebuf, strlen(filebuf));
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 16, len, EXIT1); // 16 means write len
|
|
||||||
|
|
||||||
len = write(fd, filebuf, strlen(filebuf));
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 16, len, EXIT1); // 16 means write len
|
|
||||||
|
|
||||||
len = write(fd, filebuf, strlen(filebuf));
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 16, len, EXIT1); // 16 means write len
|
|
||||||
|
|
||||||
len = write(fd, "END", 3); // 3 means name len
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 3, len, EXIT1); // 3 means write len
|
|
||||||
|
|
||||||
off = lseek(fd, 10, SEEK_SET); // 10 means file seek len
|
|
||||||
ICUNIT_GOTO_EQUAL(off, 10, off, EXIT1); // 10 means current file position
|
|
||||||
|
|
||||||
len = read(fd, readbuf, 6); // 6 means read len
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 6, len, EXIT1); // 6 means read len
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, "abcde&", readbuf, EXIT1);
|
|
||||||
|
|
||||||
off = lseek(fd, 2, SEEK_CUR); // 2 means file seek len
|
|
||||||
ICUNIT_GOTO_EQUAL(off, 18, off, EXIT1); // 18 means current file position
|
|
||||||
|
|
||||||
(void)memset_s(readbuf, sizeof(readbuf), 0, sizeof(readbuf));
|
|
||||||
|
|
||||||
len = read(fd, readbuf, 5); // 5 means read len
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 5, len, EXIT1); // 5 means read len
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, "34567", readbuf, EXIT1);
|
|
||||||
|
|
||||||
off = lseek(fd, 0, SEEK_CUR);
|
|
||||||
ICUNIT_GOTO_EQUAL(off, 23, off, EXIT1); // 23 means current file position
|
|
||||||
|
|
||||||
len = read(fd, readbuf, 5); // 5 means read len
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 5, len, EXIT1); // 5 means read len
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, "890ab", readbuf, EXIT1);
|
|
||||||
|
|
||||||
off = lseek(fd, -2, SEEK_CUR); // -2 means file seek back len
|
|
||||||
ICUNIT_GOTO_EQUAL(off, 26, off, EXIT1); // 26 means current file position
|
|
||||||
|
|
||||||
len = read(fd, readbuf, 6); // 6 means read len
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 6, len, EXIT1); // 6 means read len
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, "abcde&", readbuf, EXIT1);
|
|
||||||
|
|
||||||
(void)memset_s(readbuf, sizeof(readbuf), 0, sizeof(readbuf));
|
|
||||||
|
|
||||||
off = lseek(fd, -2, SEEK_END); // -2 means file seek back len
|
|
||||||
ICUNIT_GOTO_EQUAL(off, 49, off, EXIT1); // 49 means current file position
|
|
||||||
|
|
||||||
len = read(fd, readbuf, 5); // 5 means read len
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 2, len, EXIT1); // 2 means read len
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, "ND", readbuf, EXIT1);
|
|
||||||
|
|
||||||
off = lseek(fd, 0, SEEK_END);
|
|
||||||
ICUNIT_GOTO_EQUAL(off, 51, off, EXIT1); // 51 means current file position
|
|
||||||
|
|
||||||
len = read(fd, readbuf, 6); // 6 means read len
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 0, len, EXIT1);
|
|
||||||
|
|
||||||
off = lseek(fd, 2, SEEK_END); // 2 means file seek len
|
|
||||||
ICUNIT_GOTO_EQUAL(off, 53, off, EXIT1); // 53 means current file position
|
|
||||||
len = read(fd, readbuf, 6); // 6 means read len
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 0, len, EXIT1);
|
|
||||||
|
|
||||||
len = write(fd, "mmm", 3); // 3 means write len
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 3, len, EXIT1); // 3 means write len
|
|
||||||
|
|
||||||
off = lseek(fd, -3, SEEK_END); // -3 means file seek back len
|
|
||||||
ICUNIT_GOTO_EQUAL(off, 53, off, EXIT1); // 53 means current file position
|
|
||||||
|
|
||||||
len = read(fd, readbuf, 5); // 5 means read len
|
|
||||||
ICUNIT_GOTO_EQUAL(len, 3, len, EXIT1); // 3 means length of actually read data
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, "mmm", readbuf, EXIT1);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = unlink(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT1:
|
|
||||||
close(fd);
|
|
||||||
EXIT:
|
|
||||||
remove(pathname);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs056(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_056", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,89 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret, scandirCount;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR pathname[30] = { JFFS_PATH_NAME0 };
|
|
||||||
DIR *dir = NULL;
|
|
||||||
struct dirent *ptr = NULL;
|
|
||||||
struct dirent **namelist = NULL;
|
|
||||||
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
dir = opendir(pathname);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dir, NULL, dir, EXIT1);
|
|
||||||
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(ptr, NULL, ptr, EXIT1);
|
|
||||||
|
|
||||||
ptr = readdir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(ptr, NULL, ptr, EXIT1);
|
|
||||||
|
|
||||||
scandirCount = scandir(pathname, &namelist, 0, alphasort);
|
|
||||||
ICUNIT_GOTO_EQUAL(scandirCount, 0, scandirCount, EXIT2);
|
|
||||||
|
|
||||||
JffsScandirFree(namelist, scandirCount);
|
|
||||||
|
|
||||||
ret = closedir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
dir = opendir(pathname);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dir, NULL, dir, EXIT1);
|
|
||||||
|
|
||||||
ret = closedir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = rmdir(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT2:
|
|
||||||
if (scandirCount > 0)
|
|
||||||
JffsScandirFree(namelist, scandirCount);
|
|
||||||
else
|
|
||||||
goto EXIT1;
|
|
||||||
EXIT1:
|
|
||||||
closedir(dir);
|
|
||||||
EXIT:
|
|
||||||
remove(pathname);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs057(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_057", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,90 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret;
|
|
||||||
INT32 fd = -1;
|
|
||||||
CHAR pathname[30] = { JFFS_MAIN_DIR0 };
|
|
||||||
CHAR pathname1[30] = { JFFS_PATH_NAME0 };
|
|
||||||
CHAR pathname2[30] = { JFFS_PATH_NAME0 };
|
|
||||||
DIR *dir = NULL;
|
|
||||||
struct dirent *ptr = NULL;
|
|
||||||
struct dirent **namelist = NULL;
|
|
||||||
|
|
||||||
dir = opendir(pathname);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(dir, NULL, dir, EXIT);
|
|
||||||
|
|
||||||
ret = mkdir(pathname1, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
(void)strcat_s(pathname2, sizeof(pathname2), "/test");
|
|
||||||
ret = mkdir(pathname2, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = access(pathname2, F_OK);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = access(pathname1, F_OK);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = rmdir(pathname2);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = access(pathname2, F_OK);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, -1, ret, EXIT2);
|
|
||||||
|
|
||||||
ret = access(pathname1, F_OK);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = closedir(dir);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = rmdir(pathname1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT2:
|
|
||||||
rmdir(pathname2);
|
|
||||||
EXIT1:
|
|
||||||
rmdir(pathname1);
|
|
||||||
EXIT:
|
|
||||||
closedir(dir);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs058(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_058", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,91 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static constexpr int FILE_NAME_LEN = 10;
|
|
||||||
static constexpr int MAX_FILE_NAME_LEN = 50;
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 fd = -1;
|
|
||||||
INT32 ret, len;
|
|
||||||
CHAR filebuf[20] = "abcdeabcde";
|
|
||||||
CHAR readbuf[MAX_FILE_NAME_LEN] = "liteos";
|
|
||||||
CHAR pathname[MAX_FILE_NAME_LEN] = { JFFS_PATH_NAME0 };
|
|
||||||
off_t off;
|
|
||||||
struct stat buf1;
|
|
||||||
|
|
||||||
fd = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT1);
|
|
||||||
|
|
||||||
len = write(fd, filebuf, strlen(filebuf));
|
|
||||||
ICUNIT_GOTO_EQUAL(len, FILE_NAME_LEN, len, EXIT1);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
fd = creat(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT1);
|
|
||||||
|
|
||||||
len = read(fd, readbuf, MAX_FILE_NAME_LEN);
|
|
||||||
ICUNIT_GOTO_EQUAL(len, -1, len, EXIT1);
|
|
||||||
ICUNIT_GOTO_STRING_EQUAL(readbuf, "liteos", readbuf, EXIT1);
|
|
||||||
|
|
||||||
ret = stat(pathname, &buf1);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
|
|
||||||
ICUNIT_GOTO_EQUAL(buf1.st_size, 0, buf1.st_size, EXIT1);
|
|
||||||
|
|
||||||
len = write(fd, filebuf, strlen(filebuf));
|
|
||||||
ICUNIT_GOTO_EQUAL(len, FILE_NAME_LEN, len, EXIT1);
|
|
||||||
|
|
||||||
len = read(fd, readbuf, MAX_FILE_NAME_LEN);
|
|
||||||
ICUNIT_GOTO_EQUAL(len, -1, len, EXIT1);
|
|
||||||
|
|
||||||
ret = close(fd);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT1);
|
|
||||||
|
|
||||||
ret = unlink(pathname);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT1:
|
|
||||||
close(fd);
|
|
||||||
EXIT:
|
|
||||||
remove(pathname);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs059(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_059", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,59 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 fd = -1;
|
|
||||||
INT32 fd1 = -1;
|
|
||||||
INT32 fd2 = -1;
|
|
||||||
INT32 ret, len;
|
|
||||||
CHAR filebuf[20] = "1234567890";
|
|
||||||
CHAR readbuf[50] = { 0 };
|
|
||||||
CHAR pathname[50] = { JFFS_PATH_NAME0 };
|
|
||||||
off_t off;
|
|
||||||
fd = open(pathname, O_NONBLOCK | O_RDWR | O_EXCL, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(fd, 0, fd, EXIT1);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT1:
|
|
||||||
close(fd);
|
|
||||||
EXIT:
|
|
||||||
remove(pathname);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs060(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_060", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,66 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
|
||||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
|
||||||
* to endorse or promote products derived from this software without specific prior written
|
|
||||||
* permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "It_vfs_jffs.h"
|
|
||||||
|
|
||||||
static UINT32 Testcase(VOID)
|
|
||||||
{
|
|
||||||
INT32 ret;
|
|
||||||
CHAR pathname[50] = { JFFS_PATH_NAME0 };
|
|
||||||
DIR *dir = NULL;
|
|
||||||
struct dirent *ptr = NULL;
|
|
||||||
INT32 offset;
|
|
||||||
|
|
||||||
ret = mkdir(pathname, HIGHEST_AUTHORITY);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
ret = rmdir(JFFS_PATH_NAME0);
|
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
ret = rmdir(JFFS_PATH_NAME0);
|
|
||||||
ICUNIT_GOTO_NOT_EQUAL(ret, 0, ret, EXIT);
|
|
||||||
|
|
||||||
dir = opendir(JFFS_PATH_NAME0);
|
|
||||||
ICUNIT_GOTO_EQUAL(dir, NULL, dir, EXIT1);
|
|
||||||
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
EXIT1:
|
|
||||||
closedir(dir);
|
|
||||||
EXIT:
|
|
||||||
remove(pathname);
|
|
||||||
return JFFS_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID ItFsJffs061(VOID)
|
|
||||||
{
|
|
||||||
TEST_ADD_CASE("IT_FS_JFFS_061", Testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL2, TEST_FUNCTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue