f3read: tighten assert()

The last assert() in iterate_files() was doing an integer division
before comparing values, so there was potential for a bug going
silent due to the truncation fo the integer division.
This patch rewrite the test with a multiplication.
This commit is contained in:
Michel Machado
2020-06-23 07:14:21 -04:00
parent ab76ce4f85
commit 099eb7fd42

View File

@@ -382,7 +382,7 @@ static void iterate_files(const char *path, const long *files,
files++;
}
assert(!gettimeofday(&t2, NULL));
assert(tot_size / SECTOR_SIZE ==
assert(tot_size == SECTOR_SIZE *
(tot_ok + tot_corrupted + tot_changed + tot_overwritten));
/* Notice that not reporting `missing' files after the last file