StorageEntry: Also store copy of name here.

This wastes a bit of space but is necessary for assign message generation.
This commit is contained in:
Peter Johnson
2015-07-26 10:28:20 -07:00
parent 3bc5699ba1
commit fb1b82e239
3 changed files with 11 additions and 5 deletions

View File

@@ -23,7 +23,7 @@ class StorageTest : public ::testing::Test {
Storage::UpdateQueue& updates() { return storage.updates(); }
std::shared_ptr<StorageEntry> GetEntry(StringRef name) {
auto& entry = storage.m_entries[name];
if (!entry) entry = std::make_shared<StorageEntry>();
if (!entry) entry = std::make_shared<StorageEntry>(name);
return entry;
}
Storage storage;
@@ -121,6 +121,7 @@ TEST_F(StorageTest, StorageEntryInit) {
EXPECT_FALSE(entry->value());
EXPECT_EQ(0u, entry->flags());
EXPECT_EQ("foo", entry->name());
EXPECT_EQ(0xffffu, entry->id());
EXPECT_EQ(SequenceNumber(), entry->seq_num());
}