@@ -316,23 +316,26 @@ class test_exception : public std::exception
316
316
}
317
317
};
318
318
319
- // Ignore on WinRT only CodePlex 144
319
+ // Ignore on WinRT CodePlex 144
320
320
#if !defined(__cplusplus_winrt)
321
- TEST_FIXTURE (uri_address, set_body_stream_exception)
321
+ TEST_FIXTURE (uri_address, set_body_stream_exception,
322
+ " Ignore:Apple" , " 296" ,
323
+ " Ignore:Android" , " 296" ,
324
+ " Ignore:Linux" , " 296" )
322
325
{
323
- utility::string_t fname = U (" set_body_stream_exception.txt" );
324
- fill_file (fname);
325
-
326
326
test_http_server::scoped_server scoped (m_uri);
327
327
scoped.server ();
328
328
http_client client (m_uri);
329
329
330
- auto stream = OPEN_R<uint8_t >(fname).get ();
330
+ streams::producer_consumer_buffer<uint8_t > buf;
331
+ const char *data = " abcdefghijklmnopqrstuvwxyz" ;
332
+ buf.putn (reinterpret_cast <const uint8_t *>(data), 26 ).wait ();
333
+
331
334
http_request msg (methods::POST);
332
- msg.set_body (stream );
335
+ msg.set_body (buf. create_istream () );
333
336
msg.headers ().set_content_length (26 );
334
337
335
- stream .close (std::ios::in, std::make_exception_ptr (test_exception ()));
338
+ buf .close (std::ios::in, std::make_exception_ptr (test_exception ())). wait ( );
336
339
337
340
VERIFY_THROWS (client.request (msg).get (), test_exception);
338
341
}
@@ -341,7 +344,10 @@ TEST_FIXTURE(uri_address, set_body_stream_exception)
341
344
// These tests aren't possible on WinRT because they don't
342
345
// specify a Content-Length.
343
346
#if !defined(__cplusplus_winrt)
344
- TEST_FIXTURE (uri_address, stream_close_early)
347
+ TEST_FIXTURE (uri_address, stream_close_early,
348
+ " Ignore:Apple" , " 296" ,
349
+ " Ignore:Android" , " 296" ,
350
+ " Ignore:Linux" , " 296" )
345
351
{
346
352
http_client client (m_uri);
347
353
test_http_server::scoped_server scoped (m_uri);
@@ -358,16 +364,16 @@ TEST_FIXTURE(uri_address, stream_close_early)
358
364
unsigned char data[5 ] = { ' 1' , ' 2' , ' 3' , ' 4' , ' 5' };
359
365
buf.putn (&data[0 ], 5 ).wait ();
360
366
361
- buf.close (std::ios::out);
367
+ buf.close (std::ios::out). wait () ;
362
368
363
369
// Verify that the task completes successfully
364
370
http_asserts::assert_response_equals (responseTask.get (), status_codes::OK);
365
371
}
366
372
367
- TEST_FIXTURE (uri_address, stream_close_early_with_exception,
368
- " Ignore" , " 825361 " ,
369
- " Ignore:Linux " , " TBD " ,
370
- " Ignore:Apple " , " The test server has trouble closing. " )
373
+ TEST_FIXTURE (uri_address, stream_close_early_with_exception,
374
+ " Ignore:Apple " , " 296 " ,
375
+ " Ignore:Android " , " 296 " ,
376
+ " Ignore:Linux " , " 296 " )
371
377
{
372
378
http_client client (m_uri);
373
379
test_http_server::scoped_server scoped (m_uri);
@@ -380,7 +386,7 @@ TEST_FIXTURE(uri_address, stream_close_early)
380
386
unsigned char data[5 ] = { ' 1' , ' 2' , ' 3' , ' 4' , ' 5' };
381
387
buf.putn (&data[0 ], 5 ).wait ();
382
388
383
- buf.close (std::ios::out, std::make_exception_ptr (test_exception ()));
389
+ buf.close (std::ios::out, std::make_exception_ptr (test_exception ())). wait () ;
384
390
385
391
// Verify that the responseTask throws the exception set when closing the stream
386
392
VERIFY_THROWS (responseTask.get (), test_exception);
@@ -389,10 +395,10 @@ TEST_FIXTURE(uri_address, stream_close_early)
389
395
390
396
// Ignore on WinRT only CodePlex 144
391
397
#if !defined(__cplusplus_winrt)
392
- TEST_FIXTURE (uri_address, stream_close_early_with_exception_and_contentlength,
393
- " Ignore" , " 825361 " ,
394
- " Ignore:Linux " , " TBD " ,
395
- " Ignore:Apple " , " The test server has trouble closing. " )
398
+ TEST_FIXTURE (uri_address, stream_close_early_with_exception_and_contentlength,
399
+ " Ignore:Apple " , " 296 " ,
400
+ " Ignore:Android " , " 296 " ,
401
+ " Ignore:Linux " , " 296 " )
396
402
{
397
403
http_client client (m_uri);
398
404
test_http_server::scoped_server scoped (m_uri);
@@ -405,7 +411,7 @@ TEST_FIXTURE(uri_address, stream_close_early_with_exception_and_contentlength,
405
411
unsigned char data[5 ] = { ' 1' , ' 2' , ' 3' , ' 4' , ' 5' };
406
412
buf.putn (&data[0 ], 5 ).wait ();
407
413
408
- buf.close (std::ios::out, std::make_exception_ptr (test_exception ()));
414
+ buf.close (std::ios::out, std::make_exception_ptr (test_exception ())). wait () ;
409
415
410
416
// Verify that the responseTask throws the exception set when closing the stream
411
417
VERIFY_THROWS (responseTask.get (), test_exception);
@@ -415,9 +421,9 @@ TEST_FIXTURE(uri_address, stream_close_early_with_exception_and_contentlength,
415
421
// Ignore on WinRT only CodePlex 144
416
422
#if !defined(__cplusplus_winrt)
417
423
TEST_FIXTURE (uri_address, stream_close_early_with_contentlength,
418
- " Ignore" , " 825361 " ,
419
- " Ignore:Linux " , " TBD " ,
420
- " Ignore:Apple " , " The test server has trouble closing. " )
424
+ " Ignore:Apple " , " 296 " ,
425
+ " Ignore:Android " , " 296 " ,
426
+ " Ignore:Linux " , " 296 " )
421
427
{
422
428
http_client client (m_uri);
423
429
test_http_server::scoped_server scoped (m_uri);
@@ -430,7 +436,7 @@ TEST_FIXTURE(uri_address, stream_close_early_with_contentlength,
430
436
unsigned char data[5 ] = { ' 1' , ' 2' , ' 3' , ' 4' , ' 5' };
431
437
buf.putn (&data[0 ], 5 ).wait ();
432
438
433
- buf.close (std::ios::out);
439
+ buf.close (std::ios::out). wait () ;
434
440
435
441
// Verify that the responseTask throws the exception set when closing the stream
436
442
VERIFY_THROWS (responseTask.get (), http_exception);
0 commit comments