File tree Expand file tree Collapse file tree 1 file changed +20
-7
lines changed
unit/solvers/smt2_incremental Expand file tree Collapse file tree 1 file changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -544,13 +544,26 @@ TEST_CASE(
544
544
}
545
545
SECTION (" Invariant violated due to expression in unexpected form." )
546
546
{
547
- const mult_exprt unexpected{foo.symbol_expr (), from_integer (2 , foo.type )};
548
- const cbmc_invariants_should_throwt invariants_throw;
549
- REQUIRE_THROWS_MATCHES (
550
- test.procedure .get (unexpected),
551
- invariant_failedt,
552
- invariant_failure_containing (
553
- " Unhandled expressions are expected to be symbols" ));
547
+ const auto offset = from_integer (2 , signedbv_typet{64 });
548
+ const byte_extract_exprt byte_extract_expr{
549
+ ID_byte_extract_little_endian,
550
+ foo.symbol_expr (),
551
+ offset,
552
+ 8 ,
553
+ unsignedbv_typet{8 }};
554
+ test.mock_responses .push_back (
555
+ smt_get_value_responset{{{foo_term, term_42}}});
556
+ test.mock_responses .push_back (smt_get_value_responset{
557
+ {{smt_bit_vector_constant_termt{2 , 64 },
558
+ smt_bit_vector_constant_termt{2 , 64 }}}});
559
+ REQUIRE (
560
+ test.procedure .get (byte_extract_expr) ==
561
+ byte_extract_exprt{
562
+ ID_byte_extract_little_endian,
563
+ expr_42,
564
+ offset,
565
+ 8 ,
566
+ unsignedbv_typet{8 }});
554
567
}
555
568
SECTION (" Error handling of mismatched response." )
556
569
{
You can’t perform that action at this time.
0 commit comments