1
1

vfs_parse_ls_lga: Make tests output more verbose

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Этот коммит содержится в:
Slava Zanko 2011-10-17 14:57:28 +03:00
родитель cd658f51f6
Коммит d5e6dceed8

Просмотреть файл

@ -96,28 +96,28 @@ message (int flags, const char *title, const char *text, ...)
/* --------------------------------------------------------------------------------------------- */
#define check_one_stat_field(etalon_stat, test_stat, field, format)\
#define check_one_stat_field(etalon_stat, test_stat, field, format, input_str)\
{\
fail_unless(etalon_stat.field == test_stat.field,\
"\netalon."#field" = " format "\nactual."#field" = " format "\n",\
etalon_stat.field, test_stat.field);\
"\ninput string: %s\netalon."#field" = " format "\nactual."#field" = " format "\n",\
input_str, etalon_stat.field, test_stat.field);\
}
#define check_stat_struct(etalon_stat, test_stat)\
#define check_stat_struct(etalon_stat, test_stat, input_str)\
{\
check_one_stat_field(etalon_stat, test_stat, st_dev, "%zu");\
check_one_stat_field(etalon_stat, test_stat, st_ino, "%zu");\
check_one_stat_field(etalon_stat, test_stat, st_ino, "%zu");\
check_one_stat_field(etalon_stat, test_stat, st_mode, "%04x");\
check_one_stat_field(etalon_stat, test_stat, st_uid, "%u");\
check_one_stat_field(etalon_stat, test_stat, st_gid, "%u");\
check_one_stat_field(etalon_stat, test_stat, st_rdev, "%zu");\
check_one_stat_field(etalon_stat, test_stat, st_size, "%zd");\
check_one_stat_field(etalon_stat, test_stat, st_blksize, "%zu");\
check_one_stat_field(etalon_stat, test_stat, st_blocks, "%zd");\
check_one_stat_field(etalon_stat, test_stat, st_atime, "%zd");\
check_one_stat_field(etalon_stat, test_stat, st_mtime, "%zd");\
check_one_stat_field(etalon_stat, test_stat, st_ctime, "%zd");\
check_one_stat_field(etalon_stat, test_stat, st_dev, "%zu", input_str);\
check_one_stat_field(etalon_stat, test_stat, st_ino, "%zu", input_str);\
check_one_stat_field(etalon_stat, test_stat, st_ino, "%zu", input_str);\
check_one_stat_field(etalon_stat, test_stat, st_mode, "%04x", input_str);\
check_one_stat_field(etalon_stat, test_stat, st_uid, "%u", input_str);\
check_one_stat_field(etalon_stat, test_stat, st_gid, "%u", input_str);\
check_one_stat_field(etalon_stat, test_stat, st_rdev, "%zu", input_str);\
check_one_stat_field(etalon_stat, test_stat, st_size, "%zd", input_str);\
check_one_stat_field(etalon_stat, test_stat, st_blksize, "%zu", input_str);\
check_one_stat_field(etalon_stat, test_stat, st_blocks, "%zd", input_str);\
check_one_stat_field(etalon_stat, test_stat, st_atime, "%zd", input_str);\
check_one_stat_field(etalon_stat, test_stat, st_mtime, "%zd", input_str);\
check_one_stat_field(etalon_stat, test_stat, st_ctime, "%zd", input_str);\
}
static void check_vfs_parse_ls_lga_call(const char *input_data, int etalon_result,
@ -141,8 +141,7 @@ const char *etalon_filename, const char *etalon_linkname, struct stat etalon_sta
|| (linkname == NULL && etalon_linkname == linkname),
"\nactual linkname '%s'\netalon linkname '%s'", linkname, etalon_linkname);
check_stat_struct(etalon_stat, test_stat);
check_stat_struct(etalon_stat, test_stat, input_data);
}
START_TEST (test_vfs_parse_ls_lga)