13
13
14
14
#include " cpprest/details/http_helpers.h"
15
15
#include " cpprest/version.h"
16
+ #include " cpprest/asyncrt_utils.h"
16
17
#include " stdafx.h"
17
18
#include < fstream>
18
19
@@ -202,16 +203,16 @@ SUITE(compression_tests)
202
203
std::vector<uint8_t > dcmp_buffer;
203
204
web::http::compression::operation_result r;
204
205
std::vector<size_t > chunk_sizes;
205
- Concurrency::task_group_status result;
206
+ pplx::task_status result;
206
207
size_t csize;
207
208
size_t dsize;
208
209
size_t i;
209
210
size_t nn;
210
211
211
212
if (algorithm == fake_provider::FAKE)
212
213
{
213
- compressor = std ::make_unique<fake_provider>(buffer_size);
214
- decompressor = std ::make_unique<fake_provider>(buffer_size);
214
+ compressor = utility::details ::make_unique<fake_provider>(buffer_size);
215
+ decompressor = utility::details ::make_unique<fake_provider>(buffer_size);
215
216
}
216
217
else
217
218
{
@@ -247,7 +248,7 @@ SUITE(compression_tests)
247
248
web::http::compression::operation_hint::has_more)
248
249
.then ([&r](web::http::compression::operation_result x) { r = x; })
249
250
.wait ();
250
- VERIFY_ARE_EQUAL (result, Concurrency::task_group_status ::completed);
251
+ VERIFY_ARE_EQUAL (result, pplx::task_status ::completed);
251
252
VERIFY_ARE_EQUAL (r.input_bytes_processed , std::min (chunk_size, buffer_size - i));
252
253
VERIFY_ARE_EQUAL (r.done , false );
253
254
chunk_sizes.push_back (r.output_bytes_produced );
@@ -272,7 +273,7 @@ SUITE(compression_tests)
272
273
web::http::compression::operation_hint::is_last)
273
274
.then ([&r](web::http::compression::operation_result x) { r = x; })
274
275
.wait ();
275
- VERIFY_ARE_EQUAL (result, Concurrency::task_group_status ::completed);
276
+ VERIFY_ARE_EQUAL (result, pplx::task_status ::completed);
276
277
VERIFY_ARE_EQUAL (r.input_bytes_processed , 0 );
277
278
chunk_sizes.push_back (r.output_bytes_produced );
278
279
csize += r.output_bytes_produced ;
@@ -283,7 +284,7 @@ SUITE(compression_tests)
283
284
result = compressor->compress (NULL , 0 , NULL , 0 , web::http::compression::operation_hint::is_last)
284
285
.then ([&r](web::http::compression::operation_result x) { r = x; })
285
286
.wait ();
286
- VERIFY_ARE_EQUAL (result, Concurrency::task_group_status ::completed);
287
+ VERIFY_ARE_EQUAL (result, pplx::task_status ::completed);
287
288
VERIFY_ARE_EQUAL (r.input_bytes_processed , 0 );
288
289
VERIFY_ARE_EQUAL (r.output_bytes_produced , 0 );
289
290
VERIFY_ARE_EQUAL (r.done , true );
@@ -311,7 +312,7 @@ SUITE(compression_tests)
311
312
hint)
312
313
.then ([&r](web::http::compression::operation_result x) { r = x; })
313
314
.wait ();
314
- VERIFY_ARE_EQUAL (result, Concurrency::task_group_status ::completed);
315
+ VERIFY_ARE_EQUAL (result, pplx::task_status ::completed);
315
316
nn += *it;
316
317
dsize += r.output_bytes_produced ;
317
318
}
@@ -339,7 +340,7 @@ SUITE(compression_tests)
339
340
web::http::compression::operation_hint::has_more)
340
341
.then ([&r](web::http::compression::operation_result x) { r = x; })
341
342
.wait ();
342
- VERIFY_ARE_EQUAL (result, Concurrency::task_group_status ::completed);
343
+ VERIFY_ARE_EQUAL (result, pplx::task_status ::completed);
343
344
dsize += r.output_bytes_produced ;
344
345
nn += r.input_bytes_processed ;
345
346
n -= r.input_bytes_processed ;
@@ -354,7 +355,7 @@ SUITE(compression_tests)
354
355
result = decompressor->decompress (NULL , 0 , NULL , 0 , web::http::compression::operation_hint::has_more)
355
356
.then ([&r](web::http::compression::operation_result x) { r = x; })
356
357
.wait ();
357
- VERIFY_ARE_EQUAL (result, Concurrency::task_group_status ::completed);
358
+ VERIFY_ARE_EQUAL (result, pplx::task_status ::completed);
358
359
VERIFY_ARE_EQUAL (r.input_bytes_processed , 0 );
359
360
VERIFY_ARE_EQUAL (r.output_bytes_produced , 0 );
360
361
VERIFY_IS_TRUE (r.done );
@@ -370,7 +371,7 @@ SUITE(compression_tests)
370
371
web::http::compression::operation_hint::is_last)
371
372
.then ([&r](web::http::compression::operation_result x) { r = x; })
372
373
.wait ();
373
- VERIFY_ARE_EQUAL (result, Concurrency::task_group_status ::completed);
374
+ VERIFY_ARE_EQUAL (result, pplx::task_status ::completed);
374
375
VERIFY_ARE_EQUAL (r.output_bytes_produced , buffer_size);
375
376
VERIFY_ARE_EQUAL (input_buffer, dcmp_buffer);
376
377
@@ -448,28 +449,28 @@ SUITE(compression_tests)
448
449
449
450
std::shared_ptr<web::http::compression::compress_factory> fcf = web::http::compression::make_compress_factory (
450
451
fake_provider::FAKE, []() -> std::unique_ptr<web::http::compression::compress_provider> {
451
- return std ::make_unique<fake_provider>();
452
+ return utility::details ::make_unique<fake_provider>();
452
453
});
453
454
std::vector<std::shared_ptr<web::http::compression::compress_factory>> fcv;
454
455
fcv.push_back (fcf);
455
456
std::shared_ptr<web::http::compression::decompress_factory> fdf =
456
457
web::http::compression::make_decompress_factory (
457
458
fake_provider::FAKE, 800 , []() -> std::unique_ptr<web::http::compression::decompress_provider> {
458
- return std ::make_unique<fake_provider>();
459
+ return utility::details ::make_unique<fake_provider>();
459
460
});
460
461
std::vector<std::shared_ptr<web::http::compression::decompress_factory>> fdv;
461
462
fdv.push_back (fdf);
462
463
463
464
std::shared_ptr<web::http::compression::compress_factory> ncf = web::http::compression::make_compress_factory (
464
465
_NONE, []() -> std::unique_ptr<web::http::compression::compress_provider> {
465
- return std ::make_unique<fake_provider>();
466
+ return utility::details ::make_unique<fake_provider>();
466
467
});
467
468
std::vector<std::shared_ptr<web::http::compression::compress_factory>> ncv;
468
469
ncv.push_back (ncf);
469
470
std::shared_ptr<web::http::compression::decompress_factory> ndf =
470
471
web::http::compression::make_decompress_factory (
471
472
_NONE, 800 , []() -> std::unique_ptr<web::http::compression::decompress_provider> {
472
- return std ::make_unique<fake_provider>();
473
+ return utility::details ::make_unique<fake_provider>();
473
474
});
474
475
std::vector<std::shared_ptr<web::http::compression::decompress_factory>> ndv;
475
476
ndv.push_back (ndf);
@@ -794,7 +795,7 @@ SUITE(compression_tests)
794
795
{
795
796
test_http_server* p_server = nullptr ;
796
797
std::unique_ptr<test_http_server::scoped_server> scoped =
797
- std::move (std ::make_unique<test_http_server::scoped_server>(m_uri));
798
+ std::move (utility::details ::make_unique<test_http_server::scoped_server>(m_uri));
798
799
scoped->server ()->next_request ().then ([&skip_transfer_put](pplx::task<test_request*> op) {
799
800
try
800
801
{
@@ -810,7 +811,7 @@ SUITE(compression_tests)
810
811
811
812
http_client client (m_uri);
812
813
http_request msg (methods::PUT);
813
- msg.set_compressor (std ::make_unique<fake_provider>(0 ));
814
+ msg.set_compressor (utility::details ::make_unique<fake_provider>(0 ));
814
815
msg.set_body (concurrency::streams::rawptr_stream<uint8_t >::open_istream ((const uint8_t *)nullptr , 0 ));
815
816
http_response rsp = client.request (msg).get ();
816
817
rsp.content_ready ().wait ();
@@ -872,7 +873,7 @@ SUITE(compression_tests)
872
873
if (encoding.find (fake_provider::FAKE) != utility::string_t ::npos)
873
874
{
874
875
// This one won't be found in the server's default set...
875
- rsp._get_impl ()->set_compressor (std ::make_unique<fake_provider>(buffer_size));
876
+ rsp._get_impl ()->set_compressor (utility::details ::make_unique<fake_provider>(buffer_size));
876
877
}
877
878
#endif // _WIN32
878
879
rsp.set_body (
@@ -913,7 +914,7 @@ SUITE(compression_tests)
913
914
}
914
915
else
915
916
{
916
- scoped = std::move (std ::make_unique<test_http_server::scoped_server>(m_uri));
917
+ scoped = std::move (utility::details ::make_unique<test_http_server::scoped_server>(m_uri));
917
918
p_server = scoped->server ();
918
919
}
919
920
@@ -968,12 +969,12 @@ SUITE(compression_tests)
968
969
fake_provider::FAKE,
969
970
1000 ,
970
971
[buffer_size]() -> std::unique_ptr<web::http::compression::decompress_provider> {
971
- return std ::make_unique<fake_provider>(buffer_size);
972
+ return utility::details ::make_unique<fake_provider>(buffer_size);
972
973
});
973
974
dfactories.push_back (dmap[fake_provider::FAKE]);
974
975
cfactories.push_back (web::http::compression::make_compress_factory (
975
976
fake_provider::FAKE, [buffer_size]() -> std::unique_ptr<web::http::compression::compress_provider> {
976
- return std ::make_unique<fake_provider>(buffer_size);
977
+ return utility::details ::make_unique<fake_provider>(buffer_size);
977
978
}));
978
979
979
980
v.resize (buffer_size);
@@ -1037,7 +1038,7 @@ SUITE(compression_tests)
1037
1038
if (algorithm == fake_provider::FAKE)
1038
1039
{
1039
1040
VERIFY_IS_FALSE ((bool )c);
1040
- c = std ::make_unique<fake_provider>(buffer_size);
1041
+ c = utility::details ::make_unique<fake_provider>(buffer_size);
1041
1042
}
1042
1043
VERIFY_IS_TRUE ((bool )c);
1043
1044
auto got = c->compress (v.data (),
@@ -1069,7 +1070,7 @@ SUITE(compression_tests)
1069
1070
VERIFY_ARE_EQUAL (boo, algorithm != fake_provider::FAKE);
1070
1071
if (algorithm == fake_provider::FAKE)
1071
1072
{
1072
- msg.set_compressor (std ::make_unique<fake_provider>(buffer_size));
1073
+ msg.set_compressor (utility::details ::make_unique<fake_provider>(buffer_size));
1073
1074
}
1074
1075
}
1075
1076
else
0 commit comments