Implement stat
Implement both session based and path based stat, and properly
set commit state to dirty when new content has not been committed.
Resolves: openbmc/phosphor-ipmi-blobs-binarystore#3
Tested: unit tests pass
Signed-off-by: Kun Yi <kunyi731@gmail.com>
Change-Id: I7c833cf4c7dcb0089db778caa60fc92edceb984e
diff --git a/binarystore_mock.hpp b/binarystore_mock.hpp
index 3c7e6c8..9fa83e6 100644
--- a/binarystore_mock.hpp
+++ b/binarystore_mock.hpp
@@ -33,6 +33,8 @@
.WillByDefault(Invoke(&real_store_, &BinaryStore::write));
ON_CALL(*this, commit)
.WillByDefault(Invoke(&real_store_, &BinaryStore::commit));
+ ON_CALL(*this, stat)
+ .WillByDefault(Invoke(&real_store_, &BinaryStore::stat));
}
MOCK_CONST_METHOD0(getBaseBlobId, std::string());
MOCK_CONST_METHOD0(getBlobIds, std::vector<std::string>());
@@ -42,7 +44,7 @@
MOCK_METHOD2(write, bool(uint32_t, const std::vector<uint8_t>&));
MOCK_METHOD0(commit, bool());
MOCK_METHOD0(close, bool());
- MOCK_METHOD0(stat, bool());
+ MOCK_METHOD1(stat, bool(blobs::BlobMeta* meta));
private:
BinaryStore real_store_;