Commit Graph

27 Commits

Author SHA1 Message Date
Ben Boeckel
677097ac1d TestDriver: ignore strcpy call
clang-analyzer has a check for any use of `strcpy`. This usage is safe
because it is allocated above using the length of the string.
2019-12-05 14:24:34 -05:00
Sean McBride
1d0d4167cf TestDriver: Fix -Wzero-as-null-pointer-constant warnings 2019-09-18 14:05:39 -04:00
Brad King
5ba76299f8 Merge topic 'nolint_typedef_testdriver'
bbbcbb1a48 TestDriver: Disable clang-tidy 'modernize-use-using'

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2118
2018-06-01 09:48:51 -04:00
Sylvain Joubert
bbbcbb1a48 TestDriver: Disable clang-tidy 'modernize-use-using' 2018-05-31 13:51:40 +02:00
Sander Vrijders
3af0438b4b TestDriver: Replace strncpy with strcpy
GCC 8.1.0 now gives an error if `strncpy` is called with a bound
depending on the length of the source argument.  Replace `strncpy` with
`strcpy` as the length is known a priori.

Fixes: #18038
2018-05-30 09:45:57 -04:00
Sylvain Joubert
72d3161a7f TestDriver: fix style-'variableScope' cppcheck warning
When applied on a user project, cppcheck complains that the 'test_name'
variable could have a reduced scope.
2017-11-22 19:54:00 +01:00
Brad King
221ffabfad TestDriver: Fix -Wconversion warning
Since commit v3.8.0-rc1~51^2~1 (TestDriver: calc NumTests at compile
time, 2017-01-24) we convert an expression that uses `sizeof()` to an
`int` as a compile-time constant.  Some GCC versions warn about this
with `-Wconversion`.  Add a cast to avoid the warning.
2017-07-14 08:01:26 -04:00
Brad King
608cc887c7 TestDriver: Remove unused local variable initialization 2017-05-10 10:01:15 -04:00
Daniel Pfeifer
eb86b4cec1 TestDriver: fix/silence clang-tidy warnings 2017-01-24 22:24:06 +01:00
Daniel Pfeifer
178c897374 TestDriver: calc NumTests at compile time 2017-01-24 22:24:06 +01:00
Daniel Pfeifer
3bb4a79826 TestDriver: use for loop 2017-01-24 22:24:06 +01:00
Daniel Pfeifer
60b68304f2 TestDriver: abstract CM_CAST macro 2017-01-24 22:24:06 +01:00
Daniel Pfeifer
1731b90cd0 TestDriver: Revise C++ coding style using clang-format 2017-01-24 22:24:06 +01:00
Sylvain Joubert
cd344e3a62 create_test_sourcelist: Use safer strncpy instead of strcpy
Clang-tidy advises to use a safer function in place of strcpy.
This should avoid such warnings in user build using clang-tidy.
2016-08-25 10:56:50 -04:00
Brad King
63fc8dcdb8 create_test_sourcelist: Suppress MSVC warnings in test driver (#15066)
Suggested-by: Ken Moreland <kmorel@sandia.gov>
2014-08-07 09:17:44 -04:00
Sean McBride
50ca77f4a0 create_test_sourcelist: Initialize variable at declaration
Clang -Wconditional-uninitialized warns otherwise.
2014-03-31 09:41:05 -04:00
Sean McBride
ed675a92a1 create_test_sourcelist: Fix linkage in generated test driver code
Mark private function/global with static linkage.
2013-11-12 09:27:11 -05:00
Matt McCormick
7eddefd8f1 TestDriver.cxx.in: Untrusted array index read.
As reported by Coverity Scan, if the configured file contains a #include,

  Untrusted array index read
  The array index could be controlled by an attacker, leading to reads outside
  the bounds of the array.
  In main: Read from array at index computed using an unscrutinized value from
  an untrusted source (CWE-129)

  CID 1081283 (#1 of 1): Untrusted array index read (TAINTED_SCALAR)
  25. tainted_data: Using tainted variable "testToRun" as an index into an array
  "cmakeGeneratedFunctionMapEntries".
2013-10-16 10:11:20 +00:00
Kitware Robot
7bbaa4283d Remove trailing whitespace from most CMake and C/C++ code
Our Git commit hooks disallow modification or addition of lines with
trailing whitespace.  Wipe out all remnants of trailing whitespace
everywhere except third-party code.

Run the following shell code:

git ls-files -z -- \
 bootstrap doxygen.config '*.readme' \
 '*.c' '*.cmake' '*.cpp' '*.cxx' \
 '*.el' '*.f' '*.f90' '*.h' '*.in' '*.in.l' '*.java' \
 '*.mm' '*.pike' '*.py' '*.txt' '*.vim' |
egrep -z -v '^(Utilities/cm|Source/(kwsys|CursesDialog/form)/)' |
egrep -z -v '^(Modules/CPack\..*\.in)' |
xargs -0 sed -i 's/ \+$//'
2012-08-13 14:18:39 -04:00
David Cole
95a6feaa66 COMP: Don't emit old style cast warning when configured as C++ but still allow being configured as C. Thanks to Monsieur Francois Bertel for the patch. 2008-12-09 10:56:41 -05:00
Amitha Perera
47aa926523 BUG: the return value of scanf should not be ignored 2008-11-25 09:52:21 -05:00
Bill Hoffman
ff7757e34c make sure tests flush output 2004-07-16 15:18:42 -04:00
Bill Hoffman
a613100b1e BUG: remove debug pop hacks, also remove duplicate call to argvc function 2004-05-08 14:55:07 -04:00
Ken Martin
c10cb4db5a fix warning maybe 2004-05-07 08:35:46 -04:00
Ken Martin
f299f4ae9c fix warning 2004-05-06 08:51:36 -04:00
Bill Hoffman
7eab2e4235 ENH: remove unused variable 2004-04-30 11:36:01 -04:00
Bill Hoffman
e539cf9f7c ENH: make test driver more flexible by using a configured file instead of generating all the code. fixes bug 28 2004-04-28 12:31:18 -04:00