Skip to content

Commit

Permalink
Add additional tests on range check for IntVar
Browse files Browse the repository at this point in the history
  • Loading branch information
cprudhom committed Oct 5, 2023
1 parent 1904af4 commit c5e820c
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -938,6 +938,9 @@ default void checkIntDomainRange(String NAME, int MIN, int MAX) {
if (MAX < MIN) {
throw new SolverException(NAME + ": wrong domain definition, lower bound > upper bound");
}
if ((long) MAX - MIN > Integer.MAX_VALUE) {
throw new SolverException(NAME + ": too large domain, consider reducing the bounds to avoid unexpected results");
}
}

/**
Expand Down

0 comments on commit c5e820c

Please sign in to comment.