COMMON_HEADER_SIZE had not been corrected after modifying strings
sections.
Check that node free space is consistent with what is written to
disk.
Change-Id: I9186f8b2e32159d9f2c771358c337aaf0ebb38c3
Signed-off-by: Loïc Prieur-Drevon <loic.prieurdrevon@gmail.com>
Reviewed-on: https://git.eclipse.org/r/83456
Reviewed-by: Genevieve Bastien <gbastien+lttng@versatic.net>
Tested-by: Genevieve Bastien <gbastien+lttng@versatic.net>
Reviewed-by: Hudson CI
* <pre>
* 1 - byte (type)
* 16 - 2x long (start time, end time)
* <pre>
* 1 - byte (type)
* 16 - 2x long (start time, end time)
- * 16 - 4x int (seq number, parent seq number, intervalcount,
- * strings section pos.)
+ * 16 - 3x int (seq number, parent seq number, intervalcount)
* 1 - byte (done or not)
* </pre>
*/
private static final int COMMON_HEADER_SIZE = Byte.BYTES
+ 2 * Long.BYTES
* 1 - byte (done or not)
* </pre>
*/
private static final int COMMON_HEADER_SIZE = Byte.BYTES
+ 2 * Long.BYTES
+ Byte.BYTES;
// ------------------------------------------------------------------------
+ Byte.BYTES;
// ------------------------------------------------------------------------
/* Back to us, we write the intervals */
fIntervals.forEach(i -> i.writeInterval(buffer));
/* Back to us, we write the intervals */
fIntervals.forEach(i -> i.writeInterval(buffer));
+ if (blockSize - buffer.position() != getNodeFreeSpace()) {
+ throw new IllegalStateException("Wrong free space: Actual: " + (blockSize - buffer.position()) + ", Expected: " + getNodeFreeSpace()); //$NON-NLS-1$ //$NON-NLS-2$
+ }
/*
* Fill the rest with zeros
*/
/*
* Fill the rest with zeros
*/