Improve branch coverage for error-free cases.

Errors are mostly uncovered.
This commit is contained in:
Ivan Baravy 2020-03-12 00:51:48 +03:00
parent 6179e7e614
commit 26fd52621d
7 changed files with 191 additions and 20 deletions

View File

@ -6,7 +6,7 @@ TEMP_DIR:=$(shell mktemp -d)
all: s05k s4k unicode v5 kolibri.img coverage
rmdir $(TEMP_DIR)
s05k: xfs_v4_ftype0_s05k_b2k_n8k.img xfs_v4_ftype1_s05k_b2k_n8k.img xfs_v4_xattr.img xfs_v4_files_s05k_b4k_n8k.img xfs_v4_ftype0_s05k_b2k_n8k_xattr.img xfs_v4_btrees_l2.img
s05k: xfs_v4_ftype0_s05k_b2k_n8k.img xfs_v4_ftype1_s05k_b2k_n8k.img xfs_v4_xattr.img xfs_v4_files_s05k_b4k_n8k.img xfs_v4_ftype0_s05k_b2k_n8k_xattr.img xfs_v4_btrees_l2.img xfs_short_dir_i8.img
s4k: xfs_v4_ftype0_s4k_b4k_n8k.img
@ -14,7 +14,7 @@ unicode: xfs_v4_unicode.img
v5: xfs_v5_ftype1_s05k_b2k_n8k.img xfs_v5_files_s05k_b4k_n8k.img
coverage: jfs.img xfs_borg_bit.img
coverage: jfs.img xfs_borg_bit.img xfs_short_dir_i8.img
kolibri.img: ../default.skn
touch $@
@ -36,6 +36,24 @@ xfs_borg_bit.img:
parted --script $@ mktable gpt
parted --script --align optimal $@ mkpart primary 1MiB 100%
xfs_short_dir_i8.img:
echo -en "\x00" > $@
fallocate -i -o 0 -l 42TiB $@
mkfs.xfs -b size=2k -m crc=0,finobt=0,rmapbt=0,reflink=0 -d sectsize=512 -i maxpct=100,size=256 -n size=8k,ftype=0 $@
#
sudo mount $(MOUNT_OPT) $@ $(TEMP_DIR)
sudo chown $$USER $(TEMP_DIR) -R
#
mkdir $(TEMP_DIR)/sf
$(MKDIRRANGE) $(TEMP_DIR)/sf 0 5 0 244
#
$(MKDIRRANGE) $(TEMP_DIR)/sf/d0000000002_xx 7 10 0 244
#
sudo umount $(TEMP_DIR)
fallocate -i -o 0 -l 1MiB $@
parted --script $@ mktable gpt
parted --script --align optimal $@ mkpart primary 1MiB 100%
xfs_v4_ftype0_s05k_b2k_n8k.img:
fallocate -l 63MiB $@
mkfs.xfs -b size=2k -m crc=0,finobt=0,rmapbt=0,reflink=0 -d sectsize=512 -i maxpct=100 -n size=8k,ftype=0 $@
@ -259,6 +277,10 @@ xfs_v4_unicode.img:
mkdir -p $(TEMP_DIR)/dir0
mkdir -p $(TEMP_DIR)/дир❦/дир11
mkdir -p $(TEMP_DIR)/❦❦❦/д❦р22
mkdir -p $(TEMP_DIR)/❦👩❦/
mkdir -p $(TEMP_DIR)/❦👩❦/👩❦❦/
mkdir -p $(TEMP_DIR)/❦👩❦/❦👩❦/
mkdir -p $(TEMP_DIR)/❦👩❦/❦❦👩/
mkdir $(TEMP_DIR)/дир3/
#
echo hello_world > $(TEMP_DIR)/dir0/file00

View File

