aboutsummaryrefslogtreecommitdiff
path: root/clang-tools-extra/test/clang-tidy/checkers/android
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/checkers/android')
-rw-r--r--clang-tools-extra/test/clang-tidy/checkers/android/cloexec-memfd-create.cpp10
-rw-r--r--clang-tools-extra/test/clang-tidy/checkers/android/cloexec-open.cpp38
-rw-r--r--clang-tools-extra/test/clang-tidy/checkers/android/cloexec-socket.cpp14
3 files changed, 31 insertions, 31 deletions
diff --git a/clang-tools-extra/test/clang-tidy/checkers/android/cloexec-memfd-create.cpp b/clang-tools-extra/test/clang-tidy/checkers/android/cloexec-memfd-create.cpp
index b2c299b..d1d77d3 100644
--- a/clang-tools-extra/test/clang-tidy/checkers/android/cloexec-memfd-create.cpp
+++ b/clang-tools-extra/test/clang-tidy/checkers/android/cloexec-memfd-create.cpp
@@ -1,4 +1,4 @@
-// RUN: %check_clang_tidy --match-partial-fixes %s android-cloexec-memfd-create %t
+// RUN: %check_clang_tidy %s android-cloexec-memfd-create %t
#define MFD_ALLOW_SEALING 1
#define __O_CLOEXEC 3
@@ -17,19 +17,19 @@ extern "C" int memfd_create(const char *name, unsigned int flags);
void a() {
memfd_create(NULL, MFD_ALLOW_SEALING);
// CHECK-MESSAGES: :[[@LINE-1]]:39: warning: 'memfd_create' should use MFD_CLOEXEC where possible [android-cloexec-memfd-create]
- // CHECK-FIXES: memfd_create(NULL, MFD_ALLOW_SEALING | MFD_CLOEXEC)
+ // CHECK-FIXES: memfd_create(NULL, MFD_ALLOW_SEALING | MFD_CLOEXEC);
TEMP_FAILURE_RETRY(memfd_create(NULL, MFD_ALLOW_SEALING));
// CHECK-MESSAGES: :[[@LINE-1]]:58: warning: 'memfd_create'
- // CHECK-FIXES: TEMP_FAILURE_RETRY(memfd_create(NULL, MFD_ALLOW_SEALING | MFD_CLOEXEC))
+ // CHECK-FIXES: TEMP_FAILURE_RETRY(memfd_create(NULL, MFD_ALLOW_SEALING | MFD_CLOEXEC));
}
void f() {
memfd_create(NULL, 3);
// CHECK-MESSAGES: :[[@LINE-1]]:23: warning: 'memfd_create'
- // CHECK-FIXES: memfd_create(NULL, 3 | MFD_CLOEXEC)
+ // CHECK-FIXES: memfd_create(NULL, 3 | MFD_CLOEXEC);
TEMP_FAILURE_RETRY(memfd_create(NULL, 3));
// CHECK-MESSAGES: :[[@LINE-1]]:42: warning: 'memfd_create'
- // CHECK-FIXES: TEMP_FAILURE_RETRY(memfd_create(NULL, 3 | MFD_CLOEXEC))
+ // CHECK-FIXES: TEMP_FAILURE_RETRY(memfd_create(NULL, 3 | MFD_CLOEXEC));
int flag = 3;
memfd_create(NULL, flag);
diff --git a/clang-tools-extra/test/clang-tidy/checkers/android/cloexec-open.cpp b/clang-tools-extra/test/clang-tidy/checkers/android/cloexec-open.cpp
index 651e469..46e30ab 100644
--- a/clang-tools-extra/test/clang-tidy/checkers/android/cloexec-open.cpp
+++ b/clang-tools-extra/test/clang-tidy/checkers/android/cloexec-open.cpp
@@ -1,4 +1,4 @@
-// RUN: %check_clang_tidy --match-partial-fixes %s android-cloexec-open %t
+// RUN: %check_clang_tidy %s android-cloexec-open %t
#define O_RDWR 1
#define O_EXCL 2
@@ -19,67 +19,67 @@ extern "C" int openat(int dirfd, const char *pathname, int flags, ...);
void a() {
open("filename", O_RDWR);
// CHECK-MESSAGES: :[[@LINE-1]]:26: warning: 'open' should use O_CLOEXEC where possible [android-cloexec-open]
- // CHECK-FIXES: O_RDWR | O_CLOEXEC
+ // CHECK-FIXES: open("filename", O_RDWR | O_CLOEXEC);
TEMP_FAILURE_RETRY(open("filename", O_RDWR));
// CHECK-MESSAGES: :[[@LINE-1]]:45: warning: 'open' should use O_CLOEXEC where
- // CHECK-FIXES: O_RDWR | O_CLOEXEC
+ // CHECK-FIXES: TEMP_FAILURE_RETRY(open("filename", O_RDWR | O_CLOEXEC));
open("filename", O_RDWR | O_EXCL);
// CHECK-MESSAGES: :[[@LINE-1]]:35: warning: 'open' should use O_CLOEXEC where
- // CHECK-FIXES: O_RDWR | O_EXCL | O_CLOEXEC
+ // CHECK-FIXES: open("filename", O_RDWR | O_EXCL | O_CLOEXEC);
TEMP_FAILURE_RETRY(open("filename", O_RDWR | O_EXCL));
// CHECK-MESSAGES: :[[@LINE-1]]:54: warning: 'open' should use O_CLOEXEC where
- // CHECK-FIXES: O_RDWR | O_EXCL | O_CLOEXEC
+ // CHECK-FIXES: TEMP_FAILURE_RETRY(open("filename", O_RDWR | O_EXCL | O_CLOEXEC));
}
void b() {
open64("filename", O_RDWR);
// CHECK-MESSAGES: :[[@LINE-1]]:28: warning: 'open64' should use O_CLOEXEC where possible [android-cloexec-open]
- // CHECK-FIXES: O_RDWR | O_CLOEXEC
+ // CHECK-FIXES: open64("filename", O_RDWR | O_CLOEXEC);
TEMP_FAILURE_RETRY(open64("filename", O_RDWR));
// CHECK-MESSAGES: :[[@LINE-1]]:47: warning: 'open64' should use O_CLOEXEC where
- // CHECK-FIXES: O_RDWR | O_CLOEXEC
+ // CHECK-FIXES: TEMP_FAILURE_RETRY(open64("filename", O_RDWR | O_CLOEXEC));
open64("filename", O_RDWR | O_EXCL);
// CHECK-MESSAGES: :[[@LINE-1]]:37: warning: 'open64' should use O_CLOEXEC where
- // CHECK-FIXES: O_RDWR | O_EXCL | O_CLOEXEC
+ // CHECK-FIXES: open64("filename", O_RDWR | O_EXCL | O_CLOEXEC);
TEMP_FAILURE_RETRY(open64("filename", O_RDWR | O_EXCL));
// CHECK-MESSAGES: :[[@LINE-1]]:56: warning: 'open64' should use O_CLOEXEC where
- // CHECK-FIXES: O_RDWR | O_EXCL | O_CLOEXEC
+ // CHECK-FIXES: TEMP_FAILURE_RETRY(open64("filename", O_RDWR | O_EXCL | O_CLOEXEC));
}
void c() {
openat(0, "filename", O_RDWR);
// CHECK-MESSAGES: :[[@LINE-1]]:31: warning: 'openat' should use O_CLOEXEC where possible [android-cloexec-open]
- // CHECK-FIXES: O_RDWR | O_CLOEXEC
+ // CHECK-FIXES: openat(0, "filename", O_RDWR | O_CLOEXEC);
TEMP_FAILURE_RETRY(openat(0, "filename", O_RDWR));
// CHECK-MESSAGES: :[[@LINE-1]]:50: warning: 'openat' should use O_CLOEXEC where
- // CHECK-FIXES: O_RDWR | O_CLOEXEC
+ // CHECK-FIXES: TEMP_FAILURE_RETRY(openat(0, "filename", O_RDWR | O_CLOEXEC));
openat(0, "filename", O_RDWR | O_EXCL);
// CHECK-MESSAGES: :[[@LINE-1]]:40: warning: 'openat' should use O_CLOEXEC where
- // CHECK-FIXES: O_RDWR | O_EXCL | O_CLOEXEC
+ // CHECK-FIXES: openat(0, "filename", O_RDWR | O_EXCL | O_CLOEXEC);
TEMP_FAILURE_RETRY(openat(0, "filename", O_RDWR | O_EXCL));
// CHECK-MESSAGES: :[[@LINE-1]]:59: warning: 'openat' should use O_CLOEXEC where
- // CHECK-FIXES: O_RDWR | O_EXCL | O_CLOEXEC
+ // CHECK-FIXES: TEMP_FAILURE_RETRY(openat(0, "filename", O_RDWR | O_EXCL | O_CLOEXEC));
}
void f() {
open("filename", 3);
// CHECK-MESSAGES: :[[@LINE-1]]:21: warning: 'open' should use O_CLOEXEC where possible [android-cloexec-open]
- // CHECK-FIXES: 3 | O_CLOEXEC
+ // CHECK-FIXES: open("filename", 3 | O_CLOEXEC);
TEMP_FAILURE_RETRY(open("filename", 3));
// CHECK-MESSAGES: :[[@LINE-1]]:40: warning: 'open' should use O_CLOEXEC where
- // CHECK-FIXES: 3 | O_CLOEXEC
+ // CHECK-FIXES: TEMP_FAILURE_RETRY(open("filename", 3 | O_CLOEXEC));
open64("filename", 3);
// CHECK-MESSAGES: :[[@LINE-1]]:23: warning: 'open64' should use O_CLOEXEC where possible [android-cloexec-open]
- // CHECK-FIXES: 3 | O_CLOEXEC
+ // CHECK-FIXES: open64("filename", 3 | O_CLOEXEC);
TEMP_FAILURE_RETRY(open64("filename", 3));
// CHECK-MESSAGES: :[[@LINE-1]]:42: warning: 'open64' should use O_CLOEXEC where
- // CHECK-FIXES: 3 | O_CLOEXEC
+ // CHECK-FIXES: TEMP_FAILURE_RETRY(open64("filename", 3 | O_CLOEXEC));
openat(0, "filename", 3);
// CHECK-MESSAGES: :[[@LINE-1]]:26: warning: 'openat' should use O_CLOEXEC where possible [android-cloexec-open]
- // CHECK-FIXES: 3 | O_CLOEXEC
+ // CHECK-FIXES: openat(0, "filename", 3 | O_CLOEXEC);
TEMP_FAILURE_RETRY(openat(0, "filename", 3));
// CHECK-MESSAGES: :[[@LINE-1]]:45: warning: 'openat' should use O_CLOEXEC where
- // CHECK-FIXES: 3 | O_CLOEXEC
+ // CHECK-FIXES: TEMP_FAILURE_RETRY(openat(0, "filename", 3 | O_CLOEXEC));
int flag = 3;
open("filename", flag);
diff --git a/clang-tools-extra/test/clang-tidy/checkers/android/cloexec-socket.cpp b/clang-tools-extra/test/clang-tidy/checkers/android/cloexec-socket.cpp
index d4d58640..3a25a93 100644
--- a/clang-tools-extra/test/clang-tidy/checkers/android/cloexec-socket.cpp
+++ b/clang-tools-extra/test/clang-tidy/checkers/android/cloexec-socket.cpp
@@ -1,4 +1,4 @@
-// RUN: %check_clang_tidy --match-partial-fixes %s android-cloexec-socket %t
+// RUN: %check_clang_tidy %s android-cloexec-socket %t
#define SOCK_STREAM 1
#define SOCK_DGRAM 2
@@ -17,25 +17,25 @@ extern "C" int socket(int domain, int type, int protocol);
void a() {
socket(0, SOCK_STREAM, 0);
// CHECK-MESSAGES: :[[@LINE-1]]:24: warning: 'socket' should use SOCK_CLOEXEC where possible [android-cloexec-socket]
- // CHECK-FIXES: socket(0, SOCK_STREAM | SOCK_CLOEXEC, 0)
+ // CHECK-FIXES: socket(0, SOCK_STREAM | SOCK_CLOEXEC, 0);
TEMP_FAILURE_RETRY(socket(0, SOCK_STREAM, 0));
// CHECK-MESSAGES: :[[@LINE-1]]:43: warning: 'socket'
- // CHECK-FIXES: TEMP_FAILURE_RETRY(socket(0, SOCK_STREAM | SOCK_CLOEXEC, 0))
+ // CHECK-FIXES: TEMP_FAILURE_RETRY(socket(0, SOCK_STREAM | SOCK_CLOEXEC, 0));
socket(0, SOCK_STREAM | SOCK_DGRAM, 0);
// CHECK-MESSAGES: :[[@LINE-1]]:37: warning: 'socket'
- // CHECK-FIXES: socket(0, SOCK_STREAM | SOCK_DGRAM | SOCK_CLOEXEC, 0)
+ // CHECK-FIXES: socket(0, SOCK_STREAM | SOCK_DGRAM | SOCK_CLOEXEC, 0);
TEMP_FAILURE_RETRY(socket(0, SOCK_STREAM | SOCK_DGRAM, 0));
// CHECK-MESSAGES: :[[@LINE-1]]:56: warning: 'socket'
- // CHECK-FIXES: TEMP_FAILURE_RETRY(socket(0, SOCK_STREAM | SOCK_DGRAM | SOCK_CLOEXEC, 0))
+ // CHECK-FIXES: TEMP_FAILURE_RETRY(socket(0, SOCK_STREAM | SOCK_DGRAM | SOCK_CLOEXEC, 0));
}
void f() {
socket(0, 3, 0);
// CHECK-MESSAGES: :[[@LINE-1]]:14: warning: 'socket'
- // CHECK-FIXES: socket(0, 3 | SOCK_CLOEXEC, 0)
+ // CHECK-FIXES: socket(0, 3 | SOCK_CLOEXEC, 0);
TEMP_FAILURE_RETRY(socket(0, 3, 0));
// CHECK-MESSAGES: :[[@LINE-1]]:33: warning: 'socket'
- // CHECK-FIXES: TEMP_FAILURE_RETRY(socket(0, 3 | SOCK_CLOEXEC, 0))
+ // CHECK-FIXES: TEMP_FAILURE_RETRY(socket(0, 3 | SOCK_CLOEXEC, 0));
int flag = 3;
socket(0, flag, 0);