Repository navigation
test_mc01td_D failure on Windows #102
Description
Activity
Can you switch to
pytestinstead of oldunittest?Lines 53 to 55 in ac53a0a
C STABLE (output) LOGICAL C Contains the value .TRUE. if P(x) is stable and the value C .FALSE. otherwise (see also NUMERICAL ASPECTS). Line 8 in ac53a0a
logical intent(out) :: stable Lines 50 to 51 in ac53a0a
stable : int Equal to 1 if P(x) if stable, 0 otherwise. Line 58 in ac53a0a
out = _wrapper.mc01td(dico,dp,p) Slycot/slycot/tests/test_mc.py
Lines 14 to 32 in ac53a0a
def test_mc01td(self): """ test_mc01td: doc example data from http://slicot.org/objects/software/shared/doc/MC01TD.html """ (dp, stable, nz) = mc01td('C', 4, [2, 0, 1, -1, 1]) self.assertEqual(dp, 4) self.assertEqual(stable, 0) self.assertEqual(nz, 2) def test_mc01td_D(self): """ test_mc01td_D: test discrete option """ (dp, stable, nz) = mc01td('D', 3, [1, 2, 3, 4]) self.assertEqual(dp, 3) self.assertEqual(stable, 1) self.assertEqual(nz, 0) (dp, stable, nz) = mc01td('D', 3, [4, 3, 2, 1]) self.assertEqual(dp, 3) self.assertEqual(stable, 0) self.assertEqual(nz, 3) There is something wrong with the documented but nowhere defined mapping of
logicaltoint. Does the Windows compiler map logical differently?Some difference between (old) Intel compilers and gfortran: https://stackoverflow.com/questions/37293641/implicit-conversion-integer-logical-in-fortran-if-statement
If I comment out that assertion, the test passes.
We could check in
slycot.math.mc01tdfor out[1] being non-zero, and make the output 0 or 1 (though I don't know if.FALSE.always maps to 0). Or we could change the Fortran function to output an integer 0 or 1, instead of logical type."armflang" has
.TRUE.set to -1, according to docs from mid-2018 [1]. I couldn't find anything else about flang conventions, neither via Google, norflang --help.Are we using
flangin any of the Travis CI builds?I am already working on a PR. Stand by.
See attached build log. The failure is
Build script:
build log: slycot-win-build.txt