aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Example
diff options
context:
space:
mode:
authorGravatar Gil <mcg@google.com>2018-06-13 08:12:09 -0700
committerGravatar GitHub <noreply@github.com>2018-06-13 08:12:09 -0700
commitafd897619fba10b881c4567d76793c6fdc60e93a (patch)
tree916cfceabe732ca375b82c7fe4e2cecfb265d251 /Firestore/Example
parent51fb4d0ca4fae5ad30b53c9470f9e59c4678b034 (diff)
Minor LevelDB cleanups (#1401)
* Add leveldb_transaction* to the CMake build * Use std::unique_ptr for leveldb::DB pointers
Diffstat (limited to 'Firestore/Example')
-rw-r--r--Firestore/Example/Tests/Local/FSTLevelDBMigrationsTests.mm8
-rw-r--r--Firestore/Example/Tests/Local/FSTLevelDBTransactionTests.mm2
2 files changed, 5 insertions, 5 deletions
diff --git a/Firestore/Example/Tests/Local/FSTLevelDBMigrationsTests.mm b/Firestore/Example/Tests/Local/FSTLevelDBMigrationsTests.mm
index 3da8083..e6ab720 100644
--- a/Firestore/Example/Tests/Local/FSTLevelDBMigrationsTests.mm
+++ b/Firestore/Example/Tests/Local/FSTLevelDBMigrationsTests.mm
@@ -42,7 +42,7 @@ using leveldb::Status;
@end
@implementation FSTLevelDBMigrationsTests {
- std::shared_ptr<DB> _db;
+ std::unique_ptr<DB> _db;
}
- (void)setUp {
@@ -62,12 +62,12 @@ using leveldb::Status;
}
- (void)testAddsTargetGlobal {
- FSTPBTargetGlobal *metadata = [FSTLevelDBQueryCache readTargetMetadataFromDB:_db];
+ FSTPBTargetGlobal *metadata = [FSTLevelDBQueryCache readTargetMetadataFromDB:_db.get()];
XCTAssertNil(metadata, @"Not expecting metadata yet, we should have an empty db");
LevelDbTransaction transaction(_db.get(), "testAddsTargetGlobal");
[FSTLevelDBMigrations runMigrationsWithTransaction:&transaction];
transaction.Commit();
- metadata = [FSTLevelDBQueryCache readTargetMetadataFromDB:_db];
+ metadata = [FSTLevelDBQueryCache readTargetMetadataFromDB:_db.get()];
XCTAssertNotNil(metadata, @"Migrations should have added the metadata");
}
@@ -107,7 +107,7 @@ using leveldb::Status;
LevelDbTransaction transaction(_db.get(), "testCountsQueries");
[FSTLevelDBMigrations runMigrationsWithTransaction:&transaction];
transaction.Commit();
- FSTPBTargetGlobal *metadata = [FSTLevelDBQueryCache readTargetMetadataFromDB:_db];
+ FSTPBTargetGlobal *metadata = [FSTLevelDBQueryCache readTargetMetadataFromDB:_db.get()];
XCTAssertEqual(expected, metadata.targetCount, @"Failed to count all of the targets we added");
}
}
diff --git a/Firestore/Example/Tests/Local/FSTLevelDBTransactionTests.mm b/Firestore/Example/Tests/Local/FSTLevelDBTransactionTests.mm
index 29f5d6c..5c2718b 100644
--- a/Firestore/Example/Tests/Local/FSTLevelDBTransactionTests.mm
+++ b/Firestore/Example/Tests/Local/FSTLevelDBTransactionTests.mm
@@ -46,7 +46,7 @@ using firebase::firestore::local::LevelDbTransaction;
@end
@implementation FSTLevelDBTransactionTests {
- std::shared_ptr<DB> _db;
+ std::unique_ptr<DB> _db;
}
- (void)setUp {