Skip to contentSkip to conversation

ext4/044: Add missing check for return value

PATCH In review Pavel Reichl 2 participants 2 messages Sep 20, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ext4/044: Add missing check for return value

When calling _within_tolerance either return value or text output should be checked. Otherwise the function is useless for a test.

---
 tests/ext4/044     | 8 +++-----
 tests/ext4/044.out | 4 +++-
 2 files changed, 6 insertions(+), 6 deletions(-)
tests/ext4/044 +3 -5
index 158e2ac5..50de5a40 100755
@@ -18,8 +18,6 @@ _require_scratch
 _require_test_program "t_get_file_time"
 _require_metadata_journaling
 
-echo "Silence is golden"
-
 echo "Test timestamps with 256 inode size one device $SCRATCH_DEV" >$seqres.full
 _scratch_mkfs -t ext3 -I 256 >> $seqres.full 2>&1
 _scratch_mount
@@ -49,9 +47,9 @@ nsec_mtime: $nsec_mtime, nsec_ctime: $nsec_ctime, cur_time[ns]: $nsec)"
 fi
 
 # Check difference between file time and current time
-_within_tolerance "sec_atime" $sec_atime $sec 1
-_within_tolerance "sec_mtime" $sec_mtime $sec 1
-_within_tolerance "sec_ctime" $sec_ctime $sec 1
+_within_tolerance "sec_atime" $sec_atime $sec 1 -v
+_within_tolerance "sec_mtime" $sec_mtime $sec 1 -v
+_within_tolerance "sec_ctime" $sec_ctime $sec 1 -v
 
 _scratch_unmount >> $seqres.full 2>&1
 
tests/ext4/044.out +3 -1
index 12a61dc4..8a3a8072 100644
@@ -1,2 +1,4 @@
 QA output created by 044
-Silence is golden
+sec_atime is in range
+sec_mtime is in range
+sec_ctime is in range
Signature · 1 line
2.37.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Pavel Reichl

When calling _within_tolerance either return value or text output should be checked. Otherwise the function is useless for a test.

---

Make sense,

Quoted 43 lines
 tests/ext4/044     | 8 +++-----
 tests/ext4/044.out | 4 +++-
 2 files changed, 6 insertions(+), 6 deletions(-)
tests/ext4/044 +3 -5
index 158e2ac5..50de5a40 100755
@@ -18,8 +18,6 @@ _require_scratch
 _require_test_program "t_get_file_time"
 _require_metadata_journaling
 
-echo "Silence is golden"
-
 echo "Test timestamps with 256 inode size one device $SCRATCH_DEV" >$seqres.full
 _scratch_mkfs -t ext3 -I 256 >> $seqres.full 2>&1
 _scratch_mount
@@ -49,9 +47,9 @@ nsec_mtime: $nsec_mtime, nsec_ctime: $nsec_ctime, cur_time[ns]: $nsec)"
 fi
 
 # Check difference between file time and current time
-_within_tolerance "sec_atime" $sec_atime $sec 1
-_within_tolerance "sec_mtime" $sec_mtime $sec 1
-_within_tolerance "sec_ctime" $sec_ctime $sec 1
+_within_tolerance "sec_atime" $sec_atime $sec 1 -v
+_within_tolerance "sec_mtime" $sec_mtime $sec 1 -v
+_within_tolerance "sec_ctime" $sec_ctime $sec 1 -v
 
 _scratch_unmount >> $seqres.full 2>&1
 
tests/ext4/044.out +3 -1
index 12a61dc4..8a3a8072 100644
@@ -1,2 +1,4 @@
 QA output created by 044
-Silence is golden
+sec_atime is in range
+sec_mtime is in range
+sec_ctime is in range
Signature · 1 line
2.37.3