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

test_evaluation.py::test_system_specific_long_integer fails on s390x #760

Closed
davide125 opened this issue Jan 22, 2023 · 9 comments
Closed

Comments

@davide125
Copy link
Contributor

Description

When building the latest stable release (5.0.2) on Fedora on s390x (which is a big-endian architecture), test_evaluation.py::test_system_specific_long_integer fails with AssertionError: UnsignedInteger32.

How to Reproduce

This unfortunately isn't terribly easy to repro without access to a s390x box (or emulating one with qemu or Hercules, which can be quite involved). Happy to help test a potential fix on your behalf though if needed.

Output Given

=================================== FAILURES ===================================
______________________ test_system_specific_long_integer _______________________
    def test_system_specific_long_integer():
        evaluate(
            """
        WRb[bytes_, form_] := Module[{str, res={}, byte}, str = OpenWrite[BinaryFormat -> True];
        BinaryWrite[str, bytes, form];
        str = OpenRead[Close[str], BinaryFormat -> True];
        While[Not[SameQ[byte = BinaryRead[str], EndOfFile]], res = Join[res, {byte}];];
        Close[str]; res]
        """
        )
        for str_expr, str_expected, message in (
            (
                r'WRb[{1885507541, 4157323149}, Table["UnsignedInteger32", {2}]]',
                r"{213, 143, 98, 112, 141, 183, 203, 247}",
                "UnsignedInteger32",
            ),
            (
                r'WRb[{384206740, 1676316040}, Table["UnsignedInteger32", {2}]]',
                r"{148, 135, 230, 22, 136, 141, 234, 99}",
                "UnsignedInteger32 - 2nd test",
            ),
            (
                r'WRb[7079445437368829279, "UnsignedInteger64"]',
                r"{95, 5, 33, 229, 29, 62, 63, 98}",
                "UnsignedInteger64",
            ),
            (
                r'WRb[5381171935514265990, "UnsignedInteger64"]',
                r"{134, 9, 161, 91, 93, 195, 173, 74}",
                "UnsignedInteger64 - 2nd test",
            ),
            (
                r'WRb[293382001665435747348222619884289871468, "UnsignedInteger128"]',
                r"{108, 78, 217, 150, 88, 126, 152, 101, 231, 134, 176, 140, 118, 81, 183, 220}",
                "UnsignedInteger128",
            ),
            (
                r'WRb[253033302833692126095975097811212718901, "UnsignedInteger128"]',
                r"{53, 83, 116, 79, 81, 100, 60, 126, 202, 52, 241, 48, 5, 113, 92, 190}",
                "UnsignedInteger128 - 2nd test",
            ),
            # This works but the $Precision is coming out UnsignedInt128 rather tha
            # UnsignedInt32
            # (
            #     'Eigenvalues[{{-8, 12, 4}, {12, -20, 0}, {4, 0, -2}}, Method->"mpmath"]',
            #     "{{-0.842134, -0.396577, 0.365428}, "
            #     " { 0.5328,   -0.507232, 0.677377}, "
            #     " {-0.0832756, 0.765142, 0.638454}}",
            #     "Eigenvalues via mpmath",
            # ),
        ):
    
