[clang-tidy] Use more widely available headers for protability-restrict-system-includ...
authorPaula Toth <paulatoth@google.com>
Tue, 10 Mar 2020 23:52:57 +0000 (16:52 -0700)
committerPaula Toth <paulatoth@google.com>
Tue, 10 Mar 2020 23:54:11 +0000 (16:54 -0700)
clang-tools-extra/test/clang-tidy/checkers/portability-restrict-system-includes-allow.cpp
clang-tools-extra/test/clang-tidy/checkers/portability-restrict-system-includes-disallow.cpp
clang-tools-extra/test/clang-tidy/checkers/portability-restrict-system-includes-glob.cpp

index faab977..e3a9376 100644 (file)
@@ -1,9 +1,9 @@
 // RUN: %check_clang_tidy %s portability-restrict-system-includes %t \
-// RUN:     -- -config="{CheckOptions: [{key: portability-restrict-system-includes.Includes, value: '*,-stdio.h'}]}"
+// RUN:     -- -config="{CheckOptions: [{key: portability-restrict-system-includes.Includes, value: '*,-stddef.h'}]}"
 
-// Test block-list functionality: allow all but stdio.h.
+// Test block-list functionality: allow all but stddef.h.
 
-#include <stdio.h>
-// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: system include stdio.h not allowed
-#include <stdlib.h>
-#include <string.h>
+#include <stddef.h>
+// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: system include stddef.h not allowed
+#include <stdint.h>
+#include <float.h>
index 58c1d43..f73cbbf 100644 (file)
@@ -1,10 +1,10 @@
 // RUN: %check_clang_tidy %s portability-restrict-system-includes %t \
-// RUN:     -- -config="{CheckOptions: [{key: portability-restrict-system-includes.Includes, value: '-*,stdio.h'}]}"
+// RUN:     -- -config="{CheckOptions: [{key: portability-restrict-system-includes.Includes, value: '-*,stddef.h'}]}"
 
-// Test allow-list functionality: disallow all but stdio.h.
+// Test allow-list functionality: disallow all but stddef.h.
 
-#include <stdio.h>
-#include <stdlib.h>
-// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: system include stdlib.h not allowed
-#include <string.h>
-// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: system include string.h not allowed
+#include <stddef.h>
+#include <stdint.h>
+// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: system include stdint.h not allowed
+#include <float.h>
+// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: system include float.h not allowed
index ccde943..bee7ec7 100644 (file)
@@ -4,7 +4,7 @@
 // Test glob functionality: disallow all headers except those that match
 // pattern "std*.h".
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: system include string.h not allowed
+#include <stddef.h>
+#include <stdint.h>
+#include <float.h>
+// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: system include float.h not allowed