Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Flamefire committed Mar 9, 2022
2 parents 9f9f012 + 1e6badc commit b4c1015
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 23 deletions.
6 changes: 3 additions & 3 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ environment:
configuration: Debug
BOOST_ROOT: C:\Libraries\boost_1_60_0
- CMAKE: true
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
GENERATOR: Visual Studio 16 2019
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
GENERATOR: Visual Studio 17 2022
configuration: Debug
BOOST_ROOT: C:\Libraries\boost_1_73_0
BOOST_ROOT: C:\Libraries\boost_1_77_0

# Coverity
- COVERITY: true
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:
git config --global pack.threads 0
! command -v cmake &> /dev/null || echo "B2_FLAGS=--nowide-enable-cmake" >> $GITHUB_ENV
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
# For coverage builds fetch the whole history, else only 1 commit using a 'fake ternary'
fetch-depth: ${{ matrix.coverage && '0' || '1' }}
Expand All @@ -127,7 +127,7 @@ jobs:
key: ${{matrix.os}}-${{matrix.container}}-${{matrix.compiler}}

- name: Fetch Boost.CI
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: boostorg/boost-ci
ref: master
Expand Down Expand Up @@ -236,7 +236,7 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup MSYS2 environment
uses: msys2/setup-msys2@v2
Expand All @@ -247,7 +247,7 @@ jobs:
pacboy: gcc:p cmake:p ninja:p

- name: Fetch Boost.CI
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: boostorg/boost-ci
ref: master
Expand Down Expand Up @@ -296,9 +296,9 @@ jobs:
runs-on: ${{matrix.os}}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Fetch Boost.CI
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: boostorg/boost-ci
ref: master
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
DEP_DIR: ${{github.workspace}}/dependencies
BOOST_VERSION: 1.56.0
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Sanity check version
run: grep -E 'set\(_version [0-9]' CMakeLists.txt
- uses: actions/cache@v1
Expand All @@ -64,7 +64,7 @@ jobs:
if: matrix.standalone == 'Boost'
run: echo "BOOST_ROOT=${DEP_DIR//\\/\/}/boost_${BOOST_VERSION//./_}" >> $GITHUB_ENV
# Install Boost
- uses: actions/checkout@v2
- uses: actions/checkout@v3
if: matrix.standalone == 'Boost' && steps.cache-boost.outputs.cache-hit != 'true'
with:
repository: boostorg/boost
Expand Down Expand Up @@ -128,9 +128,9 @@ jobs:
CreateBoostDocuTest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Fetch Boost.CI
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: boostorg/boost-ci
ref: master
Expand All @@ -147,7 +147,7 @@ jobs:
CheckFormatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: DoozyX/clang-format-lint-action@v0.11
with:
exclude: './doc'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
DEP_DIR: ${{github.workspace}}/dependencies
BOOST_VERSION: 1.56.0
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Extract tag name
id: get_tag
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update_standalone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
name: Update standalone branch
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup git
run: |
git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com"
Expand Down
28 changes: 21 additions & 7 deletions test/test_iostream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,13 @@ class RedirectStdio
{
if(handleType == STD_INPUT_HANDLE)
{
h = CreateFile("CONIN$", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
h = CreateFile("CONIN$",
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
nullptr,
OPEN_EXISTING,
0,
0);
} else
{
h = CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE,
Expand All @@ -408,7 +414,7 @@ class RedirectStdio
CONSOLE_SCREEN_BUFFER_INFO info;
TEST(GetConsoleScreenBufferInfo(h, &info));
TEST(info.dwSize.X > 0 && info.dwSize.Y > 0);
nw::cout << "Mock console buffer size: " << info.dwSize.X << "x" << info.dwSize.Y << "\n";
std::cout << "Mock console buffer size: " << info.dwSize.X << "x" << info.dwSize.Y << "\n";

std::wstring result;
std::vector<wchar_t> buffer(info.dwSize.X);
Expand All @@ -426,7 +432,7 @@ class RedirectStdio
return result;
}

void setBufferData(std::wstring data, int)
void setBufferData(const std::wstring& data)
{
std::vector<INPUT_RECORD> buffer;
buffer.reserve(data.size() * 2 + 2);
Expand Down Expand Up @@ -460,22 +466,29 @@ class RedirectStdio

void test_console()
{
// cin
std::cout << "Test cin console: " << std::flush;
{
RedirectStdio stdinHandle(STD_INPUT_HANDLE);
std::cout << "stdin redirected, " << std::flush;
// Recreate to react on redirected streams
decltype(nw::cin) cin(nullptr);
std::cout << "cin recreated " << std::flush;
TEST(cin.rdbuf() != std::cin.rdbuf());
std::cout << "and validated" << std::endl;
const std::string testStringIn1 = "Hello std in ";
const std::string testStringIn2 = "\xc3\xa4 - \xc3\xb6 - \xc3\xbc - \xd0\xbc - \xce\xbd";
stdinHandle.setBufferData(nw::widen(testStringIn1 + "\n" + testStringIn2 + "\n"), 0);
std::cout << "Setting mock buffer data" << std::endl;
stdinHandle.setBufferData(nw::widen(testStringIn1 + "\n" + testStringIn2 + "\n"));
std::cout << "Done" << std::endl;
std::string line;
TEST(std::getline(cin, line));
std::cout << "ASCII line read" << std::endl;
TEST_EQ(line, testStringIn1);
TEST(std::getline(cin, line));
std::cout << "UTF-8 line read" << std::endl;
TEST_EQ(line, testStringIn2);
}
// cout
std::cout << "Test cout console" << std::endl;
{
RedirectStdio stdoutHandle(STD_OUTPUT_HANDLE);
decltype(nw::cout) cout(true, nullptr);
Expand All @@ -487,7 +500,7 @@ void test_console()
const auto data = stdoutHandle.getBufferData();
TEST_EQ(data, nw::widen(testString));
}
// cerr
std::cout << "Test cerr console" << std::endl;
{
RedirectStdio stderrHandle(STD_ERROR_HANDLE);

Expand All @@ -500,6 +513,7 @@ void test_console()
const auto data = stderrHandle.getBufferData();
TEST_EQ(data, nw::widen(testString));
}
std::cout << "Console tests done" << std::endl;
}

#else
Expand Down

0 comments on commit b4c1015

Please sign in to comment.