dgibson / dtc

Device Tree Compiler
235 stars 134 forks source link

pylibfdt tests fail with SWIG 4.3.0 #159

Closed blmaier closed 6 days ago

blmaier commented 6 days ago

The pylibfdt tests fail when building dtc 1.7.2 using SWIG 4.3.0. These tests pass when built with SWIG 4.2.1 . See below for test output.

======================================================================
ERROR: testGetProp (__main__.PyLibfdtBasicTests.testGetProp)
Check that we can read the contents of a property by name
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/brandon/work/update-conda-dtc/dtc/tests/pylibfdt_tests.py", line 215, in testGetProp
    self.assertEqual(-libfdt.NOTFOUND, self.fdt.getprop(root, 'missing',
                                       ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
                                                         QUIET_NOTFOUND))
                                                         ^^^^^^^^^^^^^^^
  File "/home/brandon/work/update-conda-dtc/dtc/pylibfdt/libfdt.py", line 454, in getprop
    return Property(prop_name, bytearray(pdata[0]))
                               ~~~~~~~~~^^^^^^^^^^
TypeError: cannot convert 'NoneType' object to bytearray

======================================================================
ERROR: testSetProp (__main__.PyLibfdtBasicTests.testSetProp)
Test that we can update and create properties
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/brandon/work/update-conda-dtc/dtc/tests/pylibfdt_tests.py", line 450, in testSetProp
    self.fdt.getprop(node, 'missing', QUIET_NOTFOUND))
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/brandon/work/update-conda-dtc/dtc/pylibfdt/libfdt.py", line 454, in getprop
    return Property(prop_name, bytearray(pdata[0]))
                               ~~~~~~~~~^^^^^^^^^^
TypeError: cannot convert 'NoneType' object to bytearray

======================================================================
FAIL: testGetName (__main__.PyLibfdtBasicTests.testGetName)
Check that we can get the name of a node
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/brandon/work/update-conda-dtc/dtc/tests/pylibfdt_tests.py", line 191, in testGetName
    with self.assertRaises(FdtException) as e:
         ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
AssertionError: FdtException not raised

======================================================================
FAIL: testHasProp (__main__.PyLibfdtBasicTests.testHasProp)
Test that we can check if a node has a property
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/brandon/work/update-conda-dtc/dtc/tests/pylibfdt_tests.py", line 502, in testHasProp
    self.assertFalse(self.fdt2.hasprop(node, 'missing'))
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: True is not false

======================================================================
FAIL: testSetPropBool (__main__.PyLibfdtBasicTests.testSetPropBool)
Test that we can update and create boolean properties
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/brandon/work/update-conda-dtc/dtc/tests/pylibfdt_tests.py", line 524, in testSetPropBool
    self.assertFalse(self.fdt2.hasprop(node, prop))
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: True is not false

----------------------------------------------------------------------
Ran 41 tests in 0.003s

FAILED (failures=3, errors=2)
********** TEST SUMMARY
*     Total testcases:  42
*                PASS:  37
*                FAIL:  2
*   Bad configuration:  0
* Strange test result:  0
**********