fix tests
This commit is contained in:
@@ -38,17 +38,15 @@ TEST_F(ProcessTest, Output) {
|
||||
launcher.exec(command, args);
|
||||
ASSERT_TRUE(launcher.isRunning());
|
||||
|
||||
piMSleep(100);
|
||||
|
||||
ASSERT_TRUE(launcher.waitForFinish());
|
||||
ASSERT_TRUE(launcher.isExecFinished());
|
||||
|
||||
const auto out = PIString::fromConsole(launcher.readOutput());
|
||||
const auto err = PIString::fromConsole(launcher.readError());
|
||||
const auto out = PIString::fromAscii(launcher.readOutput());
|
||||
const auto err = PIString::fromAscii(launcher.readError());
|
||||
|
||||
EXPECT_TRUE(out.contains("Hello from stdout"));
|
||||
EXPECT_TRUE(err.contains("Hello from stderr"));
|
||||
|
||||
ASSERT_TRUE(launcher.waitForFinish());
|
||||
const int exit_code = launcher.exitCode();
|
||||
EXPECT_FALSE(launcher.isRunning());
|
||||
|
||||
@@ -71,21 +69,27 @@ TEST_F(ProcessTest, Input) {
|
||||
launcher.enableWriteStdIn();
|
||||
launcher.exec(command, args);
|
||||
ASSERT_TRUE(launcher.isRunning());
|
||||
piMSleep(100);
|
||||
EXPECT_TRUE(launcher.isExecStarted());
|
||||
EXPECT_TRUE(!launcher.isExecFinished());
|
||||
|
||||
const PIString test_input = "Test input string\n";
|
||||
EXPECT_TRUE(launcher.writeInput(test_input.toSystem()));
|
||||
EXPECT_TRUE(launcher.writeInput(test_input.toAscii()));
|
||||
launcher.closeInput();
|
||||
|
||||
piMSleep(100);
|
||||
ASSERT_TRUE(launcher.waitForFinish());
|
||||
EXPECT_TRUE(launcher.isExecFinished());
|
||||
|
||||
const auto out = PIString::fromConsole(launcher.readOutput());
|
||||
const auto out = PIString::fromAscii(launcher.readOutput());
|
||||
EXPECT_TRUE(out.contains("Test input string"));
|
||||
}
|
||||
|
||||
|
||||
TEST_F(ProcessTest, DISABLED_NonexistentCommand) {
|
||||
TEST_F(ProcessTest, NonexistentCommand) {
|
||||
const PIString command = {"nonexistent_command_12345"};
|
||||
|
||||
launcher.exec(command);
|
||||
EXPECT_FALSE(launcher.isRunning());
|
||||
ASSERT_TRUE(launcher.isRunning());
|
||||
ASSERT_TRUE(launcher.waitForFinish());
|
||||
EXPECT_FALSE(!launcher.isExecFinished());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user