From 4f8fd9ad9234708b70fec26e44299c0283598fec Mon Sep 17 00:00:00 2001 From: wangkai Date: Wed, 2 Nov 2022 10:46:59 +0800 Subject: [PATCH 1/2] blob.cpp change Signed-off-by: wangkai --- services/ans/test/unittest/mock/blob.cpp | 14 -------------- .../distributed/test/unittest/mock/mock_blob.cpp | 13 ------------- 2 files changed, 27 deletions(-) diff --git a/services/ans/test/unittest/mock/blob.cpp b/services/ans/test/unittest/mock/blob.cpp index 540888d0f..9acb0f99d 100644 --- a/services/ans/test/unittest/mock/blob.cpp +++ b/services/ans/test/unittest/mock/blob.cpp @@ -157,20 +157,6 @@ bool Blob::StartsWith(const Blob &blob) const return true; } -bool Blob::Marshalling(Parcel &parcel) const -{ - return parcel.WriteUInt8Vector(this->blob_); -} - -Blob *Blob::Unmarshalling(Parcel &parcel) -{ - std::vector blobData; - if (!parcel.ReadUInt8Vector(&blobData)) { - return nullptr; - } - return new Blob(blobData); -} - /* write blob size and data to memory buffer. return error when bufferLeftSize not enough. */ bool Blob::WriteToBuffer(uint8_t *&cursorPtr, int &bufferLeftSize) const { diff --git a/services/distributed/test/unittest/mock/mock_blob.cpp b/services/distributed/test/unittest/mock/mock_blob.cpp index d55add0bd..490a66758 100644 --- a/services/distributed/test/unittest/mock/mock_blob.cpp +++ b/services/distributed/test/unittest/mock/mock_blob.cpp @@ -90,18 +90,5 @@ std::string Blob::ToString() const return str; } -bool Blob::Marshalling(Parcel &parcel) const -{ - return parcel.WriteUInt8Vector(this->blob_); -} - -Blob *Blob::Unmarshalling(Parcel &parcel) -{ - std::vector blobData; - if (!parcel.ReadUInt8Vector(&blobData)) { - return nullptr; - } - return new Blob(blobData); -} } // namespace DistributedKv } // namespace OHOS \ No newline at end of file -- Gitee From 727f919463fe89437cd054ea65d6e6b822ea4453 Mon Sep 17 00:00:00 2001 From: wangkai Date: Wed, 2 Nov 2022 11:41:28 +0800 Subject: [PATCH 2/2] blob.cpp change 11_2 Signed-off-by: wangkai --- frameworks/test/moduletest/mock/blob.cpp | 14 -------------- services/test/moduletest/mock/blob.cpp | 14 -------------- 2 files changed, 28 deletions(-) diff --git a/frameworks/test/moduletest/mock/blob.cpp b/frameworks/test/moduletest/mock/blob.cpp index 540888d0f..9acb0f99d 100644 --- a/frameworks/test/moduletest/mock/blob.cpp +++ b/frameworks/test/moduletest/mock/blob.cpp @@ -157,20 +157,6 @@ bool Blob::StartsWith(const Blob &blob) const return true; } -bool Blob::Marshalling(Parcel &parcel) const -{ - return parcel.WriteUInt8Vector(this->blob_); -} - -Blob *Blob::Unmarshalling(Parcel &parcel) -{ - std::vector blobData; - if (!parcel.ReadUInt8Vector(&blobData)) { - return nullptr; - } - return new Blob(blobData); -} - /* write blob size and data to memory buffer. return error when bufferLeftSize not enough. */ bool Blob::WriteToBuffer(uint8_t *&cursorPtr, int &bufferLeftSize) const { diff --git a/services/test/moduletest/mock/blob.cpp b/services/test/moduletest/mock/blob.cpp index 540888d0f..9acb0f99d 100644 --- a/services/test/moduletest/mock/blob.cpp +++ b/services/test/moduletest/mock/blob.cpp @@ -157,20 +157,6 @@ bool Blob::StartsWith(const Blob &blob) const return true; } -bool Blob::Marshalling(Parcel &parcel) const -{ - return parcel.WriteUInt8Vector(this->blob_); -} - -Blob *Blob::Unmarshalling(Parcel &parcel) -{ - std::vector blobData; - if (!parcel.ReadUInt8Vector(&blobData)) { - return nullptr; - } - return new Blob(blobData); -} - /* write blob size and data to memory buffer. return error when bufferLeftSize not enough. */ bool Blob::WriteToBuffer(uint8_t *&cursorPtr, int &bufferLeftSize) const { -- Gitee