@@ -122,8 +122,8 @@ TEST_F(AwsChunkedStreamTest, ShouldWorkOnEmptyStream) {
122122TEST_F (AwsChunkedStreamTest, ChunkingInterceptorShouldWork) {
123123 auto request = CreateRequestWithChecksum (" www.elda.com/will" , " 1234567890123456789012345" );
124124 std::shared_ptr<IOStream> inputStream = Aws::MakeShared<StringStream>(TEST_LOG_TAG, " 1234567890123456789012345" );
125- auto chunkedBuf = Aws::MakeUnique <smithy::client::features::AwsChunkedStreamBuf>(TEST_LOG_TAG, &request, inputStream, 10 );
126- Aws::IOStream chunkedStream (chunkedBuf.release ());
125+ auto chunkedBuf = Aws::MakeShared <smithy::client::features::AwsChunkedStreamBuf>(TEST_LOG_TAG, &request, inputStream, 10 );
126+ Aws::IOStream chunkedStream (chunkedBuf.get ());
127127 const auto encodedStr = ReadEntireStream (chunkedStream);
128128 auto expectedStreamWithChecksum = " A\r\n 1234567890\r\n A\r\n 1234567890\r\n 5\r\n 12345\r\n 0\r\n x-amz-checksum-crc32:78DeVw==\r\n\r\n " ;
129129 EXPECT_EQ (expectedStreamWithChecksum, encodedStr);
@@ -132,8 +132,8 @@ TEST_F(AwsChunkedStreamTest, ChunkingInterceptorShouldWork) {
132132TEST_F (AwsChunkedStreamTest, ChunkingInterceptorShouldNotRequireTwoReadsOnSmallChunk) {
133133 auto request = CreateRequestWithChecksum (" www.clemar.com/strohl" , " 12345" );
134134 std::shared_ptr<IOStream> inputStream = Aws::MakeShared<StringStream>(TEST_LOG_TAG, " 12345" );
135- auto chunkedBuf = Aws::MakeUnique <smithy::client::features::AwsChunkedStreamBuf>(TEST_LOG_TAG, &request, inputStream, 100 );
136- Aws::IOStream chunkedStream (chunkedBuf.release ());
135+ auto chunkedBuf = Aws::MakeShared <smithy::client::features::AwsChunkedStreamBuf>(TEST_LOG_TAG, &request, inputStream, 100 );
136+ Aws::IOStream chunkedStream (chunkedBuf.get ());
137137 const auto encodedStr = ReadEntireStream (chunkedStream);
138138 auto expectedStreamWithChecksum = " 5\r\n 12345\r\n 0\r\n x-amz-checksum-crc32:y/U6HA==\r\n\r\n " ;
139139 EXPECT_EQ (expectedStreamWithChecksum, encodedStr);
@@ -142,8 +142,8 @@ TEST_F(AwsChunkedStreamTest, ChunkingInterceptorShouldNotRequireTwoReadsOnSmallC
142142TEST_F (AwsChunkedStreamTest, ChunkingInterceptorShouldWorkOnSmallBuffer) {
143143 auto request = CreateRequestWithChecksum (" www.eugief.com/hesimay" , " 1234567890" );
144144 std::shared_ptr<IOStream> inputStream = Aws::MakeShared<StringStream>(TEST_LOG_TAG, " 1234567890" );
145- auto chunkedBuf = Aws::MakeUnique <smithy::client::features::AwsChunkedStreamBuf>(TEST_LOG_TAG, &request, inputStream, 5 );
146- Aws::IOStream chunkedStream (chunkedBuf.release ());
145+ auto chunkedBuf = Aws::MakeShared <smithy::client::features::AwsChunkedStreamBuf>(TEST_LOG_TAG, &request, inputStream, 5 );
146+ Aws::IOStream chunkedStream (chunkedBuf.get ());
147147 char buffer[10 ];
148148 chunkedStream.read (buffer, sizeof (buffer));
149149 std::string firstRead (buffer, chunkedStream.gcount ());
@@ -159,8 +159,8 @@ TEST_F(AwsChunkedStreamTest, ChunkingInterceptorShouldWorkOnSmallBuffer) {
159159TEST_F (AwsChunkedStreamTest, ChunkingInterceptorShouldWorkOnEmptyStream) {
160160 auto request = CreateRequestWithChecksum (" www.nidia.com/juna" , " " );
161161 std::shared_ptr<IOStream> inputStream = Aws::MakeShared<StringStream>(TEST_LOG_TAG, " " );
162- auto chunkedBuf = Aws::MakeUnique <smithy::client::features::AwsChunkedStreamBuf>(TEST_LOG_TAG, &request, inputStream, 5 );
163- Aws::IOStream chunkedStream (chunkedBuf.release ());
162+ auto chunkedBuf = Aws::MakeShared <smithy::client::features::AwsChunkedStreamBuf>(TEST_LOG_TAG, &request, inputStream, 5 );
163+ Aws::IOStream chunkedStream (chunkedBuf.get ());
164164 const auto encodedStr = ReadEntireStream (chunkedStream);
165165 EXPECT_EQ (" 0\r\n x-amz-checksum-crc32:AAAAAA==\r\n\r\n " , encodedStr);
166166}
0 commit comments