Skip to content

Commit

Permalink
update firestore_test file
Browse files Browse the repository at this point in the history
  • Loading branch information
milaGGL committed May 18, 2023
1 parent 158986f commit 7639a73
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions firestore/integration_test_internal/src/firestore_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ using ::testing::HasSubstr;

class FirestoreTest : public FirestoreIntegrationTest {
protected:
const std::string GetFirestoreDatabaseId(Firestore* firestore) {
return GetInternal(firestore)->database_name();
const std::string& GetFirestoreDatabaseId(Firestore* firestore) {
return GetInternal(firestore)->database_id().database_id();
}
};

Expand Down
4 changes: 1 addition & 3 deletions firestore/src/android/firestore_android.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,7 @@ class FirestoreInternal {
firestore_public_ = firestore_public;
}

const model::DatabaseId& database_id() const {
return this->database_id();
}
const model::DatabaseId& database_id() const { return this->database_id(); }

Firestore* firestore_public() { return firestore_public_; }
const Firestore* firestore_public() const { return firestore_public_; }
Expand Down
7 changes: 4 additions & 3 deletions firestore/src/common/firestore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ Firestore* Firestore::AddFirestoreToCache(Firestore* firestore,
return nullptr;
}

FirestoreMap::key_type key =
MakeKey(firestore->app(), firestore->internal_->database_id().database_id());
FirestoreMap::key_type key = MakeKey(
firestore->app(), firestore->internal_->database_id().database_id());
FirestoreCache()->emplace(key, firestore);
return firestore;
}
Expand Down Expand Up @@ -381,7 +381,8 @@ Future<void> Firestore::EnableNetwork() {

Future<void> Firestore::Terminate() {
if (!internal_) return FailedFuture<void>();
FirestoreMap::key_type key = MakeKey(app(), internal_->database_id().database_id());
FirestoreMap::key_type key =
MakeKey(app(), internal_->database_id().database_id());

FirestoreCache()->erase(key);
return internal_->Terminate();
Expand Down

0 comments on commit 7639a73

Please sign in to comment.