From: Zofia Abramowska Date: Thu, 13 Nov 2014 13:25:56 +0000 (+0100) Subject: Fix segfault in dump_buckets test X-Git-Tag: submit/R4/20141115.054144~29 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F78%2F30278%2F2;p=platform%2Fcore%2Fsecurity%2Fcynara.git Fix segfault in dump_buckets test Change-Id: If614900c9710dc0600c48622051afb484709155f --- diff --git a/test/storage/serializer/serialize.cpp b/test/storage/serializer/serialize.cpp index cceed78..938283d 100644 --- a/test/storage/serializer/serialize.cpp +++ b/test/storage/serializer/serialize.cpp @@ -48,8 +48,8 @@ public: // Fake StorageSerializer for Cynara::PolicyBucket class FakeStorageSerializer : public Cynara::StorageSerializer { public: - FakeStorageSerializer() : Cynara::StorageSerializer(outStream), - outStream(new std::ostringstream()) {} + FakeStorageSerializer(std::shared_ptr o) : Cynara::StorageSerializer(o), + outStream(o) {} MOCK_METHOD1(dump, void(const Cynara::PolicyBucket &bucket)); std::shared_ptr outStream; }; @@ -82,7 +82,8 @@ TEST_F(StorageSerializerFixture, dump_buckets) { using ::testing::UnorderedElementsAreArray; // Will be returned as serializer for buckets - auto fakeBucketSerializer = std::make_shared(); + auto fakeBucketSerializer = std::make_shared( + std::make_shared()); buckets = { { "bucket1", PolicyBucket("bucket1", PredefinedPolicyType::DENY) },