fn sys_api_call_reject_code_outside_reject_callback() {
    let api_type = test_api_type_for_reject(RejectContext::new(
        RejectCode::CanisterError,
        "canister_reject".to_string(),
    ));
    let wasm_result = execute(
        api_type,
        SystemStateBuilder::default().build(),
        r#"
                (module
                  (type (;0;) (func (result i32)))
                  (type (;1;) (func))
                  (import "ic0" "msg_reject_code" (func (;0;) (type 0)))
                  (func (;1;) (type 1)
                    block
                        call 0
                        i32.const 5
                        i32.eq
                        br_if 0
                        unreachable
                    end)
                  (export "canister_update test" (func 1)))"#,
        test_func_ref(),
    );
    wasm_result.unwrap();
}
// tests the correct reject code is returned
tests the correct reject code is returned
tests the correct reject code is returned
fn sys_api_call_reject_code_outside_reject_callback() {
    let api_type = test_api_type_for_reject(RejectContext::new(
        RejectCode::CanisterError,
        "canister_reject".to_string(),
    ));
    let wasm_result = execute(
        api_type,
        SystemStateBuilder::default().build(),
        r#"
                (module
                  (type (;0;) (func (result i32)))
                  (type (;1;) (func))
                  (import "ic0" "msg_reject_code" (func (;0;) (type 0)))
                  (func (;1;) (type 1)
                    block
                        call 0
                        i32.const 5
                        i32.eq
                        br_if 0
                        unreachable
                    end)
                  (export "canister_update test" (func 1)))"#,
        test_func_ref(),
    );
    wasm_result.unwrap();
}
fn sys_api_call_reject_code_outside_reject_callback ( ) { let api_type = test_api_type_for_reject ( RejectContext :: new ( RejectCode :: CanisterError , " " . to_string ( ) , ) ) ; let wasm_result = execute ( api_type , SystemStateBuilder :: default ( ) . build ( ) , r#"
                (module
                  (type (;0;) (func (result i32)))
                  (type (;1;) (func))
                  (import "ic0" "msg_reject_code" (func (;0;) (type 0)))
                  (func (;1;) (type 1)
                    block
                        call 0
                        i32.const 5
                        i32.eq
                        br_if 0
                        unreachable
                    end)
                  (export "canister_update test" (func 1)))"# , test_func_ref ( ) , ) ; wasm_result . unwrap ( ) ; }
tests the correct reject code is returned
tests the correct reject code is returned