remove proc read from test

This commit is contained in:
ArchSav 2025-11-19 11:44:25 +11:00
parent f5af40f07d
commit 6075f7fac4

View file

@ -60,20 +60,6 @@ static bool startClient(SClient& client) {
close(procInPipeFd[0]);
close(procOutPipeFd[1]);
client.fds = {.fd = client.readFd.get(), .events = POLLIN};
if (poll(&client.fds, 1, 1000) != 1 || !(client.fds.revents & POLLIN))
return false;
client.readBuf.fill(0);
if (read(client.readFd.get(), client.readBuf.data(), client.readBuf.size() - 1) == -1)
return false;
std::string startStr = std::string{client.readBuf.data()};
if (startStr.find("started") == std::string::npos) {
NLog::log("{}Failed to start child-window client, read {}", Colors::RED, startStr);
return false;
}
waitForWindow(client.proc, Tests::windowCount());
NLog::log("{}Started child-window client", Colors::YELLOW);
@ -93,16 +79,6 @@ static bool createChild(SClient& client) {
if ((size_t)write(client.writeFd.get(), cmd.c_str(), cmd.length()) != cmd.length())
return false;
if (poll(&client.fds, 1, 1500) != 1 || !(client.fds.revents & POLLIN))
return false;
ssize_t bytesRead = read(client.fds.fd, client.readBuf.data(), 1023);
if (bytesRead == -1)
return false;
client.readBuf[bytesRead] = 0;
std::string recieved = std::string{client.readBuf.data()};
recieved.pop_back();
waitForWindow(client.proc, Tests::windowCount());
if (getFromSocket("/dispatch focuswindow class:child-test-child") != "ok") {
NLog::log("{}Failed to focus child window", Colors::RED);