>           check_evaluation(str_expr, str_expected, message)
test/test_evaluation.py:244: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
str_expr = 'ToString[WRb[{1885507541, 4157323149}, Table["UnsignedInteger32", {2}]]]'
str_expected = 'ToString[{213, 143, 98, 112, 141, 183, 203, 247}]'
failure_message = 'UnsignedInteger32', hold_expected = False
to_string_expr = True, to_string_expected = True, to_python_expected = False
expected_messages = None
    def check_evaluation(
        str_expr: str,
        str_expected: str,
        failure_message: str = "",
        hold_expected: bool = False,
        to_string_expr: bool = True,
        to_string_expected: bool = True,
        to_python_expected: bool = False,
        expected_messages: Optional[tuple] = None,
    ):
        """
        Helper function to test Mathics expression against
        its results
    
        Compares the expressions represented by ``str_expr`` and  ``str_expected`` by evaluating
        the first, and optionally, the second.
    
        to_string_expr: If ``True`` (default value) the result of the evaluation is converted
                        into a Python string. Otherwise, the expression is kept as an Expression
                        object. If this argument is set to ``None``, the session is reset.
    
        failure_message (str): message shown in case of failure
        hold_expected (bool): If ``False`` (default value) the ``str_expected`` is evaluated. Otherwise,
                              the expression is considered literally.
    
        to_string_expected: If ``True`` (default value) the expected expression is
                        evaluated and then converted to a Python string. result of the evaluation is converted
                        into a Python string. If ``False``, the expected expression is kept as an Expression object.
    
        to_python_expected: If ``True``, and ``to_string_expected`` is ``False``, the result of evaluating ``str_expr``
                        is compared against the result of the evaluation of ``str_expected``, converted into a
                        Python object.
    
        expected_messages ``Optional[tuple[str]]``: If a tuple of strings are passed into this parameter, messages and prints raised during
                        the evaluation of ``str_expr`` are compared with the elements of the list. If ``None``, this comparison
                        is ommited.
        """
        if str_expr is None:
            reset_session()
            return
    
        if to_string_expr:
            str_expr = f"ToString[{str_expr}]"
            result = evaluate_value(str_expr)
        else:
            result = evaluate(str_expr)
    
        outs = [out.text for out in session.evaluation.out]
    
        if to_string_expected:
            if hold_expected:
                expected = str_expected
            else:
                str_expected = f"ToString[{str_expected}]"
                expected = evaluate_value(str_expected)
        else:
            if hold_expected:
                if to_python_expected:
                    expected = str_expected
                else:
                    expected = evaluate(f"HoldForm[{str_expected}]").elements[0]
            else:
                expected = evaluate(str_expected)
                if to_python_expected:
                    expected = expected.to_python(string_quotes=False)
    
        print(time.asctime())
        if failure_message:
            print((result, expected))
>           assert result == expected, failure_message
E           AssertionError: UnsignedInteger32
test/helper.py:91: AssertionError
----------------------------- Captured stdout call -----------------------------
Sun Jan 22 00:32:02 2023
('{112, 98, 143, 213, 247, 203, 183, 141}', '{213, 143, 98, 112, 141, 183, 203, 247}')
=============================== warnings summary ===============================
../../../../usr/lib/python3.11/site-packages/pint/registry.py:539
../../../../usr/lib/python3.11/site-packages/pint/registry.py:539
  /usr/lib/python3.11/site-packages/pint/registry.py:539: DeprecationWarning: read_binary is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
    rbytes = importlib_resources.read_binary(__package__, file)
mathics/core/parser/convert.py:31: 8 warnings
test/test_context.py: 1 warning
test/test_structure.py: 1 warning
test/builtin/test_assignment.py: 5 warnings
test/builtin/colors/test_colors.py: 3 warnings
test/builtin/numbers/test_linalg.py: 1 warning
test/core/test_arithmetic.py: 6 warnings
test/package/test_combinatorica.py: 1 warning
  /builddir/build/BUILD/Mathics3-5.0.2/mathics/core/parser/convert.py:31: DeprecationWarning: invalid escape sequence '\!'
    return s.encode("raw_unicode_escape").decode("unicode_escape")
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED test/test_evaluation.py::test_system_specific_long_integer - Assertion...
= 1 failed, 1103 passed, 25 skipped, 1 deselected, 7 xfailed, 28 warnings in 163.42s (0:02:43) =

Expected behavior

The test should not fail

Your Environment

I can repro this reliably on Fedora Rawhile when building for the s390x architecture. Builds on other architectures all work fine.

Workarounds

I can gate out the test, but that just papers over the problem.

Priority

It's blocking the inclusion of Mathics in Fedora.

Additional context

This came up during the Fedora package review for Mathics.

@rocky
Copy link
Member

rocky commented Jan 22, 2023

As you mention, I suspect it is a bigendian difference. What is the output when you run using mathics:

$ mathics

Mathics 5.0.3dev0
on CPython 3.8.16 (default, Dec 13 2022, 19:27:23) 
using SymPy 1.10.1, mpmath 1.2.1, numpy 1.24.0, cython Not installed

...
Quit by evaluating Quit[] or by pressing CONTROL-D.

In[1]:= WRb[bytes_, form_] := Module[{str, res={}, byte}, str = OpenWrite[BinaryFormat -> True];
        BinaryWrite[str, bytes, form];
        str = OpenRead[Close[str], BinaryFormat -> True];
        While[Not[SameQ[byte = BinaryRead[str], EndOfFile]], res = Join[res, {byte}];];
        Close[str]; res]
                                Out[1]= None

