Commit Graph

213 Commits

Author SHA1 Message Date
Leandro Penz d1af0b6478 Incomplete statement: test case for statement that begins with numeric constant. 2009-02-11 15:16:32 +00:00
Daniel Marjamäki eda1290e40 dangerous usage of erase: added check 2009-02-11 05:08:29 +00:00
Reijo Tomperi 9b9223480d Refactoring: reportErr takes now only one parameter, ErrorLogger::ErrorMessage, which contains all required information and also some help
functions for formatting it for output.
2009-02-10 21:51:52 +00:00
Daniel Marjamäki 71b4e5a912 stl: added testcase for bad iterator usage 2009-02-10 20:01:39 +00:00
Reijo Tomperi 4660b7648d Moved stloutofbounds check to CheckStl class. 2009-02-10 19:56:00 +00:00
Daniel Marjamäki c1638996f9 STL: added check for iterator usage 2009-02-10 19:40:21 +00:00
Reijo Tomperi 9dff3f4c52 Fix ticket #94 (STL container overrun). Check is currently behind --all 2009-02-09 22:25:44 +00:00
Reijo Tomperi 1373e14bc9 Fix ticket #93 (Write xml results into error stream instead of results.xml file.) and also refactor the
code to use ErrorLogger::reportErr() for all errors, for both xml and plain text. And move xml formatting 
from Cppcheck to CppcheckExecutor.
2009-02-09 20:51:04 +00:00
Daniel Marjamäki a5f88862b4 memory leak: keep track of --all better 2009-02-09 20:16:00 +00:00
Daniel Marjamäki 0cdb537a6a incomplete statement: added a testcase for a false positive 2009-02-09 20:15:14 +00:00
Daniel Marjamäki 574db37a6f uninitialized variables: added testcases and made a fix 2009-02-09 07:47:41 +00:00
Daniel Marjamäki e572cb3c1d Memory leak: Test code was supposed to call unknown function 2009-02-08 18:50:34 +00:00
Daniel Marjamäki 1637e867de mismatching allocation size: moved to error suite 2009-02-08 18:34:04 +00:00
Daniel Marjamäki d8e8e2c7ee Memory leaks: Make sure leak is found even when using unknown functions 2009-02-08 18:31:09 +00:00
Daniel Marjamäki 81ed48562c Memory leak: find memory leak in TestMemleak::unknownFunction2 2009-02-08 18:27:09 +00:00
Daniel Marjamäki 0361c9d338 Memory leak: Handling function that can't be traced into 2009-02-08 11:59:04 +00:00
Reijo Tomperi cb5974e94e Fixed issue about 4+5 being made a single token, problem appeared in recent commits. 2009-02-08 10:56:20 +00:00
Reijo Tomperi c345fa6186 Fix ticket #89 (False positive, (style) Redundant code - begins with numeric constant (e-value)) 2009-02-08 10:39:55 +00:00
Reijo Tomperi da3efe8fa2 Improve fix made for Ticket #85 to handle strings that are in 3 parts also. 2009-02-08 10:25:33 +00:00
Reijo Tomperi 4305d749ff Fixed ticket #88 (False positive, (style) Redundant code - begins with numeric constant) 2009-02-08 09:51:45 +00:00
Reijo Tomperi 200a159c67 Fix ticket #85 (False positive (style) Redundant code, begins with string) 2009-02-08 08:52:03 +00:00
Daniel Marjamäki 7ee193490f Memory leaks: Added todo testcase - handle function calls that can't be followed 2009-02-08 08:21:15 +00:00
Reijo Tomperi d48671bdfb Fixed more of ticket #81 (getting rid of compiler warnings) 2009-02-07 20:55:25 +00:00
Reijo Tomperi b211b8cbe8 Fix ticket #84 (unit testing: use "protected" instead of preprocessor) 2009-02-07 20:06:00 +00:00
Reijo Tomperi 798d86216a Fix ticket #83 (cppcheck hangs) and add a test case for it 2009-02-07 19:15:10 +00:00
Daniel Marjamäki 3c289e52c5 memory allocation: check for mismatching size 2009-02-07 10:54:39 +00:00
Daniel Marjamäki bb71f9e83e TestMemleak: fixed problems with wrong linenumbers. This fixes ticket 79 2009-02-07 09:44:57 +00:00
Daniel Marjamäki 67ad1d8c64 TestMemleak: Fixed tests 2009-02-06 18:49:30 +00:00
Daniel Marjamäki 3c7e40fe13 errmsg: use the error message dealloc-use 2009-02-06 06:22:44 +00:00
Daniel Marjamäki 7299d3e5b1 memleak: removed false positives for mismatching allocation and deallocation 2009-02-06 06:11:47 +00:00
Reijo Tomperi a06861948b Fixed: Ticket #78 Change (always) into (error) in error messages 2009-02-05 21:06:32 +00:00
Reijo Tomperi 09c13d844e Added test case linenumbers2 2009-02-05 20:29:55 +00:00
Daniel Marjamäki 10abbda6a7 memleak: corrected the wrong line number (#77) 2009-02-05 20:17:01 +00:00
Reijo Tomperi 7589dc3d16 testcppcheck.cpp file added, test case "linenumbers" added, codeblocks project file updated 2009-02-05 20:06:39 +00:00
Daniel Marjamäki 05e330ed38 incomplete statement: minor update 2009-02-05 18:57:53 +00:00
Daniel Marjamäki 9707217c15 activated TestClass:function 2009-02-04 19:42:40 +00:00
Daniel Marjamäki 7ccb6217bf remove casts: Added test case to ensure that function declarations are not reduced 2009-02-04 19:40:48 +00:00
Daniel Marjamäki 8187504cbb testclass: added todo testcase for #74 2009-02-04 19:31:25 +00:00
Daniel Marjamäki aeb573d529 returning pointer to local array 2009-02-04 18:49:19 +00:00
Daniel Marjamäki bd73d0913f charvar: fixed todo testcase 2009-02-04 17:12:53 +00:00
Daniel Marjamäki d73e6c398f testbufferoverrun: activated test 2009-02-04 16:58:44 +00:00
Daniel Marjamäki c46c4c50e9 memory leak: fixed ticket #9 2009-02-04 06:11:36 +00:00
Reijo Tomperi 142a21973a Fixed varid is 0 bug which happened with sizeof(var[0]) and added testcase for it 2009-02-03 21:42:50 +00:00
Daniel Marjamäki 59f95d311b tokenizer: setvarid handle variable declaration at start of token list 2009-02-02 19:19:36 +00:00
Daniel Marjamäki 0059ceefb9 Tokenizer: sizeof handling of 'sizeof(var[0])' 2009-02-02 18:59:32 +00:00
Daniel Marjamäki d0af67a1b1 Tokenizer: setVarId improved to handle declaration at the first token 2009-02-02 17:35:46 +00:00
Daniel Marjamäki 27c0f786bc tokenizer: improved sizeof handling 2009-02-02 17:27:34 +00:00
Daniel Marjamäki 0e291c772c TestTokenize: Added testcase sizeof2 (TODO) 2009-02-02 06:26:20 +00:00
Daniel Marjamäki dc994c346e testtokenize: sizeof handling 2009-02-02 06:21:48 +00:00
Daniel Marjamäki bbf4641304 testmemleak: fixed a test case 2009-02-02 06:21:00 +00:00
Daniel Marjamäki f66750c9f1 TestMemleak: Added test cases 2009-02-02 05:58:50 +00:00
Daniel Marjamäki 385c28a02e xml: generating better xml output 2009-02-01 18:00:47 +00:00
Reijo Tomperi 7da34ed249 Running astyle for the previous commits 2009-01-31 18:54:34 +00:00
Leandro Penz 7adcd0c355 dangerousfunctions: added check for mktemp (ticket #69), and refatored gets and scanf check from bufferoverrun into dangerousfunctions. 2009-01-31 18:24:48 +00:00
Daniel Marjamäki 81174a4817 mismatching allocation / deallocation: moved to --all 2009-01-31 17:54:31 +00:00
Daniel Marjamäki f6f72fc022 errmsg: output severity in messages. a fix to track severity in the memory leaks check 2009-01-31 13:57:27 +00:00
Daniel Marjamäki 25607d9f71 mismatching allocation and deallocation: added test case that currently generates false positives 2009-01-31 11:51:47 +00:00
Daniel Marjamäki 3457b38d7a errmsg: write severity in the message 2009-01-31 08:33:31 +00:00
Daniel Marjamäki 7d98c74d40 added test case TestBufferOverrun::sizeof2 2009-01-30 06:11:31 +00:00
Daniel Marjamäki 988d4c0d66 added todo testcase 2009-01-30 06:06:03 +00:00
Daniel Marjamäki e9d19840d2 preprocessor: Added testcase fmt2 that is commented out because it doesn't work yet 2009-01-28 20:19:46 +00:00
Daniel Marjamäki b7b055e885 tokenizer: fixed TestTokenizer::sizeof1 2009-01-28 17:38:32 +00:00
Daniel Marjamäki 12b6cf8c70 bad sizeof handling 2009-01-28 05:31:26 +00:00
Reijo Tomperi 2f7dec2fc3 Partial support for sizeof x, by converting it into sizeof(x). Does not handle complex structures. Closing ticket #65 2009-01-27 20:47:00 +00:00
Reijo Tomperi 64e3250f00 Fixed bug in multiCompare, which fixes ticket #66 ([False positive] "Buffer overrun" with "--all") 2009-01-27 19:30:01 +00:00
Daniel Marjamäki 8cd2979468 uninitialized member: don't check private constructors 2009-01-27 17:39:06 +00:00
Reijo Tomperi e764cc4f95 Fix ticket #25 (simplify "void f(x) int x; {" into "void f(int x) {") 2009-01-26 22:26:50 +00:00
Daniel Marjamäki 068b1458c2 memleak: class function usage (fixing #63) 2009-01-26 18:15:44 +00:00
Daniel Marjamäki ca0f007ca4 tokenizer: simplify redundant paranthesis 2009-01-26 16:38:08 +00:00
Leandro Penz 9fb11bbfcc memleak: strcat_result_assignment fixed by checking some functions for "x = func(x[),]". 2009-01-25 20:57:34 +00:00
Daniel Marjamäki 7037a3b4f6 testmemleak: removed the test case that was added in [1105]. It has been moved to the TestTokenizer instead 2009-01-25 19:40:29 +00:00
Daniel Marjamäki 4bb43e7e4d testtokenize: Added test case for simplifying '((x))' to '(x)' 2009-01-25 19:39:05 +00:00
Daniel Marjamäki bada255c80 testpreprocessor: removed unused test case 2009-01-25 19:18:18 +00:00
Reijo Tomperi da63428961 Added test case complex_free 2009-01-25 16:29:51 +00:00
Reijo Tomperi 7631b0b339 Test case added: strcat_result_assignment 2009-01-25 15:56:19 +00:00
Daniel Marjamäki 9c51729be6 preprocessor: stringify macros 2009-01-25 13:30:15 +00:00
Daniel Marjamäki 5acc6aca31 preprocessor: insert space. '#if(' => '#if (' 2009-01-24 19:28:30 +00:00
Leandro Penz 04faae2882 memleak: *x=malloc(); func(&x) is no longer reported as a leak (eliminated &use2). 2009-01-24 18:55:56 +00:00
Leandro Penz 835a749026 snprintf: more tests. 2009-01-24 18:55:07 +00:00
Reijo Tomperi 98d7f02ebc Added test case preprocessor_and_operation for ticket #55 (also fixed style from previous commit) 2009-01-24 18:50:09 +00:00
Daniel Marjamäki 8e7ff3bace testtokenize: updated 'TestTokenize::simplify_function_parameters' 2009-01-24 18:21:16 +00:00
Reijo Tomperi 67f30376e1 Added test case simplify_function_parameters 2009-01-24 07:56:47 +00:00
Daniel Marjamäki ca56520c29 memory leak: don't give false positive when deallocating member variable this->i (#53) 2009-01-23 19:24:52 +00:00
Daniel Marjamäki f31bd86a05 removed compiler warning 2009-01-23 18:55:40 +00:00
Daniel Marjamäki 193cffdb0b preprocessor: fixed bug with mixed macros ABC and ABCD 2009-01-23 17:14:42 +00:00
Daniel Marjamäki 67e4ea10c9 preprocessor: handle redefinition of macro 2009-01-22 20:19:07 +00:00
Daniel Marjamäki a9e84c5cd5 preprocessor: handle include guards by not checking for configurations in header files 2009-01-22 18:19:17 +00:00
Nicolas Le Cam b7e4f1319c Fix Preprocessor::read to handle char constant of more than one char, fixing issue #45; Fix the test that handle the case. 2009-01-21 21:45:17 +00:00
Nicolas Le Cam 42c608b6f0 Remove checks that are already covered well by most compilers (Unreachable Code; Assignment in Condition; Unused Variable). 2009-01-21 21:31:47 +00:00
Reijo Tomperi 53d02c0804 Fix Ticket #43, preprocessor: include file doesn't work so good in subfolders (note, because of other issues, checking will be very slow now
that this is fixed)
2009-01-21 21:03:46 +00:00
Reijo Tomperi 176dd41306 Fixed Ticket #40, Check copyright texts in files, now that we have new developers. 2009-01-21 20:04:20 +00:00
Reijo Tomperi 9f63e2227b Added test case multi_character_character 2009-01-21 19:12:28 +00:00
Daniel Marjamäki 76cb2310af preprocessor: handled problem with parsing strings when expanding macros 2009-01-21 17:11:24 +00:00
Daniel Marjamäki 1622922384 preprocessor: Added todo test. It crashes when it's used 2009-01-21 07:22:44 +00:00
Reijo Tomperi 6d8387914b Fixes test case "file2", fixes bug with include file handling 2009-01-20 22:25:49 +00:00
Daniel Marjamäki d82314b365 preprocessor: Handle ## 2009-01-20 18:28:24 +00:00
Daniel Marjamäki fad65663e5 tokenizer: tokenize ## better 2009-01-20 17:26:16 +00:00
Daniel Marjamäki 45661fed21 tokenizer: added testcase with include files. It should be fixed. 2009-01-20 17:05:42 +00:00
Reijo Tomperi df5adc5f4f Added test case preprocessor_doublesharp, executed ./runastyle for errormessage.h 2009-01-19 21:45:59 +00:00
Reijo Tomperi 4d0e3dac45 Added a test case and fixed bug. If #include was inside a string, cppcheck hanged in preprocessor. 2009-01-19 19:24:41 +00:00