|
| 1 | +/* |
| 2 | + * This file is part of JavaSMT, |
| 3 | + * an API wrapper for a collection of SMT solvers: |
| 4 | + * https://github.com/sosy-lab/java-smt |
| 5 | + * |
| 6 | + * SPDX-FileCopyrightText: 2024 Dirk Beyer <https://www.sosy-lab.org> |
| 7 | + * |
| 8 | + * SPDX-License-Identifier: Apache-2.0 |
| 9 | + */ |
| 10 | + |
| 11 | +package org.sosy_lab.java_smt.test; |
| 12 | + |
| 13 | +import static com.google.common.truth.Truth.assertThat; |
| 14 | + |
| 15 | +import org.junit.Test; |
| 16 | +import org.sosy_lab.java_smt.api.BitvectorFormula; |
| 17 | + |
| 18 | +public class RotationVisitorTest extends SolverBasedTest0.ParameterizedSolverBasedTest0 { |
| 19 | + @Test |
| 20 | + public void rotateLeftTest() { |
| 21 | + requireBitvectors(); |
| 22 | + BitvectorFormula x = bvmgr.makeBitvector(8, 7); |
| 23 | + assertThat(mgr.extractVariables(bvmgr.rotateLeft(x, 1))).isEmpty(); |
| 24 | + } |
| 25 | + |
| 26 | + @Test |
| 27 | + public void rotateRightTest() { |
| 28 | + requireBitvectors(); |
| 29 | + BitvectorFormula x = bvmgr.makeBitvector(8, 7); |
| 30 | + assertThat(mgr.extractVariables(bvmgr.rotateRight(x, 1))).isEmpty(); |
| 31 | + } |
| 32 | + |
| 33 | + @Test |
| 34 | + public void rotateLeftIntegerTest() { |
| 35 | + requireBitvectors(); |
| 36 | + BitvectorFormula x = bvmgr.makeBitvector(8, 7); |
| 37 | + BitvectorFormula y = bvmgr.makeBitvector(8, 1); |
| 38 | + assertThat(mgr.extractVariables(bvmgr.rotateLeft(x, y))).isEmpty(); |
| 39 | + } |
| 40 | + |
| 41 | + @Test |
| 42 | + public void rotateRightIntegerTest() { |
| 43 | + requireBitvectors(); |
| 44 | + BitvectorFormula x = bvmgr.makeBitvector(8, 7); |
| 45 | + BitvectorFormula y = bvmgr.makeBitvector(8, 1); |
| 46 | + assertThat(mgr.extractVariables(bvmgr.rotateRight(x, y))).isEmpty(); |
| 47 | + } |
| 48 | +} |
0 commit comments