In[2]:= WRb[{1885507541, 4157323149}, Table["UnsignedInteger32", {2}]]
Out[2]= {213, 143, 98, 112, 141, 183, 203, 247}

?

I suspect his will come out {143, 213, 112, 98, ...} on a bigendian CPU.

@davide125
Copy link
Contributor Author

Here you go:

<mock-chroot> sh-5.2# mathics

Mathics 5.0.2
on CPython 3.11.1 (main, Jan  6 2023, 00:00:00) [GCC 12.2.1 20221121 (Red Hat 12.2.1-4)]
using SymPy 1.11.1, mpmath 1.2.1, numpy 1.23.5, cython 0.29.32

Copyright (C) 2011-2022 The Mathics Team.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions.
See the documentation for the full license.

Quit by evaluating Quit[] or by pressing CONTROL-D.

In[1]:= WRb[bytes_, form_] := Module[{str, res={}, byte}, str = OpenWrite[BinaryFormat -> True];
        BinaryWrite[str, bytes, form];
        str = OpenRead[Close[str], BinaryFormat -> True];
        While[Not[SameQ[byte = BinaryRead[str], EndOfFile]], res = Join[res, {byte}];];
        Close[str]; res]
Out[1]= None

In[2]:= WRb[{1885507541, 4157323149}, Table["UnsignedInteger32", {2}]]
Out[2]= {112, 98, 143, 213, 247, 203, 183, 141}

In[3]:= 

@rocky
Copy link
Member

rocky commented Jan 22, 2023

Ok - thanks. Now try changing the failing test to the code in https://github.com/Mathics3/mathics-core/blob/06ae8117f7fcfabcc34855b9db3226b011326f36/test/test_evaluation.py

and try running it using

using:

$ cd <mathics-core-root>
$ python -m pytest test/test_evaluation.py -s

If it succeeds, let me know. If not, send the output. It will look something like:

test/test_evaluation.py ..............................sssss............Sun Jan 22 03:01:47 2023
('{213, 143, 98, 112, 141, 183, 203, 247}', '{213, 143, 98, 112, 141, 183, 203, 247}')
Sun Jan 22 03:01:47 2023
('{148, 135, 230, 22, 136, 141, 234, 99}', '{148, 135, 230, 22, 136, 141, 234, 99}')
Sun Jan 22 03:01:47 2023 ...

but the dates and numbers will be different.

Thanks.

@davide125
Copy link
Contributor Author

I kicked off a new test build with this applied and it failed with:

=================================== FAILURES ===================================
______________________ test_system_specific_long_integer _______________________
    def test_system_specific_long_integer():
        evaluate(
            """
        WRb[bytes_, form_] := Module[{str, res={}, byte}, str = OpenWrite[BinaryFormat -> True];
        BinaryWrite[str, bytes, form];
        str = OpenRead[Close[str], BinaryFormat -> True];
        While[Not[SameQ[byte = BinaryRead[str], EndOfFile]], res = Join[res, {byte}];];
        Close[str]; res]
        """
        )
    
        test_input_and_name = (
            (
                'WRb[{1885507541, 4157323149}, Table["UnsignedInteger32", {2}]]',
                "UnsignedInteger32",
            ),
            (
                'WRb[{384206740, 1676316040}, Table["UnsignedInteger32", {2}]]',
                "UnsignedInteger32 - 2nd test",
            ),
            (
                'WRb[7079445437368829279, "UnsignedInteger64"]',
                "UnsignedInteger64",
            ),
            (
                'WRb[5381171935514265990, "UnsignedInteger64"]',
                "UnsignedInteger64 - 2nd test",
            ),
            (
                'WRb[293382001665435747348222619884289871468, "UnsignedInteger128"]',
                "UnsignedInteger128",
            ),
            (
                'WRb[253033302833692126095975097811212718901, "UnsignedInteger128"]',
                "UnsignedInteger128 - 2nd test",
            ),
        )
    
        is_little_endian = session.evaluate("$ByteOrdering").value == -1
        if is_little_endian:
            expected = (
                "{213, 143, 98, 112, 141, 183, 203, 247}",
                "{148, 135, 230, 22, 136, 141, 234, 99}",
                "{95, 5, 33, 229, 29, 62, 63, 98}",
                "{134, 9, 161, 91, 93, 195, 173, 74}",
                "{108, 78, 217, 150, 88, 126, 152, 101, 231, 134, 176, 140, 118, 81, 183, 220}",
                "{53, 83, 116, 79, 81, 100, 60, 126, 202, 52, 241, 48, 5, 113, 92, 190}",
            )
        else:
            expected = (
                "{112, 98, 143, 213, 247, 203, 183, 141}",
                "{22, 230, 135, 148, 99, 234, 141, 136}",
                "{98, 63, 62, 29, 229, 33, 5, 95}",
                "{74, 173, 195, 93, 91, 161, 9, 132}",
                "{220, 183, 81, 118, 140, 176, 134, 231, 101, 152, 126, 88, 150, 217, 73, 108}",
                "{190, 92, 113, 5, 48, 241, 52, 202, 126, 60, 100, 81, 79, 116, 83, 53}",
            )
    
        for i, (str_expr, message) in enumerate(test_input_and_name):
            # This works but the $Precision is coming out UnsignedInt128 rather tha
            # UnsignedInt32
            # (
            #     'Eigenvalues[{{-8, 12, 4}, {12, -20, 0}, {4, 0, -2}}, Method->"mpmath"]',
            #     "{{-0.842134, -0.396577, 0.365428}, "
            #     " { 0.5328,   -0.507232, 0.677377}, "
            #     " {-0.0832756, 0.765142, 0.638454}}",
            #     "Eigenvalues via mpmath",
            # ),
