Skip to content

Commit

Permalink
Fix MSAN error.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 687389198
  • Loading branch information
ftsui authored and copybara-github committed Oct 18, 2024
1 parent 76e32d5 commit a6a047d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions sharing/outgoing_share_session_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ TEST_F(OutgoingShareSessionTest, AcceptTransferNotConnected) {

TEST_F(OutgoingShareSessionTest, AcceptTransferNotReady) {
FakeNearbyConnection connection;
session_.set_session_id(1234);
ConnectionSuccess(&connection);

EXPECT_THAT(
Expand Down Expand Up @@ -631,6 +632,7 @@ TEST_F(OutgoingShareSessionTest, HandleConnectionResponseAcceptResponse) {
ConnectionResponseFrame response;
response.set_status(ConnectionResponseFrame::ACCEPT);
FakeNearbyConnection connection;
session_.set_session_id(1234);
ConnectionSuccess(&connection);
EXPECT_CALL(transfer_metadata_callback_,
Call(_, HasStatus(TransferMetadata::Status::kInProgress)));
Expand Down Expand Up @@ -815,6 +817,7 @@ TEST_F(OutgoingShareSessionTest, SendNextPayload) {

TEST_F(OutgoingShareSessionTest, ProcessKeyVerificationResultFail) {
FakeNearbyConnection connection;
session_.set_session_id(1234);
ConnectionSuccess(&connection);
session_.SetTokenForTests("1234");

Expand All @@ -830,6 +833,7 @@ TEST_F(OutgoingShareSessionTest, ProcessKeyVerificationResultFail) {

TEST_F(OutgoingShareSessionTest, ProcessKeyVerificationResultSuccess) {
FakeNearbyConnection connection;
session_.set_session_id(1234);
ConnectionSuccess(&connection);
session_.SetTokenForTests("1234");

Expand All @@ -845,6 +849,7 @@ TEST_F(OutgoingShareSessionTest, ProcessKeyVerificationResultSuccess) {

TEST_F(OutgoingShareSessionTest, DelayCompleteMetadataReceiverDisconnect) {
FakeNearbyConnection connection;
session_.set_session_id(1234);
ConnectionSuccess(&connection);
TransferMetadata complete_metadata =
TransferMetadataBuilder()
Expand All @@ -862,6 +867,7 @@ TEST_F(OutgoingShareSessionTest, DelayCompleteMetadataReceiverDisconnect) {

TEST_F(OutgoingShareSessionTest, DelayCompleteMetadataDisconnectTimeout) {
FakeNearbyConnection connection;
session_.set_session_id(1234);
ConnectionSuccess(&connection);
TransferMetadata complete_metadata =
TransferMetadataBuilder()
Expand Down Expand Up @@ -907,6 +913,7 @@ TEST_F(OutgoingShareSessionTest, UpdateSessionForDedupWithoutCertificate) {
TEST_F(OutgoingShareSessionTest, UpdateSessionForDedupConnectedIsNoOp) {
auto share_target_org = session_.share_target();
FakeNearbyConnection connection;
session_.set_session_id(1234);
ConnectionSuccess(&connection);
ShareTarget share_target2{
"test_update_name", ::nearby::network::Url(), ShareTargetType::kPhone,
Expand Down
2 changes: 1 addition & 1 deletion sharing/share_session.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class ShareSession {
std::shared_ptr<IncomingFramesReader> frames_reader_;
std::shared_ptr<PairedKeyVerificationRunner> key_verification_runner_;
std::shared_ptr<PayloadTracker> payload_tracker_;
int64_t session_id_;
int64_t session_id_ = 0;
::location::nearby::proto::sharing::OSType os_type_ =
::location::nearby::proto::sharing::OSType::UNKNOWN_OS_TYPE;
bool self_share_ = false;
Expand Down

0 comments on commit a6a047d

Please sign in to comment.