Skip to content

Add type check and tests for Entity::mergeAndReset

Entity::mergeAndReset now throws an exception if it is passed an Entity of a different type.

A test has also been added to test merges involving Entity objects created in different ways (which caused them to show different types in a previous implementation). The current implementation passes the test.

I was unable to reproduce a bug I had previously seen in Allen (where two Entities with seemingly identical type indices would fail the check). However, the offending code has since been removed in an update to Allen so this is no longer an issue. I suspect the issue may have arisen from comparing between Histograms constructed in code within different Allen libraries but it is no longer practical or necessary to investigate further.

Addresses #207 (closed)

Edited by Daniel Charles Craik

Merge request reports