Add unit test for LibcUtil().mallinfo2().

This commit is contained in:
Ryan Dick 2023-10-03 13:52:50 -04:00
parent 22a84930f6
commit 3599d546e6

View File

@ -0,0 +1,16 @@
import pytest
from invokeai.backend.model_management.libc_util import LibcUtil
def test_libc_util_mallinfo2():
"""Smoke test of LibcUtil().mallinfo2()."""
try:
libc = LibcUtil()
except OSError:
# TODO: Set the expected result preemptively based on the system properties.
pytest.xfail("libc shared library is not available on this system.")
info = libc.mallinfo2()
assert info.arena > 0