@ -1,5 +1,8 @@
/> disk_add ../img/xfs_v4_ftype1_s05k_b2k_n8k.img hd0 -c 0
/hd0/1: xfs
/> disk_add ../img/xfs_short_dir_i8.img hd1 -c 0
/hd1/1: xfs
/> ls70 /hd0/1/sf_empty
status = 6 end_of_file, count = 2
total = 2
@ -20,8 +23,52 @@ status = 0 success, count = 1
/> ls70 /hd0/1/sf -f 2 -c 1
status = 0 success, count = 1
----f d0000000000_
/> ls70 /hd0/1/sf -f 3 -c 1
status = 0 success, count = 1
----f d0000000001_x
/> ls70 /hd0/1/sf -f 3 -c 100
status = 6 end_of_file, count = 2
total = 5
----f d0000000001_x
----f d0000000002_xx
/> ls70 /hd0/1/sf -f 200 -c 1
status = 6 end_of_file, count = 0
/> ls70 /hd1/1/sf
status = 6 end_of_file, count = 7
total = 7
----f .
----f ..
----f d0000000000_
----f d0000000001_x
----f d0000000002_xx
----f d0000000003_xxx
----f d0000000004_xxxx
/> ls70 /hd0/1/sf -f 1 -c 1
status = 0 success, count = 1
----f ..
/> ls70 /hd0/1/sf -f 2 -c 1
status = 0 success, count = 1
----f d0000000000_
/> ls70 /hd0/1/sf -f 3 -c 1
status = 0 success, count = 1
----f d0000000001_x
/> ls70 /hd0/1/sf -f 3 -c 100
status = 6 end_of_file, count = 2
total = 5
----f d0000000001_x
----f d0000000002_xx
/> ls70 /hd0/1/sf -f 200 -c 1
status = 6 end_of_file, count = 0
/> ls70 /hd1/1/sf/d0000000002_xx
status = 6 end_of_file, count = 5
total = 5
----f .
----f ..
----f d0000000007_xxxxxxx
----f d0000000008_xxxxxxxx
----f d0000000009_xxxxxxxxx
/> ls70 /hd0/1/block
status = 6 end_of_file, count = 7
total = 7
@ -32,6 +79,16 @@ total = 7
----f d0000000002_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
----f d0000000003_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
----f d0000000004_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
/> ls70 /hd0/1/block -f 5 -c 1
status = 0 success, count = 1
----f d0000000003_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
/> ls70 /hd0/1/block -f 5 -c 1000
status = 6 end_of_file, count = 2
----f d0000000003_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
----f d0000000004_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
/> ls70 /hd0/1/block -f 500 -c 1
status = 6 end_of_file, count = 0
/> ls70 /hd0/1/leaf
status = 6 end_of_file, count = 42
total = 42
@ -77,6 +134,10 @@ total = 42
----f d0000000037_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
----f d0000000038_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
----f d0000000039_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
/> ls70 /hd0/1/leaf -f 1 -c 1
status = 0 success, count = 1
----f ..
/> ls70 /hd0/1/node
status = 0 success, count = 100
total = 1102
@ -1204,6 +1265,11 @@ status = 6 end_of_file, count = 2
total = 1102
----f d0000001098_xxxxxxxxxxxxxxxxx
----f d0000001099_xxxxxxxxxxxxxxxxxx
/> ls70 /hd0/1/node -f 2 -c 2
status = 0 success, count = 2
----f d0000000000_
----f d0000000001_x
/> ls70 /hd0/1/btree_leaf
status = 0 success, count = 100
total = 1002
@ -2229,6 +2295,11 @@ status = 6 end_of_file, count = 2
total = 1002
----f d0000000998_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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hd0/1/btree_leaf_free
status = 0 success, count = 100
total = 1202
@ -3458,4 +3529,5 @@ status = 6 end_of_file, count = 2
total = 1202
----f d0000001198_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
----f d0000001199_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
/> disk_del hd0

View File

