MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / test_build_system_integration

Function test_build_system_integration

addons/test/y2038_test.py:120–142  ·  view source on GitHub ↗

Test that Y2038 flags are properly parsed from cppcheck dump file configuration

()

Source from the content-addressed store, hash-verified

118
119
120def test_build_system_integration():
121 """Test that Y2038 flags are properly parsed from cppcheck dump file configuration"""
122 from addons.y2038 import parse_dump_config
123
124 # Test Y2038-safe configuration string (as cppcheck would generate it)
125 config_string = "_TIME_BITS=64;_FILE_OFFSET_BITS=64;_USE_TIME_BITS64"
126 result = parse_dump_config(config_string)
127 # Y2038-safe flags should be detected
128 assert result['time_bits_defined'] is True
129 assert result['time_bits_value'] == 64
130 assert result['use_time_bits64_defined'] is True
131 assert result['file_offset_bits_defined'] is True
132 assert result['file_offset_bits_value'] == 64
133
134 # Test partial Y2038 configuration
135 partial_config = "_TIME_BITS=32;_FILE_OFFSET_BITS=64"
136 result = parse_dump_config(partial_config)
137 # Should detect the flags with their actual values
138 assert result['time_bits_defined'] is True
139 assert result['time_bits_value'] == 32 # Not Y2038-safe value
140 assert result['use_time_bits64_defined'] is False
141 assert result['file_offset_bits_defined'] is True
142 assert result['file_offset_bits_value'] == 64
143
144
145def test_arguments_regression():

Callers

nothing calls this directly

Calls 1

parse_dump_configFunction · 0.90

Tested by

no test coverage detected