@@ -544,14 +544,37 @@ 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
}
568
+ // SECTION("Invariant violated due to expression in unexpected form.")
569
+ // {
570
+ // // const mult_exprt unexpected{foo.symbol_expr(), from_integer(2, foo.type)};
571
+ // const cbmc_invariants_should_throwt invariants_throw;
572
+ // REQUIRE_THROWS_MATCHES(
573
+ // test.procedure.get(foo.symbol_expr()),
574
+ // invariant_failedt,
575
+ // invariant_failure_containing(
576
+ // "Unhandled expressions are expected to be symbols"));
577
+ // }
555
578
SECTION (" Error handling of mismatched response." )
556
579
{
557
580
test.sent_commands .clear ();
0 commit comments