>           check_evaluation(str_expr, expected[i], message)
test/test_evaluation.py:260: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
str_expr = 'ToString[WRb[5381171935514265990, "UnsignedInteger64"]]'
str_expected = 'ToString[{74, 173, 195, 93, 91, 161, 9, 132}]'
failure_message = 'UnsignedInteger64 - 2nd test', hold_expected = False
to_string_expr = True, to_string_expected = True, to_python_expected = False
expected_messages = None
    def check_evaluation(
        str_expr: str,
        str_expected: str,
        failure_message: str = "",
        hold_expected: bool = False,
        to_string_expr: bool = True,
        to_string_expected: bool = True,
        to_python_expected: bool = False,
        expected_messages: Optional[tuple] = None,
    ):
        """
        Helper function to test Mathics expression against
        its results
    
        Compares the expressions represented by ``str_expr`` and  ``str_expected`` by evaluating
        the first, and optionally, the second.
    
        to_string_expr: If ``True`` (default value) the result of the evaluation is converted
                        into a Python string. Otherwise, the expression is kept as an Expression
                        object. If this argument is set to ``None``, the session is reset.
    
        failure_message (str): message shown in case of failure
        hold_expected (bool): If ``False`` (default value) the ``str_expected`` is evaluated. Otherwise,
                              the expression is considered literally.
    
        to_string_expected: If ``True`` (default value) the expected expression is
                        evaluated and then converted to a Python string. result of the evaluation is converted
                        into a Python string. If ``False``, the expected expression is kept as an Expression object.
    
        to_python_expected: If ``True``, and ``to_string_expected`` is ``False``, the result of evaluating ``str_expr``
                        is compared against the result of the evaluation of ``str_expected``, converted into a
                        Python object.
    
        expected_messages ``Optional[tuple[str]]``: If a tuple of strings are passed into this parameter, messages and prints raised during
                        the evaluation of ``str_expr`` are compared with the elements of the list. If ``None``, this comparison
                        is ommited.
        """
        if str_expr is None:
            reset_session()
            return
    
        if to_string_expr:
            str_expr = f"ToString[{str_expr}]"
            result = evaluate_value(str_expr)
        else:
            result = evaluate(str_expr)
    
        outs = [out.text for out in session.evaluation.out]
    
        if to_string_expected:
            if hold_expected:
                expected = str_expected
            else:
                str_expected = f"ToString[{str_expected}]"
                expected = evaluate_value(str_expected)
        else:
            if hold_expected:
                if to_python_expected:
                    expected = str_expected
                else:
                    expected = evaluate(f"HoldForm[{str_expected}]").elements[0]
            else:
                expected = evaluate(str_expected)
                if to_python_expected:
                    expected = expected.to_python(string_quotes=False)
    
        print(time.asctime())
        if failure_message:
            print((result, expected))
