Skip to content

Commit

Permalink
fix review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
danmar committed Nov 16, 2023
1 parent 538e77e commit 3cdd03e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 0 additions & 2 deletions lib/cppcheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -933,8 +933,6 @@ unsigned int CppCheck::checkFile(const std::string& filename, const std::string

if (!hasValidConfig && currCfg == *configurations.rbegin()) {
// If there is no valid configuration then report error..
mExitCode = 1;

std::string file = Path::fromNativeSeparators(o.location.file());
if (mSettings.relativePaths)
file = Path::getRelativePath(file, mSettings.basePaths);
Expand Down
3 changes: 2 additions & 1 deletion test/cli/test-other.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ def test_preprocessor_error(tmpdir):
test_file = os.path.join(tmpdir, '10866.c')
with open(test_file, 'wt') as f:
f.write('#error test\nx=1;\n')
_, _, stderr = cppcheck([test_file])
exitcode, _, stderr = cppcheck(['--error-exitcode=1', test_file])
assert 'preprocessorErrorDirective' in stderr
assert exitcode != 0


def test_invalid_library(tmpdir):
Expand Down

0 comments on commit 3cdd03e

Please sign in to comment.