Use Protobuf's AbslStringify to stringify protos.

Protobuf DebugString APIs will be deprecated.

PiperOrigin-RevId: 543355252
Change-Id: Ieea97e87fc592c023cb2f965be3926f52192ffe4
This commit is contained in:
Sandboxed API Team 2023-06-26 00:32:40 -07:00 committed by Copybara-Service
parent 64ac98bf4d
commit a94b17d821
2 changed files with 3 additions and 3 deletions

View File

@ -56,7 +56,7 @@ TEST(StringopTest, ProtobufStringDuplication) {
}
SAPI_ASSIGN_OR_RETURN(auto pb_result, pp->GetMessage());
LOG(INFO) << "Result PB: " << pb_result.DebugString();
LOG(INFO) << "Result PB: " << pb_result;
TRANSACTION_FAIL_IF_NOT(pb_result.output() == "HelloHello",
"Incorrect output");
return absl::OkStatus();
@ -77,7 +77,7 @@ TEST(StringopTest, ProtobufStringReversal) {
EXPECT_THAT(return_value, Ne(0)) << "pb_reverse_string() failed";
SAPI_ASSERT_OK_AND_ASSIGN(auto pb_result, pp->GetMessage());
LOG(INFO) << "Result PB: " << pb_result.DebugString();
LOG(INFO) << "Result PB: " << pb_result;
EXPECT_THAT(pb_result.output(), StrEq("olleH"));
}

View File

@ -16,6 +16,6 @@
#include "sandboxed_api/examples/sum/sum_params.pb.h"
extern "C" int sumproto(const sumsapi::SumParamsProto* params) {
LOG(INFO) << "Param is " << params->DebugString();
LOG(INFO) << "Param is " << *params;
return params->a() + params->b() + params->c();
}