>           assert result == expected, failure_message
E           AssertionError: UnsignedInteger64 - 2nd test
test/helper.py:91: AssertionError
----------------------------- Captured stdout call -----------------------------
Sun Jan 22 16:22:39 2023
('{112, 98, 143, 213, 247, 203, 183, 141}', '{112, 98, 143, 213, 247, 203, 183, 141}')
Sun Jan 22 16:22:39 2023
('{22, 230, 135, 148, 99, 234, 141, 136}', '{22, 230, 135, 148, 99, 234, 141, 136}')
Sun Jan 22 16:22:39 2023
('{98, 63, 62, 29, 229, 33, 5, 95}', '{98, 63, 62, 29, 229, 33, 5, 95}')
Sun Jan 22 16:22:39 2023
('{74, 173, 195, 93, 91, 161, 9, 134}', '{74, 173, 195, 93, 91, 161, 9, 132}')

@rocky
Copy link
Member

rocky commented Jan 22, 2023

Ok - that was a typo on my part (compare with the little-endian output).

This now fixed in 27b300a so change the "132" to "134", or pull from that commit, rerun the test and I think this test should now pass.

@davide125
Copy link
Contributor Author

Still failing:

=================================== FAILURES ===================================
______________________ test_system_specific_long_integer _______________________
    def test_system_specific_long_integer():
        evaluate(
            """
        WRb[bytes_, form_] := Module[{str, res={}, byte}, str = OpenWrite[BinaryFormat -> True];
        BinaryWrite[str, bytes, form];
        str = OpenRead[Close[str], BinaryFormat -> True];
        While[Not[SameQ[byte = BinaryRead[str], EndOfFile]], res = Join[res, {byte}];];
        Close[str]; res]
        """
        )
    
        test_input_and_name = (
            (
                'WRb[{1885507541, 4157323149}, Table["UnsignedInteger32", {2}]]',
                "UnsignedInteger32",
            ),
            (
                'WRb[{384206740, 1676316040}, Table["UnsignedInteger32", {2}]]',
                "UnsignedInteger32 - 2nd test",
            ),
            (
                'WRb[7079445437368829279, "UnsignedInteger64"]',
                "UnsignedInteger64",
            ),
            (
                'WRb[5381171935514265990, "UnsignedInteger64"]',
                "UnsignedInteger64 - 2nd test",
            ),
            (
                'WRb[293382001665435747348222619884289871468, "UnsignedInteger128"]',
                "UnsignedInteger128",
            ),
            (
                'WRb[253033302833692126095975097811212718901, "UnsignedInteger128"]',
                "UnsignedInteger128 - 2nd test",
            ),
        )
    
        is_little_endian = session.evaluate("$ByteOrdering").value == -1
        if is_little_endian:
            expected = (
                "{213, 143, 98, 112, 141, 183, 203, 247}",
                "{148, 135, 230, 22, 136, 141, 234, 99}",
                "{95, 5, 33, 229, 29, 62, 63, 98}",
                "{134, 9, 161, 91, 93, 195, 173, 74}",
                "{108, 78, 217, 150, 88, 126, 152, 101, 231, 134, 176, 140, 118, 81, 183, 220}",
                "{53, 83, 116, 79, 81, 100, 60, 126, 202, 52, 241, 48, 5, 113, 92, 190}",
            )
        else:
            expected = (
                "{112, 98, 143, 213, 247, 203, 183, 141}",
                "{22, 230, 135, 148, 99, 234, 141, 136}",
                "{98, 63, 62, 29, 229, 33, 5, 95}",
                "{74, 173, 195, 93, 91, 161, 9, 134}",
                "{220, 183, 81, 118, 140, 176, 134, 231, 101, 152, 126, 88, 150, 217, 73, 108}",
                "{190, 92, 113, 5, 48, 241, 52, 202, 126, 60, 100, 81, 79, 116, 83, 53}",
            )
    
        for i, (str_expr, message) in enumerate(test_input_and_name):
            # This works but the $Precision is coming out UnsignedInt128 rather tha
            # UnsignedInt32
            # (
            #     'Eigenvalues[{{-8, 12, 4}, {12, -20, 0}, {4, 0, -2}}, Method->"mpmath"]',
            #     "{{-0.842134, -0.396577, 0.365428}, "
            #     " { 0.5328,   -0.507232, 0.677377}, "
            #     " {-0.0832756, 0.765142, 0.638454}}",
            #     "Eigenvalues via mpmath",
            # ),
