Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3393913
D3696.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D3696.diff
View Options
diff --git a/services/blob/test/DatabaseManagerTest.cpp b/services/blob/test/DatabaseManagerTest.cpp
--- a/services/blob/test/DatabaseManagerTest.cpp
+++ b/services/blob/test/DatabaseManagerTest.cpp
@@ -38,13 +38,7 @@
std::shared_ptr<BlobItem> foundItem =
DatabaseManager::getInstance().findBlobItem(item.getBlobHash());
EXPECT_NE(foundItem->getCreated(), 0);
- EXPECT_EQ(item.getBlobHash().size(), foundItem->getBlobHash().size());
- EXPECT_EQ(
- memcmp(
- item.getBlobHash().data(),
- foundItem->getBlobHash().data(),
- item.getBlobHash().size()),
- 0);
+ EXPECT_EQ(item.getBlobHash(), foundItem->getBlobHash());
const BlobItem item2(generateName(), S3Path(generateName(), generateName()));
DatabaseManager::getInstance().putBlobItem(item2);
DatabaseManager::getInstance().removeBlobItem(item.getBlobHash());
@@ -65,22 +59,10 @@
item.getBlobHash());
EXPECT_EQ(foundItems.size(), 1);
std::shared_ptr<ReverseIndexItem> foundItem = foundItems.at(0);
- EXPECT_EQ(item.getBlobHash().size(), foundItem->getBlobHash().size());
- EXPECT_EQ(
- memcmp(
- item.getBlobHash().data(),
- foundItem->getBlobHash().data(),
- item.getBlobHash().size()),
- 0);
+ EXPECT_EQ(item.getBlobHash(), foundItem->getBlobHash());
foundItem = std::dynamic_pointer_cast<ReverseIndexItem>(
DatabaseManager::getInstance().findReverseIndexItemByHolder(
item.getHolder()));
- EXPECT_EQ(item.getBlobHash().size(), foundItem->getBlobHash().size());
- EXPECT_EQ(
- memcmp(
- item.getBlobHash().data(),
- foundItem->getBlobHash().data(),
- item.getBlobHash().size()),
- 0);
+ EXPECT_EQ(item.getBlobHash(), foundItem->getBlobHash());
DatabaseManager::getInstance().removeReverseIndexItem(foundItem->getHolder());
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 1, 4:25 PM (21 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2605562
Default Alt Text
D3696.diff (1 KB)
Attached To
Mode
D3696: [services] Blob - Switch from memcmp to a simple EQ in database tests
Attached
Detach File
Event Timeline
Log In to Comment