@ -114,7 +114,7 @@ let tests =
let read_field_to_id lhs_id_str root_str fld_str =
let read_field_to_id lhs_id_str root_str fld_str =
make_load_fld ~ rhs_typ : ( Typ . mk Tvoid ) lhs_id_str fld_str ( Exp . Var ( ident_of_str root_str ) )
make_load_fld ~ rhs_typ : ( Typ . mk Tvoid ) lhs_id_str fld_str ( Exp . Var ( ident_of_str root_str ) )
in
in
let assert_empty = invariant " { }" in
let assert_empty = invariant " { }" in
(* hack: register an empty analyze_ondemand to prevent a crash because the callback is unset *)
(* hack: register an empty analyze_ondemand to prevent a crash because the callback is unset *)
let analyze_ondemand summary _ = summary in
let analyze_ondemand summary _ = summary in
let get_proc_desc _ = None in
let get_proc_desc _ = None in
@ -137,8 +137,8 @@ let tests =
; read_field_to_id " read_id " " base_id " " f "
; read_field_to_id " read_id " " base_id " " f "
; var_assign_id " var " " read_id "
; var_assign_id " var " " read_id "
; invariant
; invariant
" { base_id$0.f => (SOURCE -> ?), ret_id$0 => (SOURCE -> ?), &var => (SOURCE -> ?) }" ]
" { base_id$0.f => (SOURCE -> ?), \n ret_id$0 => (SOURCE -> ?),\n &var => (SOURCE -> ?) }"
)
] )
; ( " source flows to var then cleared "
; ( " source flows to var then cleared "
, [ assign_to_source " ret_id "
, [ assign_to_source " ret_id "
; var_assign_id " var " " ret_id "
; var_assign_id " var " " ret_id "
@ -184,7 +184,7 @@ let tests =
; read_field_to_id " read_id " " var_id " " f "
; read_field_to_id " read_id " " var_id " " f "
; call_sink " read_id "
; call_sink " read_id "
; invariant
; invariant
" { base_id$0.f => (SOURCE -> ?), ret_id$0 => (SOURCE -> ?), &var.f* => (SOURCE -> SINK) }"
" { base_id$0.f => (SOURCE -> ?), \n ret_id$0 => (SOURCE -> ?),\n &var.f* => (SOURCE -> SINK) }"
] )
] )
; ( " source -> sink via cast "
; ( " source -> sink via cast "
, [ assign_to_source " ret_id "
, [ assign_to_source " ret_id "