>           check_evaluation(str_expr, expected[i], message)
test/test_evaluation.py:260: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
str_expr = 'ToString[WRb[293382001665435747348222619884289871468, "UnsignedInteger128"]]'
str_expected = 'ToString[{220, 183, 81, 118, 140, 176, 134, 231, 101, 152, 126, 88, 150, 217, 73, 108}]'
failure_message = 'UnsignedInteger128', hold_expected = False
to_string_expr = True, to_string_expected = True, to_python_expected = False
expected_messages = None
    def check_evaluation(
        str_expr: str,
        str_expected: str,
        failure_message: str = "",
        hold_expected: bool = False,
        to_string_expr: bool = True,
        to_string_expected: bool = True,
        to_python_expected: bool = False,
        expected_messages: Optional[tuple] = None,
    ):
        """
        Helper function to test Mathics expression against
        its results
    
        Compares the expressions represented by ``str_expr`` and  ``str_expected`` by evaluating
        the first, and optionally, the second.
    
        to_string_expr: If ``True`` (default value) the result of the evaluation is converted
                        into a Python string. Otherwise, the expression is kept as an Expression
                        object. If this argument is set to ``None``, the session is reset.
    
        failure_message (str): message shown in case of failure
        hold_expected (bool): If ``False`` (default value) the ``str_expected`` is evaluated. Otherwise,
                              the expression is considered literally.
    
        to_string_expected: If ``True`` (default value) the expected expression is
                        evaluated and then converted to a Python string. result of the evaluation is converted
                        into a Python string. If ``False``, the expected expression is kept as an Expression object.
    
        to_python_expected: If ``True``, and ``to_string_expected`` is ``False``, the result of evaluating ``str_expr``
                        is compared against the result of the evaluation of ``str_expected``, converted into a
                        Python object.
    
        expected_messages ``Optional[tuple[str]]``: If a tuple of strings are passed into this parameter, messages and prints raised during
                        the evaluation of ``str_expr`` are compared with the elements of the list. If ``None``, this comparison
                        is ommited.
        """
        if str_expr is None:
            reset_session()
            return
    
        if to_string_expr:
            str_expr = f"ToString[{str_expr}]"
            result = evaluate_value(str_expr)
        else:
            result = evaluate(str_expr)
    
        outs = [out.text for out in session.evaluation.out]
    
        if to_string_expected:
            if hold_expected:
                expected = str_expected
            else:
                str_expected = f"ToString[{str_expected}]"
                expected = evaluate_value(str_expected)
        else:
            if hold_expected:
                if to_python_expected:
                    expected = str_expected
                else:
                    expected = evaluate(f"HoldForm[{str_expected}]").elements[0]
            else:
                expected = evaluate(str_expected)
                if to_python_expected:
                    expected = expected.to_python(string_quotes=False)
    
        print(time.asctime())
        if failure_message:
            print((result, expected))
>           assert result == expected, failure_message
E           AssertionError: UnsignedInteger128
test/helper.py:91: AssertionError
----------------------------- Captured stdout call -----------------------------
Sun Jan 22 17:00:19 2023
('{112, 98, 143, 213, 247, 203, 183, 141}', '{112, 98, 143, 213, 247, 203, 183, 141}')
Sun Jan 22 17:00:19 2023
('{22, 230, 135, 148, 99, 234, 141, 136}', '{22, 230, 135, 148, 99, 234, 141, 136}')
Sun Jan 22 17:00:19 2023
('{98, 63, 62, 29, 229, 33, 5, 95}', '{98, 63, 62, 29, 229, 33, 5, 95}')
Sun Jan 22 17:00:19 2023
('{74, 173, 195, 93, 91, 161, 9, 134}', '{74, 173, 195, 93, 91, 161, 9, 134}')
Sun Jan 22 17:00:20 2023
('{101, 152, 126, 88, 150, 217, 78, 108, 220, 183, 81, 118, 140, 176, 134, 231}', '{220, 183, 81, 118, 140, 176, 134, 231, 101, 152, 126, 88, 150, 217, 73, 108}')

@rocky
Copy link
Member

rocky commented Jan 22, 2023

At least we progressed a couple of tests and are down to the last two (assuming this is the only test that changes due to BigEndian).

Commit b56150b now adjusts this and the next test. To speed things up if a test fails just change the number as given by expected and send back the diff.

@davide125
Copy link
Contributor Author

Thanks! There was one more missing, commented with the diff on #762. Once that's updated I'll retest again with the new patch to be sure, but we should be getting there.

@davide125
Copy link
Contributor Author

Fixed in da1e308

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