@ -1,13 +1,36 @@
disk_add ../img/xfs_v4_ftype1_s05k_b2k_n8k.img hd0 -c 0
disk_add ../img/xfs_short_dir_i8.img hd1 -c 0
ls70 /hd0/1/sf_empty
ls70 /hd0/1/sf
#ls70 /hd0/1/sf -c 0
ls70 /hd0/1/sf -f 1 -c 1
ls70 /hd0/1/sf -f 2 -c 1
ls70 /hd0/1/sf -f 3 -c 1
ls70 /hd0/1/sf -f 3 -c 100
ls70 /hd0/1/sf -f 200 -c 1
ls70 /hd1/1/sf
ls70 /hd0/1/sf -f 1 -c 1
ls70 /hd0/1/sf -f 2 -c 1
ls70 /hd0/1/sf -f 3 -c 1
ls70 /hd0/1/sf -f 3 -c 100
ls70 /hd0/1/sf -f 200 -c 1
ls70 /hd1/1/sf/d0000000002_xx
ls70 /hd0/1/block
ls70 /hd0/1/block -f 5 -c 1
ls70 /hd0/1/block -f 5 -c 1000
ls70 /hd0/1/block -f 500 -c 1
ls70 /hd0/1/leaf
ls70 /hd0/1/leaf -f 1 -c 1
ls70 /hd0/1/node
ls70 /hd0/1/node -f 2 -c 2
ls70 /hd0/1/btree_leaf
ls70 /hd0/1/btree_leaf -f 3 -c 3
ls70 /hd0/1/btree_leaf_free
disk_del hd0

View File

@ -75,40 +75,44 @@ status = 6 end_of_file, count = 26
d0bfd180d0b8d0b2d0b5d182e29da6f09f9297d0bcd0b8d1800a
/> ls70 /hd0/1/ -e utf8
status = 6 end_of_file, count = 6
total = 6
status = 6 end_of_file, count = 7
total = 7
----f .
----f ..
----f dir0
----f дирâ<E282AC>¦
----f â<>¦â<C2A6>¦â<C2A6>¦
----f â<>¦ðŸ©â<C2A9>¦
----f дир3
/> ls70 /hd0/1/ -e utf16
status = 6 end_of_file, count = 6
total = 6
status = 6 end_of_file, count = 7
total = 7
----f .
----f ..
----f d
----f 48@f'
----f f'f'f'
----f f'iØ=Üf'
----f 48@3
/> ls70 /hd0/1/ -e cp866
status = 6 end_of_file, count = 6
total = 6
status = 6 end_of_file, count = 7
total = 7
----f .
----f ..
----f dir0
----f ¤¨à_
----f ___
----f ___
----f ¤¨à3
/> ls70 /hd0/1/ -e default
status = 6 end_of_file, count = 6
total = 6
status = 6 end_of_file, count = 7
total = 7
----f .
----f ..
----f d
----f 48@f'
----f f'f'f'
----f f'iØ=Üf'
----f 48@3
/> ls70 /hd0/1/â<>¦â<C2A6>¦â<C2A6>¦/ -e utf8
status = 5 file_not_found
@ -128,40 +132,44 @@ status = 5 file_not_found
status = 5 file_not_found
/> ls80 /hd0/1/ -e utf8
status = 6 end_of_file, count = 6
total = 6
status = 6 end_of_file, count = 7
total = 7
----f .
----f ..
----f dir0
----f дирâ<E282AC>¦
----f â<>¦â<C2A6>¦â<C2A6>¦
----f â<>¦ðŸ©â<C2A9>¦
----f дир3
/> ls80 /hd0/1/ -e utf16
status = 6 end_of_file, count = 6
total = 6
status = 6 end_of_file, count = 7
total = 7
----f .
----f ..
----f d
----f 48@f'
----f f'f'f'
----f f'iØ=Üf'
----f 48@3
/> ls80 /hd0/1/ -e cp866
status = 6 end_of_file, count = 6
total = 6
status = 6 end_of_file, count = 7
total = 7
----f .
----f ..
----f dir0
----f ¤¨à_
----f ___
----f ___
----f ¤¨à3
/> ls80 /hd0/1/ -e default
status = 6 end_of_file, count = 6
total = 6
status = 6 end_of_file, count = 7
total = 7
----f .
----f ..
----f d
----f 48@f'
----f f'f'f'
----f f'iØ=Üf'
----f 48@3
/> ls80 /hd0/1/â<>¦â<C2A6>¦â<C2A6>¦/ -e utf8
status = 6 end_of_file, count = 3
@ -212,4 +220,37 @@ total = 3
----f ..
----- D09;3
/> ls80 /hd0/1/â<>¦ðŸ©â<C2A9>¦/ -e utf8
status = 6 end_of_file, count = 5
total = 5
----f .
----f ..
----f ðŸ©â<C2A9>¦â<C2A6>¦
----f â<>¦ðŸ©â<C2A9>¦
----f â<>¦â<C2A6>¦ðŸ©
/> ls80 /hd0/1/â<>¦ðŸ©â<C2A9>¦/ -e utf16
status = 6 end_of_file, count = 5
total = 5
----f .
----f ..
----f iØ=Üf'f'
----f f'iØ=Üf'
----f f'f'iØ=Ü
/> ls80 /hd0/1/â<>¦ðŸ©â<C2A9>¦/ -e cp866
status = 6 end_of_file, count = 5
total = 5
----f .
----f ..
----f ___
----f ___
----f ___
/> ls80 /hd0/1/â<>¦ðŸ©â<C2A9>¦/ -e default
status = 6 end_of_file, count = 5
total = 5
----f .
----f ..
----f iØ=Üf'f'
----f f'iØ=Üf'
----f f'f'iØ=Ü
/> disk_del hd0

