+
+#ifdef UNITTEST
+
+#include <stdlib.h>
+#include <stdio.h>
+
+errcode_t
+profile_get_boolean(profile_t profile, const char *name, const char *subname,
+ const char *subsubname, int def_val, int *ret_boolean)
+{
+ return 0;
+}
+
+void print_e2fsck_message(e2fsck_t ctx, const char *msg,
+ struct problem_context *pctx, int first,
+ int recurse)
+{
+ return;
+}
+
+void fatal_error(e2fsck_t ctx, const char *msg)
+{
+ return;
+}
+
+void preenhalt(e2fsck_t ctx)
+{
+ return;
+}
+
+errcode_t
+profile_get_string(profile_t profile, const char *name, const char *subname,
+ const char *subsubname, const char *def_val,
+ char **ret_string)
+{
+ return 0;
+}
+
+int ask (e2fsck_t ctx, const char * string, int def)
+{
+ return 0;
+}
+
+int verify_problem_table(e2fsck_t ctx)
+{
+ struct e2fsck_problem *curr, *prev = NULL;
+ int rc = 0;
+
+ for (prev = NULL, curr = problem_table; curr->e2p_code; prev = curr++) {
+ if (prev == NULL)
+ continue;
+
+ if (curr->e2p_code > prev->e2p_code)
+ continue;
+
+ if (curr->e2p_code == prev->e2p_code)
+ fprintf(stderr, "*** Duplicate in problem table:\n");
+ else
+ fprintf(stderr, "*** Unordered problem table:\n");
+
+ fprintf(stderr, "curr code = 0x%08x: %s\n",
+ curr->e2p_code, curr->e2p_description);
+ fprintf(stderr, "*** prev code = 0x%08x: %s\n",
+ prev->e2p_code, prev->e2p_description);
+
+ fprintf(stderr, "*** This is a %sprogramming error in e2fsck\n",
+ (curr->e2p_code == prev->e2p_code) ? "fatal " : "");
+
+ rc = 1;
+ }
+
+ return rc;
+}
+
+int main(int argc, char *argv[])
+{
+ e2fsck_t ctx;
+ int rc;
+
+ rc = verify_problem_table(ctx);
+ if (rc == 0)
+ printf("e2fsck problem table verified\n");
+
+ return rc;
+}
+#endif /* UNITTEST */