Whamcloud - gitweb
e2fsck: Add test code in problem.c to verify problem codes
authorAndreas Dilger <adilger@sun.com>
Mon, 27 Apr 2009 22:59:24 +0000 (16:59 -0600)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 3 May 2009 01:10:44 +0000 (21:10 -0400)
commit7494cbfd59eb61301e168dd8aa4b19c2f4b73532
tree4133a712ada309fc6b6dbff8b3e9a138e40c3467
parente62847c5db56ebdab8446defd718ec42e6b48cac
e2fsck: Add test code in problem.c to verify problem codes

We've hit a number of cases where the error codes in problem.h have
been assigned duplicate values compared to problems in our own e2fsck
patches, and this can lead to confusing and difficult to find bugs
in e2fsck (e.g. wrong problem messages, incorrect repair action, etc).

Attached is a test case for the problem.c file to ensure that the
problem table is sorted and does not contain any duplicate values.
Having the problem table sorted allows the correctness checking to be
very simple, and if it ever became important for performance we could
use binary searching of the problem table for the specific problem code.

Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/Makefile.in
e2fsck/problem.c
e2fsck/problem.h