On Mon Mar 23 16:39:54 2015, SREZIC wrote:
Show quoted text> With bleadperl two tests fail when running the test suite:
>
> Caught error while trying to reinstantiate axis from hash dump
> (Missing 'bins' and 'nbins' hash entries at t/210axisdump.t line 27.
> ). Hash was:
> $VAR1 = {};
> # Tests were run but no plan was declared and done_testing() was not
> seen.
> # Looks like your test exited with 255 just after 4.
> t/210axisdump.t ........
> Dubious, test returned 255 (wstat 65280, 0xff00)
> All 4 subtests passed
>
> ...
>
> Need 'axises' hash element as an array reference at t/330histodump.t
> line 16.
> # Tests were run but no plan was declared and done_testing() was not
> seen.
> # Looks like your test exited with 255 just after 1.
> t/330histodump.t .......
> Dubious, test returned 255 (wstat 65280, 0xff00)
> All 1 subtests passed
>
> Tests pass until (including) perl 5.21.6.
Starting with perl revision v5.21.6-135-g6d59e61 perl always #includes
assert.h, and for non-debugging builds, defines NDEBUG.
This means that this code in Histogram.xs:
if (MH_AXIS_ISFIXBIN(axis)) {
assert( hv_stores(hash, "nbins", newSVuv(MH_AXIS_NBINS(axis))) );
assert( hv_stores(hash, "min", newSVnv(MH_AXIS_MIN(axis))) );
assert( hv_stores(hash, "max", newSVnv(MH_AXIS_MAX(axis))) );
}
no longer actually calls hv_stores().
You *could* put:
#undef NDEBUG
before your:
#include "assert.h"
but the above code is an abuse of assert(), ideally the expression
supplied to assert() shouldn't have side-effects.
It also slows down some of the code to perl debugging build speed,
since all of the assertions in perl's macros that are normally skipped
for non-debug builds will be tested.
Ideally you should either test each hv_stores() for failure:
if (!hv_stores(hash, "nbins", newSVuv(MH_AXIS_NBINS(axis))))
croak("hv_stores nbins failed");
or define a new macro that behaves the way you want.
Tony