25
25
26
26
#include < float.h>
27
27
28
+ #ifdef max
29
+ #undef max
30
+ #endif
31
+
28
32
#if defined(__cplusplus_winrt)
29
33
using namespace Windows ::Storage;
30
34
#endif
@@ -90,7 +94,7 @@ void fill_file_w(const utility::string_t &name, size_t repetitions = 1)
90
94
for (size_t i = 0 ; i < repetitions; i++)
91
95
for (wchar_t ch = L' a' ; ch <= L' z' ; ++ch)
92
96
fwrite (&ch, sizeof (wchar_t ), 1 , stream);
93
-
97
+
94
98
fclose (stream);
95
99
}
96
100
#pragma warning (pop)
@@ -372,7 +376,7 @@ TEST(stream_read_5)
372
376
VERIFY_ARE_EQUAL (len, rbuf.putn_nocopy (text, len).get ());
373
377
374
378
istream stream (rbuf);
375
-
379
+
376
380
VERIFY_IS_FALSE (stream.is_eof ());
377
381
VERIFY_ARE_EQUAL (26u , stream.read_to_delim (trg, ' \n ' ).get ());
378
382
VERIFY_IS_FALSE (stream.is_eof ());
@@ -725,7 +729,7 @@ TEST(fstream_read_to_end_3)
725
729
pplx::details::do_while ([=]()-> pplx::task<bool > {
726
730
return stream.read ().then (lambda1);
727
731
}).wait ();
728
-
732
+
729
733
auto & target = sbuf.collection ();
730
734
VERIFY_ARE_EQUAL (26 , target.size ());
731
735
VERIFY_IS_TRUE (stream.is_eof ());
@@ -1174,7 +1178,7 @@ TEST(istream_extract_bool_from_number)
1174
1178
{
1175
1179
producer_consumer_buffer<char > rbuf;
1176
1180
const char *text = " 1 0 NOT_OK" ;
1177
-
1181
+
1178
1182
size_t len = strlen (text);
1179
1183
rbuf.putn_nocopy (text, len).wait ();
1180
1184
rbuf.close (std::ios_base::out).get ();
@@ -1212,7 +1216,7 @@ TEST(istream_extract_bool_from_number_w)
1212
1216
{
1213
1217
producer_consumer_buffer<wchar_t > rbuf;
1214
1218
const wchar_t *text = L" 1 0 NOT_OK" ;
1215
-
1219
+
1216
1220
size_t len = wcslen (text);
1217
1221
rbuf.putn_nocopy (text, len).wait ();
1218
1222
rbuf.close (std::ios_base::out).get ();
@@ -1343,10 +1347,10 @@ TEST(extract_floating_point)
1343
1347
{
1344
1348
double expected = 0 ;
1345
1349
std_istream >> expected;
1346
-
1350
+
1347
1351
const auto actual = istream_double.extract <double >().get ();
1348
1352
compare_double (expected, actual);
1349
-
1353
+
1350
1354
if (actual <= std::numeric_limits<float >::max ())
1351
1355
compare_float (float (expected), istream_float.extract <float >().get ());
1352
1356
else
@@ -1360,7 +1364,7 @@ TEST(extract_floating_point)
1360
1364
1361
1365
TEST (extract_floating_point_with_exceptions)
1362
1366
{
1363
- std::vector<std::pair<std::string, std::string>> tests;
1367
+ std::vector<std::pair<std::string, std::string>> tests;
1364
1368
tests.push_back (std::pair<std::string, std::string>(" a" , " Invalid character 'a'" ));
1365
1369
tests.push_back (std::pair<std::string, std::string>(" x" , " Invalid character 'x'" ));
1366
1370
tests.push_back (std::pair<std::string, std::string>(" e" , " Invalid character 'e'" ));
@@ -1412,7 +1416,7 @@ TEST(extract_floating_point_with_exceptions)
1412
1416
TEST (streambuf_read_delim)
1413
1417
{
1414
1418
producer_consumer_buffer<uint8_t > rbuf;
1415
- std::string s (" Hello World" ); // there are 2 spaces here
1419
+ std::string s (" Hello World" ); // there are 2 spaces here
1416
1420
1417
1421
streams::stringstreambuf data;
1418
1422
@@ -1423,7 +1427,7 @@ TEST(streambuf_read_delim)
1423
1427
std::string r (" Hello" );
1424
1428
VERIFY_ARE_EQUAL (size, r.size ());
1425
1429
VERIFY_IS_FALSE (is.is_eof ());
1426
-
1430
+
1427
1431
auto & s2 = data.collection ();
1428
1432
VERIFY_ARE_EQUAL (s2, r);
1429
1433
return is.read_to_delim (data, ' ' );
@@ -1465,7 +1469,7 @@ TEST(uninitialized_streambuf)
1465
1469
// All operations should throw
1466
1470
uint8_t * ptr = nullptr ;
1467
1471
size_t count = 0 ;
1468
-
1472
+
1469
1473
VERIFY_THROWS (strbuf.acquire (ptr, count), std::invalid_argument);
1470
1474
VERIFY_THROWS (strbuf.release (ptr, count), std::invalid_argument);
1471
1475
0 commit comments