File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -203,6 +203,8 @@ static void createDumpFile(const Settings& settings,
203203 << " long_bit=\" " << settings.platform .long_bit << ' \" '
204204 << " long_long_bit=\" " << settings.platform .long_long_bit << ' \" '
205205 << " pointer_bit=\" " << (settings.platform .sizeof_pointer * settings.platform .char_bit ) << ' \" '
206+ << " wchar_t_bit=\" " << (settings.platform .sizeof_wchar_t * settings.platform .char_bit ) << ' \" '
207+ << " size_t_bit=\" " << (settings.platform .sizeof_size_t * settings.platform .char_bit ) << ' \" '
206208 << " />" << ' \n ' ;
207209}
208210
Original file line number Diff line number Diff line change @@ -2261,3 +2261,18 @@ def test_ignore_project_2(tmpdir):
22612261 exitcode , stdout , _ = cppcheck (args , cwd = tmpdir )
22622262 assert exitcode == 1 , stdout
22632263 assert stdout .splitlines () == lines_exp
2264+
2265+
2266+ def test_dumpfile_platform (tmpdir ):
2267+ test_file = os .path .join (tmpdir , 'test.c' )
2268+ with open (test_file , 'wt' ) as f :
2269+ f .write ('x=1;\n ' )
2270+ cppcheck ('--dump --platform=unix64 test.c' .split (), cwd = tmpdir )
2271+ platform = ''
2272+ with open (test_file + '.dump' , 'rt' ) as f :
2273+ for line in f :
2274+ if line .find ('<platform name="' ) > 0 :
2275+ platform = line .strip ()
2276+ break
2277+ assert ' wchar_t_bit="' in platform
2278+ assert ' size_t_bit="' in platform
You can’t perform that action at this time.
0 commit comments