Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some tests fail #35

Open
dschwoerer opened this issue Apr 29, 2024 · 1 comment
Open

Some tests fail #35

dschwoerer opened this issue Apr 29, 2024 · 1 comment

Comments

@dschwoerer
Copy link
Contributor

The failing tests:
test-failures.log.gz

full log:
builder-live.log.gz

If I understood you correctly, this is a known issue.
In that case feel free to close this as "won't fix".

Just looking at the first 3 failures:


    def test_bn_f_ed_input_128(self):
        vals = [123456789.]
        fmt = '''(BN, F10.0)'''
        result = '''123456792.'''
        eds, rev_eds = _parser(_lexer(fmt))
>       self.assertEqual(result, _output(eds, rev_eds, vals))
E       AssertionError: '123456792.' != '123456789.'
E       - 123456792.
E       ?         -
E       + 123456789.
E       ?        +

tests/autogen/output/ifort/9_1_linux_intel/test_bn-f_output.py:909: AssertionError
____________ BN_FEditDescriptorBatchTestCase.test_bn_f_ed_input_178 ____________

self = <test_bn-f_output.BN_FEditDescriptorBatchTestCase testMethod=test_bn_f_ed_input_178>

    def test_bn_f_ed_input_178(self):
        vals = [-0.01]
        fmt = '''(BN, F2.1)'''
        result = '''.0'''
        eds, rev_eds = _parser(_lexer(fmt))
>       self.assertEqual(result, _output(eds, rev_eds, vals))
E       AssertionError: '.0' != '**'
E       - .0
E       + **

tests/autogen/output/ifort/9_1_linux_intel/test_bn-f_output.py:1259: AssertionError
____________ BN_FEditDescriptorBatchTestCase.test_bn_f_ed_input_180 ____________

self = <test_bn-f_output.BN_FEditDescriptorBatchTestCase testMethod=test_bn_f_ed_input_180>

    def test_bn_f_ed_input_180(self):
        vals = [-0.001]
        fmt = '''(BN, F2.1)'''
        result = '''.0'''
        eds, rev_eds = _parser(_lexer(fmt))
>       self.assertEqual(result, _output(eds, rev_eds, vals))
E       AssertionError: '.0' != '**'
E       - .0

I do not think that is something that should be 'fixed' ...

@brendanarnold
Copy link
Owner

Yeah - in the first case the test fails because of a limitation in floating point precision and isn't really a fail. Basically the numbers beyond a certain number of decimal places will be random

In the second and third case, I'm not sure but I expect that these are compiler implementation differences - the test data is generated from the Intel ifort compiler, whereas the FortranFormat code is based of the source from gfortran.

The intention of the library was to emulate different compilers using configuration flags but really I think this is a low priority for most. I'm happy for this issue to remain as a bug until those flags are implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants