Use signed type for left record and files size in ESM3 reader context

Otherwise reading some of the records like ESM::CellRef without a subrecord after could lead to underflow of ESM_Context::leftRec which makes ESM::ESMReader::hasMoreSubs to return true and load hangs for a while trying to read the same subrecord many times.

Fix ESM::Variant tests since it's now required to have a record for any ESM data. Add 16 (size of record header) to all expected data sizes.

Add tests for saving and loading ESM::CellRef and some other records.

Throw exception on failed write when generated RefNum is not properly written. Writing corrupted data doesn't make any sense.

Merge request reports

Loading