View File

@ -50,4 +50,9 @@ ls80 /hd0/1/дир3/ -e utf16
ls80 /hd0/1/дир3/ -e cp866
ls80 /hd0/1/дир3/ -e default
ls80 /hd0/1/❦👩❦/ -e utf8
ls80 /hd0/1/❦👩❦/ -e utf16
ls80 /hd0/1/❦👩❦/ -e cp866
ls80 /hd0/1/❦👩❦/ -e default
disk_del hd0

View File

@ -399,8 +399,14 @@ status = 0 success, count = 16388096
/> read70 /hd0/1/file_btree_l2 77777 7777777 -h
status = 0 success, count = 7777777
1ec63ef6ec1c57394d07f678d5b4c4f536805b287571996a65d7b22389491022
/> read70 /hd0/1/file_btree_l2 1 4097 -h
/> read70 /hd0/1/file_btree_l2 1 0x1001 -h
status = 0 success, count = 4097
9d8f63204dd7877d5492ace8aa0b05b6ca2e1c483fecb50da68abfbb91f1cd04
/> read70 /hd0/1/file_btree_l2 0x1000 0x1000 -h
status = 0 success, count = 4096
bb66ddff9fa267bf7a42153d0de9dc029b775e23d6378ade96e6c92ceaf6841a
/> read70 /hd0/1/file_btree_l2 0x1000 0x1001 -h
status = 0 success, count = 4097
aa026c31286b2ba83a047f8d07baa712b34da983235afb79b4d2cb60cf668f2b
/> disk_del hd0

View File

@ -8,6 +8,8 @@ ls80 /hd0/1/dir_btree_l2 -f 193100 -c 99
read70 /hd0/1/file_btree_l2 0 16388096 -h
read70 /hd0/1/file_btree_l2 77777 7777777 -h
read70 /hd0/1/file_btree_l2 1 4097 -h
read70 /hd0/1/file_btree_l2 1 0x1001 -h
read70 /hd0/1/file_btree_l2 0x1000 0x1000 -h
read70 /hd0/1/file_btree_l2 0x1000 0x1001 -h
disk_del hd0