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

Fix for canonicalize segfault. #37

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from
Open
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
branches: [ develop ]

env:
VCPKG_HASH: '5645ad4f3d73b652515ac8fdb50de70fdd331a34'
VCPKG_HASH: '08efacc0dcaf652c44de424befa1fe97c91a4896'

jobs:
build-sdist:
Expand Down Expand Up @@ -85,7 +85,7 @@ jobs:
id: vcpkg-installed-cache
with:
path: installed/
key: vcpkg-1-${{ env.VCPKG_HASH }}-${{ matrix.os }}
key: vcpkg-0-${{ env.VCPKG_HASH }}-${{ matrix.os }}
- uses: actions/checkout@v4
if: steps.vcpkg-installed-cache.outputs.cache-hit != 'true'
with:
Expand Down
38 changes: 38 additions & 0 deletions test/test_issue35.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import cdd
import pytest


def test_issue35_1() -> None:
mat = cdd.matrix_from_array([[0, 0, 0]], rep_type=cdd.RepType.INEQUALITY)
assert cdd.matrix_canonicalize(mat) == ({0}, set(), [None])
assert mat.array == []


def test_issue35_2() -> None:
mat = cdd.matrix_from_array([[0, 0, 0]], rep_type=cdd.RepType.INEQUALITY)
assert cdd.matrix_redundancy_remove(mat) == ({0}, [None])
assert mat.array == []


def test_issue35_3() -> None:
mat = cdd.matrix_from_array([[0, 0, 0]], rep_type=cdd.RepType.INEQUALITY)
assert cdd.matrix_canonicalize_linearity(mat) == ({0}, [None])
assert mat.array == []


def test_issue35_4() -> None:
mat = cdd.matrix_from_array([], rep_type=cdd.RepType.INEQUALITY)
assert cdd.matrix_canonicalize(mat) == (set(), set(), [])
assert mat.array == []


def test_issue35_5() -> None:
mat = cdd.matrix_from_array([], rep_type=cdd.RepType.INEQUALITY)
assert cdd.matrix_redundancy_remove(mat) == (set(), [])
assert mat.array == []


def test_issue35_6() -> None:
mat = cdd.matrix_from_array([], rep_type=cdd.RepType.INEQUALITY)
assert cdd.matrix_canonicalize_linearity(mat) == (set(), [])
assert mat.array == []
Loading