Some unit test for RR/SUSP entries generation and size calculation.

This commit is contained in:
Vreixo Formoso
2007-12-27 00:45:44 +01:00
parent dd97f67ee4
commit c9957cb25e
2 changed files with 275 additions and 3 deletions

View File

@ -560,13 +560,12 @@ size_t rrip_calc_len(Ecma119Image *t, Ecma119Node *n, int type,
if (su_size + 28 <= space) {
/* the CE entry fills without reducing NM */
su_size += 28;
cew = 1;
} else {
/* we need to reduce NM */
*ce = (28 - (space - su_size)) + 5;
su_size = space;
cew = 1;
}
cew = 1;
} else {
sl_len += clen;
}
@ -1069,6 +1068,10 @@ void rrip_write_susp_fields(Ecma119Image *t, struct susp_info *info,
{
size_t i;
size_t pos = 0;
if (info->n_susp_fields == 0) {
return;
}
for (i = 0; i < info->n_susp_fields; i++) {
memcpy(buf + pos, info->susp_fields[i], info->susp_fields[i][2]);