@@ -727,20 +727,23 @@ TEST_CASE(
727
727
}
728
728
}
729
729
730
- SCENARIO (
730
+ TEMPLATE_TEST_CASE (
731
731
" Bitwise \" AND\" expressions are converted to SMT terms" ,
732
- " [core][smt2_incremental]" )
732
+ " [core][smt2_incrzmental]" ,
733
+ signedbv_typet,
734
+ unsignedbv_typet,
735
+ bv_typet)
733
736
{
734
737
auto test = expr_to_smt_conversion_test_environmentt::make (test_archt::i386);
735
- GIVEN (" three integer bitvectors and their smt-term equivalents" )
738
+ GIVEN (" three bitvectors and their smt-term equivalents" )
736
739
{
737
740
const smt_termt smt_term_one = smt_bit_vector_constant_termt{1 , 8 };
738
741
const smt_termt smt_term_three = smt_bit_vector_constant_termt{3 , 8 };
739
742
const smt_termt smt_term_five = smt_bit_vector_constant_termt{5 , 8 };
740
743
741
- const auto one_bvint = from_integer (1 , signedbv_typet {8 });
742
- const auto three_bvint = from_integer (3 , signedbv_typet {8 });
743
- const auto five_bvint = from_integer (5 , signedbv_typet {8 });
744
+ const auto one_bvint = from_integer (1 , TestType {8 });
745
+ const auto three_bvint = from_integer (3 , TestType {8 });
746
+ const auto five_bvint = from_integer (5 , TestType {8 });
744
747
745
748
WHEN (" a bitand_exprt with two of them as arguments is converted" )
746
749
{
@@ -766,8 +769,7 @@ SCENARIO(
766
769
// support direct construction with multiple operands - so we have to
767
770
// construct its parent class and downcast it.
768
771
const exprt::operandst and_operands{one_bvint, three_bvint, five_bvint};
769
- const multi_ary_exprt first_step{
770
- ID_bitand, and_operands, signedbv_typet{8 }};
772
+ const multi_ary_exprt first_step{ID_bitand, and_operands, TestType{8 }};
771
773
const auto bitand_expr = to_bitand_expr (first_step);
772
774
773
775
const auto constructed_term = test.convert (bitand_expr);
@@ -800,20 +802,23 @@ SCENARIO(
800
802
}
801
803
}
802
804
803
- SCENARIO (
805
+ TEMPLATE_TEST_CASE (
804
806
" Bitwise \" OR\" expressions are converted to SMT terms" ,
805
- " [core][smt2_incremental]" )
807
+ " [core][smt2_incremental]" ,
808
+ signedbv_typet,
809
+ unsignedbv_typet,
810
+ bv_typet)
806
811
{
807
812
auto test = expr_to_smt_conversion_test_environmentt::make (test_archt::i386);
808
- GIVEN (" three integer bitvectors and their smt-term equivalents" )
813
+ GIVEN (" three bitvectors and their smt-term equivalents" )
809
814
{
810
815
const smt_termt smt_term_one = smt_bit_vector_constant_termt{1 , 8 };
811
816
const smt_termt smt_term_three = smt_bit_vector_constant_termt{3 , 8 };
812
817
const smt_termt smt_term_five = smt_bit_vector_constant_termt{5 , 8 };
813
818
814
- const auto one_bvint = from_integer (1 , signedbv_typet {8 });
815
- const auto three_bvint = from_integer (3 , signedbv_typet {8 });
816
- const auto five_bvint = from_integer (5 , signedbv_typet {8 });
819
+ const auto one_bvint = from_integer (1 , TestType {8 });
820
+ const auto three_bvint = from_integer (3 , TestType {8 });
821
+ const auto five_bvint = from_integer (5 , TestType {8 });
817
822
818
823
WHEN (" a bitor_exprt with two of them as arguments is converted" )
819
824
{
@@ -840,8 +845,7 @@ SCENARIO(
840
845
WHEN (" a ternary bitor_exprt gets connverted to smt terms" )
841
846
{
842
847
const exprt::operandst or_operands{one_bvint, three_bvint, five_bvint};
843
- const multi_ary_exprt first_step{
844
- ID_bitor, or_operands, signedbv_typet{8 }};
848
+ const multi_ary_exprt first_step{ID_bitor, or_operands, TestType{8 }};
845
849
const auto bitor_expr = to_bitor_expr (first_step);
846
850
847
851
const auto constructed_term = test.convert (bitor_expr);
@@ -877,20 +881,23 @@ SCENARIO(
877
881
}
878
882
}
879
883
880
- SCENARIO (
884
+ TEMPLATE_TEST_CASE (
881
885
" Bitwise \" XOR\" expressions are converted to SMT terms" ,
882
- " [core][smt2_incremental]" )
886
+ " [core][smt2_incremental]" ,
887
+ signedbv_typet,
888
+ unsignedbv_typet,
889
+ bv_typet)
883
890
{
884
891
auto test = expr_to_smt_conversion_test_environmentt::make (test_archt::i386);
885
- GIVEN (" three integer bitvectors and their smt-term equivalents" )
892
+ GIVEN (" three bitvectors and their smt-term equivalents" )
886
893
{
887
894
const smt_termt smt_term_one = smt_bit_vector_constant_termt{1 , 8 };
888
895
const smt_termt smt_term_three = smt_bit_vector_constant_termt{3 , 8 };
889
896
const smt_termt smt_term_five = smt_bit_vector_constant_termt{5 , 8 };
890
897
891
- const auto one_bvint = from_integer (1 , signedbv_typet {8 });
892
- const auto three_bvint = from_integer (3 , signedbv_typet {8 });
893
- const auto five_bvint = from_integer (5 , signedbv_typet {8 });
898
+ const auto one_bvint = from_integer (1 , TestType {8 });
899
+ const auto three_bvint = from_integer (3 , TestType {8 });
900
+ const auto five_bvint = from_integer (5 , TestType {8 });
894
901
895
902
WHEN (" a bitxor_exprt with two of them as arguments is converted" )
896
903
{
@@ -913,8 +920,7 @@ SCENARIO(
913
920
WHEN (" a ternary bitxor_exprt gets connverted to smt terms" )
914
921
{
915
922
const exprt::operandst xor_operands{one_bvint, three_bvint, five_bvint};
916
- const multi_ary_exprt first_step{
917
- ID_bitxor, xor_operands, signedbv_typet{8 }};
923
+ const multi_ary_exprt first_step{ID_bitxor, xor_operands, TestType{8 }};
918
924
const auto bitxor_expr = to_bitxor_expr (first_step);
919
925
920
926
const auto constructed_term = test.convert (bitxor_expr);
@@ -949,14 +955,17 @@ SCENARIO(
949
955
}
950
956
}
951
957
952
- SCENARIO (
958
+ TEMPLATE_TEST_CASE (
953
959
" Bitwise \" NOT\" expressions are converted to SMT terms (1's complement)" ,
954
- " [core][smt2_incremental]" )
960
+ " [core][smt2_incremental]" ,
961
+ signedbv_typet,
962
+ unsignedbv_typet,
963
+ bv_typet)
955
964
{
956
965
auto test = expr_to_smt_conversion_test_environmentt::make (test_archt::i386);
957
- GIVEN (" An integer bitvector" )
966
+ GIVEN (" An bitvector" )
958
967
{
959
- const auto one_bvint = from_integer (1 , signedbv_typet {8 });
968
+ const auto one_bvint = from_integer (1 , TestType {8 });
960
969
961
970
WHEN (" A bitnot_exprt is constructed and converted to an SMT term" )
962
971
{
0 commit comments