Skip to content

Commit 0d6782b

Browse files
authored
Merge pull request #207 from boostorg/const-warn
2 parents 43cfe30 + 89d5f08 commit 0d6782b

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

test/test_iostream.cpp

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -514,17 +514,23 @@ void test_console()
514514
TEST(std::getline(cin, line));
515515
std::cout << "ASCII line read" << std::endl;
516516
// MinGW on CI sometimes swallows the (mocked) first line or returns it multiple times
517+
DISABLE_CONST_EXPR_DETECTED
517518
if(isMinGW_CI && line == testStringIn2)
519+
{
520+
DISABLE_CONST_EXPR_DETECTED_POP
518521
std::cout << "WARNING: MinGW CI issue detected, skipping part of test"; // LCOV_EXCL_LINE
519-
else
522+
} else
520523
{
521524
TEST_EQ(line, testStringIn1);
522525
std::cout << "UTF-8 line read" << std::endl;
523526
line.clear();
524527
TEST(std::getline(cin, line));
528+
DISABLE_CONST_EXPR_DETECTED
525529
if(isMinGW_CI && line == testStringIn1)
530+
{
531+
DISABLE_CONST_EXPR_DETECTED_POP
526532
std::cout << "WARNING: MinGW CI issue detected, skipping 1st part of test"; // LCOV_EXCL_LINE
527-
else
533+
} else
528534
TEST_EQ(line, testStringIn2);
529535
}
530536
}
@@ -540,9 +546,12 @@ void test_console()
540546
cout << testString << std::flush;
541547

542548
const auto data = stdoutHandle.getBufferData();
549+
DISABLE_CONST_EXPR_DETECTED
543550
if(isMinGW_CI && data.empty())
551+
{
552+
DISABLE_CONST_EXPR_DETECTED_POP
544553
std::cout << "WARNING: MinGW CI issue detected, skipping part of test"; // LCOV_EXCL_LINE
545-
else
554+
} else
546555
TEST_EQ(data, nw::widen(testString));
547556
}
548557
std::cout << "Test cerr console" << std::endl;
@@ -557,9 +566,12 @@ void test_console()
557566
cerr << testString << std::flush;
558567

559568
const auto data = stderrHandle.getBufferData();
569+
DISABLE_CONST_EXPR_DETECTED
560570
if(isMinGW_CI && data.empty())
571+
{
572+
DISABLE_CONST_EXPR_DETECTED_POP
561573
std::cout << "WARNING: MinGW CI issue detected, skipping part of test"; // LCOV_EXCL_LINE
562-
else
574+
} else
563575
TEST_EQ(data, nw::widen(testString));
564576
}
565577
std::cout << "Console tests done" << std::endl;

0 commit comments

Comments
 (0)