diff options
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/checkers/android/cloexec-open.cpp')
-rw-r--r-- | clang-tools-extra/test/clang-tidy/checkers/android/cloexec-open.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
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); |