Skip to content

Commit

Permalink
Merge pull request #104 from hdasch/bigendian-tests
Browse files Browse the repository at this point in the history
Fix issues #95 and #96
  • Loading branch information
cocagne authored Sep 13, 2024
2 parents 5a71001 + 22f6934 commit 24cd61a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/test_marshal.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
import unittest
from struct import pack

Expand Down Expand Up @@ -125,7 +126,7 @@ def test_array_of_dict(self):

class TestMarshal(unittest.TestCase):

def check(self, sig, var_list, expected_encoding, little_endian=True):
def check(self, sig, var_list, expected_encoding, little_endian = sys.byteorder == 'little'):
if not isinstance(var_list, list):
var_list = [var_list]
nbytes, chunks = m.marshal(sig, var_list, 0, little_endian)
Expand Down Expand Up @@ -348,7 +349,7 @@ def check_dict(a, b):
class TestUnmarshal(unittest.TestCase):

def check(self, sig, expected_value, encoding):
nbytes, value = m.unmarshal(sig, encoding, 0)
nbytes, value = m.unmarshal(sig, encoding, 0, sys.byteorder == 'little')
self.assertEqual(
nbytes,
len(encoding),
Expand Down

0 comments on commit 24cd61a

Please sign in to comment.