Hi,
after reading the ticket https://trac.cppcheck.net/ticket/8293
i wanted to create a test to verify the detection of bufferoverruns with strncpy().
So i added this code:
I realized that the class TestBufferOverrun does not use std.cfg, but the test needs it.
I'm not sure if it is ok to add std.cfg to the settings0 (i guess not), use another settings1 variable or place the test somewhere else.
What would you say?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you want to test that std.cfg is configured correctly then edit test/cfg/std.c.
If you want to test that the checker treats the library info correctly then the test should be in the testrunner. There is a similar test that has a "mystrncpy" function.. you can look at how that is implemented.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I see, i want to add checks to verify that the strncpy tests work correctly, i.e. if the library is configured correctly and errors (bufferoverflows) are detected by Cppcheck. So the tests should be implemented in std.c.
Hi,
after reading the ticket https://trac.cppcheck.net/ticket/8293
i wanted to create a test to verify the detection of bufferoverruns with strncpy().
So i added this code:
I realized that the class TestBufferOverrun does not use std.cfg, but the test needs it.
I'm not sure if it is ok to add std.cfg to the settings0 (i guess not), use another settings1 variable or place the test somewhere else.
What would you say?
the testrunner should not depend on files.
If you want to test that std.cfg is configured correctly then edit test/cfg/std.c.
If you want to test that the checker treats the library info correctly then the test should be in the testrunner. There is a similar test that has a "mystrncpy" function.. you can look at how that is implemented.
I see, i want to add checks to verify that the strncpy tests work correctly, i.e. if the library is configured correctly and errors (bufferoverflows) are detected by Cppcheck. So the tests should be implemented in std.c.
Thanks for the hint to the mystrncpy tests in testrunner.
They seem to be missing something too when looking at the tickets https://trac.cppcheck.net/ticket/8294 and https://trac.cppcheck.net/ticket/8293.
Last edit: versat 2017-12-18