** Black box testing of the Solver class of the C++ API.
**/
-#include "base/configuration.h"
#include "test_api.h"
namespace CVC4 {
TEST_F(TestApiBlackSolver, mkRoundingMode)
{
- if (CVC4::Configuration::isBuiltWithSymFPU())
+ if (d_solver.supportsFloatingPoint())
{
ASSERT_NO_THROW(d_solver.mkRoundingMode(RoundingMode::ROUND_TOWARD_ZERO));
}
Term t1 = d_solver.mkBitVector(8);
Term t2 = d_solver.mkBitVector(4);
Term t3 = d_solver.mkInteger(2);
- if (CVC4::Configuration::isBuiltWithSymFPU())
+ if (d_solver.supportsFloatingPoint())
{
ASSERT_NO_THROW(d_solver.mkFloatingPoint(3, 5, t1));
}
ASSERT_THROW(d_solver.mkFloatingPoint(3, 5, t2), CVC4ApiException);
ASSERT_THROW(d_solver.mkFloatingPoint(3, 5, t2), CVC4ApiException);
- if (CVC4::Configuration::isBuiltWithSymFPU())
+ if (d_solver.supportsFloatingPoint())
{
Solver slv;
ASSERT_THROW(slv.mkFloatingPoint(3, 5, t1), CVC4ApiException);
TEST_F(TestApiBlackSolver, mkNaN)
{
- if (CVC4::Configuration::isBuiltWithSymFPU())
+ if (d_solver.supportsFloatingPoint())
{
ASSERT_NO_THROW(d_solver.mkNaN(3, 5));
}
TEST_F(TestApiBlackSolver, mkNegZero)
{
- if (CVC4::Configuration::isBuiltWithSymFPU())
+ if (d_solver.supportsFloatingPoint())
{
ASSERT_NO_THROW(d_solver.mkNegZero(3, 5));
}
TEST_F(TestApiBlackSolver, mkNegInf)
{
- if (CVC4::Configuration::isBuiltWithSymFPU())
+ if (d_solver.supportsFloatingPoint())
{
ASSERT_NO_THROW(d_solver.mkNegInf(3, 5));
}
TEST_F(TestApiBlackSolver, mkPosInf)
{
- if (CVC4::Configuration::isBuiltWithSymFPU())
+ if (d_solver.supportsFloatingPoint())
{
ASSERT_NO_THROW(d_solver.mkPosInf(3, 5));
}
TEST_F(TestApiBlackSolver, mkPosZero)
{
- if (CVC4::Configuration::isBuiltWithSymFPU())
+ if (d_solver.supportsFloatingPoint())
{
ASSERT_NO_THROW(d_solver.mkPosZero(3, 5));
}
** Black box testing of the guards of the C++ API functions.
**/
-#include "base/configuration.h"
#include "test_api.h"
namespace CVC4 {
TEST_F(TestApiBlackSort, isRoundingMode)
{
- ASSERT_TRUE(d_solver.getRoundingModeSort().isRoundingMode());
- ASSERT_NO_THROW(Sort().isRoundingMode());
+ if (d_solver.supportsFloatingPoint())
+ {
+ ASSERT_TRUE(d_solver.getRoundingModeSort().isRoundingMode());
+ ASSERT_NO_THROW(Sort().isRoundingMode());
+ }
}
TEST_F(TestApiBlackSort, isBitVector)
TEST_F(TestApiBlackSort, isFloatingPoint)
{
- ASSERT_TRUE(d_solver.mkFloatingPointSort(8, 24).isFloatingPoint());
- ASSERT_NO_THROW(Sort().isFloatingPoint());
+ if (d_solver.supportsFloatingPoint())
+ {
+ ASSERT_TRUE(d_solver.mkFloatingPointSort(8, 24).isFloatingPoint());
+ ASSERT_NO_THROW(Sort().isFloatingPoint());
+ }
}
TEST_F(TestApiBlackSort, isDatatype)
TEST_F(TestApiBlackSort, getFPExponentSize)
{
- if (CVC4::Configuration::isBuiltWithSymFPU())
+ if (d_solver.supportsFloatingPoint())
{
Sort fpSort = d_solver.mkFloatingPointSort(4, 8);
ASSERT_NO_THROW(fpSort.getFPExponentSize());
TEST_F(TestApiBlackSort, getFPSignificandSize)
{
- if (CVC4::Configuration::isBuiltWithSymFPU())
+ if (d_solver.supportsFloatingPoint())
{
Sort fpSort = d_solver.mkFloatingPointSort(4, 8);
ASSERT_NO_THROW(fpSort.getFPSignificandSize());