2
0
mirror of https://github.com/boostorg/process.git synced 2026-01-19 04:22:15 +00:00

popen test adjustements.

This commit is contained in:
Klemens Morgenstern
2023-06-21 13:23:51 +08:00
committed by Klemens Morgenstern
parent ccd1717588
commit d73f228469
2 changed files with 3 additions and 5 deletions

View File

@@ -20,7 +20,7 @@ namespace windows
/// A windows launcher using CreateProcessWithLogon instead of CreateProcess
struct with_logon_launcher : default_launcher
{
std::wstring username, domain, password;
std::wstring username, password, domain;
DWORD logon_flags{0u};
with_logon_launcher(std::wstring username = L"",

View File

@@ -377,7 +377,7 @@ BOOST_AUTO_TEST_CASE(popen)
// default CWD
bpv::popen proc(/*bpv::default_process_launcher(), */ctx, pth, {"echo"});
asio::write(proc, asio::buffer("FOOBAR"));
BOOST_CHECK_EQUAL(asio::write(proc, asio::buffer("FOOBAR", 6)), 6);
proc.get_stdin().close();
std::string res;
@@ -391,10 +391,8 @@ BOOST_AUTO_TEST_CASE(popen)
|| ec == asio::error::bad_descriptor,
ec.message());
BOOST_REQUIRE_GE(n, 1u);
// remove EOF
res.pop_back();
BOOST_CHECK_EQUAL(res, "FOOBAR");
proc.get_stdin().close();
proc.wait();
BOOST_CHECK_MESSAGE(proc.exit_code() == 0, proc.exit_code());
}