diff options
author | makaimann <makaim@stanford.edu> | 2019-09-18 19:34:22 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-18 19:34:22 -0700 |
commit | cfe4f59c0a10d49a35b9f59bb2fd6ab7d224e53d (patch) | |
tree | f6bdaca320b09f11b2ac92acac86b2a1b60486c2 /test | |
parent | a9c40f60e4b36494e10520dcc3a3985b4700342f (diff) |
Add support for creating constant arrays to the new C++ API (#3296)
* Add support for constant arrays to new C++ API
* Fix macro usage in unit test
* Add not null check
* Add test for null term
* Formatting
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/api/solver_black.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/unit/api/solver_black.h b/test/unit/api/solver_black.h index 835ecd880..9dd913ea2 100644 --- a/test/unit/api/solver_black.h +++ b/test/unit/api/solver_black.h @@ -53,6 +53,7 @@ class SolverBlack : public CxxTest::TestSuite void testMkBitVector(); void testMkBoolean(); void testMkConst(); + void testMkConstArray(); void testMkEmptySet(); void testMkFalse(); void testMkFloatingPoint(); @@ -755,6 +756,20 @@ void SolverBlack::testMkConst() TS_ASSERT_THROWS(d_solver->mkConst(Sort(), "a"), CVC4ApiException&); } +void SolverBlack::testMkConstArray() +{ + Sort intSort = d_solver->getIntegerSort(); + Sort arrSort = d_solver->mkArraySort(intSort, intSort); + Term zero = d_solver->mkReal(0); + Term constArr = d_solver->mkConstArray(arrSort, zero); + + TS_ASSERT_THROWS_NOTHING(d_solver->mkConstArray(arrSort, zero)); + TS_ASSERT_THROWS(d_solver->mkConstArray(arrSort, Term()), CVC4ApiException&); + TS_ASSERT_THROWS(d_solver->mkConstArray(arrSort, d_solver->mkBitVector(1, 1)), + CVC4ApiException&); + TS_ASSERT_THROWS(d_solver->mkConstArray(intSort, zero), CVC4ApiException&); +} + void SolverBlack::testDeclareDatatype() { DatatypeConstructorDecl cons("cons"); |