From fec1a7cb40c873753eda6ed9129b39a49aad2e78 Mon Sep 17 00:00:00 2001 From: John Bytheway Date: Sat, 11 Apr 2020 13:57:37 -0400 Subject: [PATCH] Avoid limits.h in clang-tidy-plugin tests --- tools/clang-tidy-plugin/test/no-long.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/clang-tidy-plugin/test/no-long.cpp b/tools/clang-tidy-plugin/test/no-long.cpp index 9ea4b1b0c9643..a0a7f1b8d87e6 100644 --- a/tools/clang-tidy-plugin/test/no-long.cpp +++ b/tools/clang-tidy-plugin/test/no-long.cpp @@ -1,8 +1,13 @@ // RUN: %check_clang_tidy %s cata-no-long %t -- -plugins=%cata_plugin -- -#include #include +// Want these defines without including limits.h. They're probably not the +// correct values, but it doesn't matter. +#define LONG_MIN -2147483647 +#define LONG_MAX 2147483647 +#define ULONG_MAX 4294967295 + long i1; // CHECK-MESSAGES: warning: Variable 'i1' declared as 'long'. Prefer int or int64_t to long. [cata-no-long]