|Status:||Archived||Start date:||03 Aug 2016|
Let the Python function getSample(), exported by ExportToPython, return None instead of a multilayer. Then
$ bin/PyCoreStandardTest HexParaCrystal Core simulation will be compared with /G/ba/build/tmp/pysuite_HexParaCrystal_out generated by command '/usr/bin/python2.7 /G/ba/build/tmp/pysuite_HexParaCrystal.py' Traceback (most recent call last): File "/G/ba/build/tmp/pysuite_HexParaCrystal.py", line 75, in <module> runSimulation('/G/ba/build/tmp/pysuite_HexParaCrystal_out') File "/G/ba/build/tmp/pysuite_HexParaCrystal.py", line 68, in runSimulation simulation.setSample(sample) File "/G/ba/build/lib/libBornAgainCore.py", line 15054, in setSample return _libBornAgainCore.Simulation_setSample(self, sample) ValueError: invalid null reference in method 'Simulation_setSample', argument 2 of type 'ISample const &' HexParaCrystal Interference function of 2D hexagonal pa[SUCCESS] 1.0004e-13
When just running ctest, all this output is overlooked since the test passes. This indicates two problems, possibly unrelated:
- The ValueError is somehow catched, and not detected by CTest.
- A numeric agreement of 1e-13 is found, although the simulation has no chance to return anything but zeros. This is perhaps related with the dubitable definition of almostEqual (#1541)