mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
Update test to use sapi:✌️:Proto<>::FromMessage factory method
The bare constructor is deprecated. PiperOrigin-RevId: 419583946 Change-Id: I7647b74e7f4be65e0bbeba1c1393601ffa87fd80
This commit is contained in:
parent
c3aa56ff37
commit
8d7a442b94
|
@ -50,10 +50,12 @@ absl::Status InvokeStringReversal(Sandbox* sandbox) {
|
||||||
StringopApi api(sandbox);
|
StringopApi api(sandbox);
|
||||||
stringop::StringReverse proto;
|
stringop::StringReverse proto;
|
||||||
proto.set_input("Hello");
|
proto.set_input("Hello");
|
||||||
v::Proto<stringop::StringReverse> pp(proto);
|
absl::StatusOr<v::Proto<stringop::StringReverse>> pp(
|
||||||
SAPI_ASSIGN_OR_RETURN(int return_code, api.pb_reverse_string(pp.PtrBoth()));
|
v::Proto<stringop::StringReverse>::FromMessage(proto));
|
||||||
|
SAPI_RETURN_IF_ERROR(pp.status());
|
||||||
|
SAPI_ASSIGN_OR_RETURN(int return_code, api.pb_reverse_string(pp->PtrBoth()));
|
||||||
TRANSACTION_FAIL_IF_NOT(return_code != 0, "pb_reverse_string failed");
|
TRANSACTION_FAIL_IF_NOT(return_code != 0, "pb_reverse_string failed");
|
||||||
SAPI_ASSIGN_OR_RETURN(auto pb_result, pp.GetMessage());
|
SAPI_ASSIGN_OR_RETURN(auto pb_result, pp->GetMessage());
|
||||||
TRANSACTION_FAIL_IF_NOT(pb_result.output() == "olleH", "Incorrect output");
|
TRANSACTION_FAIL_IF_NOT(pb_result.output() == "olleH", "Incorrect output");
|
||||||
return absl::OkStatus();
|
return absl::OkStatus();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user