Skip to content

Commit 9e5c60a

Browse files
committed
Undefine the max macro
1 parent de8671b commit 9e5c60a

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

Release/tests/functional/streams/istream_tests.cpp

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525

2626
#include <float.h>
2727

28+
#ifdef max
29+
#undef max
30+
#endif
31+
2832
#if defined(__cplusplus_winrt)
2933
using namespace Windows::Storage;
3034
#endif
@@ -90,7 +94,7 @@ void fill_file_w(const utility::string_t &name, size_t repetitions = 1)
9094
for (size_t i = 0; i < repetitions; i++)
9195
for (wchar_t ch = L'a'; ch <= L'z'; ++ch)
9296
fwrite(&ch, sizeof(wchar_t), 1, stream);
93-
97+
9498
fclose(stream);
9599
}
96100
#pragma warning (pop)
@@ -372,7 +376,7 @@ TEST(stream_read_5)
372376
VERIFY_ARE_EQUAL(len, rbuf.putn_nocopy(text, len).get());
373377

374378
istream stream(rbuf);
375-
379+
376380
VERIFY_IS_FALSE(stream.is_eof());
377381
VERIFY_ARE_EQUAL(26u, stream.read_to_delim(trg, '\n').get());
378382
VERIFY_IS_FALSE(stream.is_eof());
@@ -725,7 +729,7 @@ TEST(fstream_read_to_end_3)
725729
pplx::details::do_while([=]()-> pplx::task<bool> {
726730
return stream.read().then(lambda1);
727731
}).wait();
728-
732+
729733
auto& target = sbuf.collection();
730734
VERIFY_ARE_EQUAL(26, target.size());
731735
VERIFY_IS_TRUE(stream.is_eof());
@@ -1174,7 +1178,7 @@ TEST(istream_extract_bool_from_number)
11741178
{
11751179
producer_consumer_buffer<char> rbuf;
11761180
const char *text = " 1 0 NOT_OK";
1177-
1181+
11781182
size_t len = strlen(text);
11791183
rbuf.putn_nocopy(text, len).wait();
11801184
rbuf.close(std::ios_base::out).get();
@@ -1212,7 +1216,7 @@ TEST(istream_extract_bool_from_number_w)
12121216
{
12131217
producer_consumer_buffer<wchar_t> rbuf;
12141218
const wchar_t *text = L" 1 0 NOT_OK";
1215-
1219+
12161220
size_t len = wcslen(text);
12171221
rbuf.putn_nocopy(text, len).wait();
12181222
rbuf.close(std::ios_base::out).get();
@@ -1343,10 +1347,10 @@ TEST(extract_floating_point)
13431347
{
13441348
double expected = 0;
13451349
std_istream >> expected;
1346-
1350+
13471351
const auto actual = istream_double.extract<double>().get();
13481352
compare_double(expected, actual);
1349-
1353+
13501354
if (actual <= std::numeric_limits<float>::max())
13511355
compare_float(float(expected), istream_float.extract<float>().get());
13521356
else
@@ -1360,7 +1364,7 @@ TEST(extract_floating_point)
13601364

13611365
TEST(extract_floating_point_with_exceptions)
13621366
{
1363-
std::vector<std::pair<std::string, std::string>> tests;
1367+
std::vector<std::pair<std::string, std::string>> tests;
13641368
tests.push_back(std::pair<std::string, std::string>("a", "Invalid character 'a'"));
13651369
tests.push_back(std::pair<std::string, std::string>("x", "Invalid character 'x'"));
13661370
tests.push_back(std::pair<std::string, std::string>("e", "Invalid character 'e'"));
@@ -1412,7 +1416,7 @@ TEST(extract_floating_point_with_exceptions)
14121416
TEST(streambuf_read_delim)
14131417
{
14141418
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
14161420

14171421
streams::stringstreambuf data;
14181422

@@ -1423,7 +1427,7 @@ TEST(streambuf_read_delim)
14231427
std::string r("Hello");
14241428
VERIFY_ARE_EQUAL(size, r.size());
14251429
VERIFY_IS_FALSE(is.is_eof());
1426-
1430+
14271431
auto& s2 = data.collection();
14281432
VERIFY_ARE_EQUAL(s2, r);
14291433
return is.read_to_delim(data, ' ');
@@ -1465,7 +1469,7 @@ TEST(uninitialized_streambuf)
14651469
// All operations should throw
14661470
uint8_t * ptr = nullptr;
14671471
size_t count = 0;
1468-
1472+
14691473
VERIFY_THROWS(strbuf.acquire(ptr, count), std::invalid_argument);
14701474
VERIFY_THROWS(strbuf.release(ptr, count), std::invalid_argument);
14711475

0 commit comments

Comments
 (0)