diff options
Diffstat (limited to 'src/mongo/db/storage/wiredtiger/wiredtiger_prefixed_index_test.cpp')
-rw-r--r-- | src/mongo/db/storage/wiredtiger/wiredtiger_prefixed_index_test.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_prefixed_index_test.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_prefixed_index_test.cpp index d069c12ee13..9f7e391a709 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_prefixed_index_test.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_prefixed_index_test.cpp @@ -71,23 +71,23 @@ public: } std::unique_ptr<SortedDataInterface> newIdIndexSortedDataInterface() final { - std::string ns = "test.wt"; + NamespaceString nss = {"test", "wt"}; OperationContextNoop opCtx(newRecoveryUnit().release()); BSONObj spec = BSON("key" << BSON("_id" << 1) << "name" << "_id_" << "v" << static_cast<int>(IndexDescriptor::kLatestIndexVersion) << "unique" << true); - auto collection = std::make_unique<CollectionMock>(NamespaceString(ns)); + auto collection = std::make_unique<CollectionMock>(nss); IndexDescriptor desc(collection.get(), "", spec); invariant(desc.isIdIndex()); KVPrefix prefix = KVPrefix::generateNextPrefix(); StatusWith<std::string> result = WiredTigerIndex::generateCreateString( - kWiredTigerEngineName, "", "", desc, prefix.isPrefixed()); + kWiredTigerEngineName, "", "", nss, desc, prefix.isPrefixed()); ASSERT_OK(result.getStatus()); - string uri = "table:" + ns; + string uri = "table:" + nss.ns(); invariantWTOK(WiredTigerIndex::Create(&opCtx, uri, result.getValue())); return std::make_unique<WiredTigerIndexUnique>(&opCtx, uri, &desc, prefix); @@ -95,7 +95,7 @@ public: std::unique_ptr<SortedDataInterface> newSortedDataInterface(bool unique, bool partial) final { - std::string ns = "test.wt"; + NamespaceString nss = {"test", "wt"}; OperationContextNoop opCtx(newRecoveryUnit().release()); BSONObj spec = BSON("key" << BSON("a" << 1) << "name" @@ -110,15 +110,15 @@ public: spec = spec.addField(partialBSON.firstElement()); } - auto collection = std::make_unique<CollectionMock>(NamespaceString(ns)); - IndexDescriptor desc(collection.get(), "", spec); + auto collection = std::make_unique<CollectionMock>(nss); + IndexDescriptor& desc = _descriptors.emplace_back(collection.get(), "", spec); KVPrefix prefix = KVPrefix::generateNextPrefix(); StatusWith<std::string> result = WiredTigerIndex::generateCreateString( - kWiredTigerEngineName, "", "", desc, prefix.isPrefixed()); + kWiredTigerEngineName, "", "", nss, desc, prefix.isPrefixed()); ASSERT_OK(result.getStatus()); - string uri = "table:" + ns; + string uri = "table:" + nss.ns(); invariantWTOK(WiredTigerIndex::Create(&opCtx, uri, result.getValue())); if (unique) @@ -133,6 +133,7 @@ public: private: unittest::TempDir _dbpath; std::unique_ptr<ClockSource> _fastClockSource; + std::vector<IndexDescriptor> _descriptors; WT_CONNECTION* _conn; WiredTigerSessionCache* _sessionCache; WiredTigerOplogManager _oplogManager; |