summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--test/syscalls/linux/priority.cc3
-rw-r--r--test/syscalls/linux/wait.cc32
2 files changed, 18 insertions, 17 deletions
diff --git a/test/syscalls/linux/priority.cc b/test/syscalls/linux/priority.cc
index 69a58a422..3906c7132 100644
--- a/test/syscalls/linux/priority.cc
+++ b/test/syscalls/linux/priority.cc
@@ -192,7 +192,7 @@ TEST(GetpriorityTest, CloneMaintainsPriority) {
ASSERT_THAT(setpriority(PRIO_PROCESS, getpid(), kParentPriority),
SyscallSucceeds());
- ScopedThread([kParentPriority, kChildPriority]() {
+ ScopedThread th([]() {
// Check that priority equals that of parent thread
pid_t my_tid;
EXPECT_THAT(my_tid = syscall(__NR_gettid), SyscallSucceeds());
@@ -203,6 +203,7 @@ TEST(GetpriorityTest, CloneMaintainsPriority) {
EXPECT_THAT(setpriority(PRIO_PROCESS, my_tid, kChildPriority),
SyscallSucceeds());
});
+ th.Join();
// Check that parent's priority reemained the same even though
// the child's priority was altered
diff --git a/test/syscalls/linux/wait.cc b/test/syscalls/linux/wait.cc
index 2da0bf130..d1a4237d2 100644
--- a/test/syscalls/linux/wait.cc
+++ b/test/syscalls/linux/wait.cc
@@ -201,8 +201,8 @@ TEST_P(WaitAnyChildTest, MultipleFork) {
TEST_P(WaitAnyChildTest, CloneSIGCHLD) {
uintptr_t stack;
ASSERT_THAT(stack = AllocStack(), SyscallSucceeds());
- auto free = Cleanup(
- [this, stack] { ASSERT_THAT(FreeStack(stack), SyscallSucceeds()); });
+ auto free =
+ Cleanup([stack] { ASSERT_THAT(FreeStack(stack), SyscallSucceeds()); });
int child;
ASSERT_THAT(child = CloneAndExit(0, stack, SIGCHLD), SyscallSucceeds());
@@ -217,8 +217,8 @@ TEST_P(WaitAnyChildTest, ForkAndClone) {
uintptr_t stack;
ASSERT_THAT(stack = AllocStack(), SyscallSucceeds());
- auto free = Cleanup(
- [this, stack] { ASSERT_THAT(FreeStack(stack), SyscallSucceeds()); });
+ auto free =
+ Cleanup([stack] { ASSERT_THAT(FreeStack(stack), SyscallSucceeds()); });
int thread;
// Send SIGCHLD for normal wait semantics.
@@ -438,8 +438,8 @@ TEST_P(WaitSpecificChildTest, AfterExit) {
TEST_P(WaitSpecificChildTest, CloneSIGCHLD) {
uintptr_t stack;
ASSERT_THAT(stack = AllocStack(), SyscallSucceeds());
- auto free = Cleanup(
- [this, stack] { ASSERT_THAT(FreeStack(stack), SyscallSucceeds()); });
+ auto free =
+ Cleanup([stack] { ASSERT_THAT(FreeStack(stack), SyscallSucceeds()); });
int child;
ASSERT_THAT(child = CloneAndExit(0, stack, SIGCHLD), SyscallSucceeds());
@@ -453,8 +453,8 @@ TEST_P(WaitSpecificChildTest, CloneSIGCHLD) {
TEST_P(WaitSpecificChildTest, CloneNoSIGCHLD) {
uintptr_t stack;
ASSERT_THAT(stack = AllocStack(), SyscallSucceeds());
- auto free = Cleanup(
- [this, stack] { ASSERT_THAT(FreeStack(stack), SyscallSucceeds()); });
+ auto free =
+ Cleanup([stack] { ASSERT_THAT(FreeStack(stack), SyscallSucceeds()); });
int child;
ASSERT_THAT(child = CloneAndExit(0, stack, 0), SyscallSucceeds());
@@ -469,8 +469,8 @@ TEST_P(WaitSpecificChildTest, CloneNoSIGCHLD) {
TEST_P(WaitSpecificChildTest, CloneAfterExit) {
uintptr_t stack;
ASSERT_THAT(stack = AllocStack(), SyscallSucceeds());
- auto free = Cleanup(
- [this, stack] { ASSERT_THAT(FreeStack(stack), SyscallSucceeds()); });
+ auto free =
+ Cleanup([stack] { ASSERT_THAT(FreeStack(stack), SyscallSucceeds()); });
int child;
// Send SIGCHLD for normal wait semantics.
@@ -485,8 +485,8 @@ TEST_P(WaitSpecificChildTest, CloneAfterExit) {
TEST_P(WaitSpecificChildTest, CloneThread) {
uintptr_t stack;
ASSERT_THAT(stack = AllocStack(), SyscallSucceeds());
- auto free = Cleanup(
- [this, stack] { ASSERT_THAT(FreeStack(stack), SyscallSucceeds()); });
+ auto free =
+ Cleanup([stack] { ASSERT_THAT(FreeStack(stack), SyscallSucceeds()); });
int child;
ASSERT_THAT(child = CloneAndExit(15, stack, CLONE_THREAD), SyscallSucceeds());
@@ -521,8 +521,8 @@ TEST_P(WaitSpecificChildTest, AfterChildExecve) {
uintptr_t stack;
ASSERT_THAT(stack = AllocStack(), SyscallSucceeds());
- auto free = Cleanup(
- [this, stack] { ASSERT_THAT(FreeStack(stack), SyscallSucceeds()); });
+ auto free =
+ Cleanup([stack] { ASSERT_THAT(FreeStack(stack), SyscallSucceeds()); });
pid_t const child = fork();
if (child == 0) {
@@ -622,8 +622,8 @@ TEST(WaitTest, SignalExit) {
TEST(WaitTest, CloneWCLONE) {
uintptr_t stack;
ASSERT_THAT(stack = AllocStack(), SyscallSucceeds());
- auto free = Cleanup(
- [this, stack] { ASSERT_THAT(FreeStack(stack), SyscallSucceeds()); });
+ auto free =
+ Cleanup([stack] { ASSERT_THAT(FreeStack(stack), SyscallSucceeds()); });
int child;
ASSERT_THAT(child = CloneAndExit(0, stack, 0), SyscallSucceeds());