Lines Matching +full:control +full:- +full:parent
26 #include "atf-c++/utils.hpp"
43 #include <atf-c++.hpp>
51 if (fd == -1) in read_file()
53 const ssize_t length = read(fd, buffer, sizeof(buffer) - 1); in read_file()
55 ATF_REQUIRE(length != -1); in read_file()
56 if (length == sizeof(buffer) - 1) in read_file()
63 // ------------------------------------------------------------------------
65 // ------------------------------------------------------------------------
155 for (; i < sizeof(long_contents) - 1; i++) in ATF_TEST_CASE_BODY()
168 for (; i < sizeof(long_contents) - 1; i++) in ATF_TEST_CASE_BODY()
176 long_contents[i - 1] = 'Z'; in ATF_TEST_CASE_BODY()
184 ATF_REQUIRE(chmod("src.txt", 0520) != -1); in ATF_TEST_CASE_BODY()
189 ATF_REQUIRE(stat("dest.txt", &sb) != -1); in ATF_TEST_CASE_BODY()
233 ATF_REQUIRE(waitpid(pid, &status, 0) != -1); in ATF_TEST_CASE_BODY()
286 const char *str = "a string - aaaabbbb"; in ATF_TEST_CASE_BODY()
323 ATF_REQUIRE(write(15, message.c_str(), message.length()) != -1); in ATF_TEST_CASE_BODY()
346 const pid_t control = fork(); in ATF_TEST_CASE_BODY() local
347 ATF_REQUIRE(control != -1); in ATF_TEST_CASE_BODY()
348 if (control == 0) in ATF_TEST_CASE_BODY()
352 ATF_REQUIRE(waitpid(control, &status, 0) != -1); in ATF_TEST_CASE_BODY()
361 const pid_t parent = atf::utils::fork(); in ATF_TEST_CASE_BODY() local
362 ATF_REQUIRE(parent != -1); in ATF_TEST_CASE_BODY()
363 if (parent == 0) { in ATF_TEST_CASE_BODY()
365 ATF_REQUIRE(child != -1); in ATF_TEST_CASE_BODY()
373 std::cout << "Parent output\n"; in ATF_TEST_CASE_BODY()
374 std::cerr << "Parent error\n"; in ATF_TEST_CASE_BODY()
379 atf::utils::wait(parent, 40, in ATF_TEST_CASE_BODY()
380 "Parent output\n" in ATF_TEST_CASE_BODY()
383 "Parent error\n"); in ATF_TEST_CASE_BODY()
390 const pid_t control = fork(); in ATF_TEST_CASE_BODY() local
391 ATF_REQUIRE(control != -1); in ATF_TEST_CASE_BODY()
392 if (control == 0) in ATF_TEST_CASE_BODY()
396 ATF_REQUIRE(waitpid(control, &status, 0) != -1); in ATF_TEST_CASE_BODY()
405 const pid_t control = fork(); in ATF_TEST_CASE_BODY() local
406 ATF_REQUIRE(control != -1); in ATF_TEST_CASE_BODY()
407 if (control == 0) in ATF_TEST_CASE_BODY()
411 ATF_REQUIRE(waitpid(control, &status, 0) != -1); in ATF_TEST_CASE_BODY()
420 const pid_t control = fork(); in ATF_TEST_CASE_BODY() local
421 ATF_REQUIRE(control != -1); in ATF_TEST_CASE_BODY()
422 if (control == 0) in ATF_TEST_CASE_BODY()
426 ATF_REQUIRE(waitpid(control, &status, 0) != -1); in ATF_TEST_CASE_BODY()
435 const pid_t control = fork(); in ATF_TEST_CASE_BODY() local
436 ATF_REQUIRE(control != -1); in ATF_TEST_CASE_BODY()
437 if (control == 0) in ATF_TEST_CASE_BODY()
438 fork_and_wait(123, "save:my-output.txt", "Some error\n"); in ATF_TEST_CASE_BODY()
441 ATF_REQUIRE(waitpid(control, &status, 0) != -1); in ATF_TEST_CASE_BODY()
445 ATF_REQUIRE(atf::utils::compare_file("my-output.txt", "Some output\n")); in ATF_TEST_CASE_BODY()
452 const pid_t control = fork(); in ATF_TEST_CASE_BODY() local
453 ATF_REQUIRE(control != -1); in ATF_TEST_CASE_BODY()
454 if (control == 0) in ATF_TEST_CASE_BODY()
455 fork_and_wait(123, "Some output\n", "save:my-output.txt"); in ATF_TEST_CASE_BODY()
458 ATF_REQUIRE(waitpid(control, &status, 0) != -1); in ATF_TEST_CASE_BODY()
462 ATF_REQUIRE(atf::utils::compare_file("my-output.txt", "Some error\n")); in ATF_TEST_CASE_BODY()
466 // ------------------------------------------------------------------------
468 // ------------------------------------------------------------------------