OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 '''Unit tests for the rc_header formatter''' | 6 '''Unit tests for the rc_header formatter''' |
7 | 7 |
8 # GRD samples exceed the 80 character limit. | 8 # GRD samples exceed the 80 character limit. |
9 # pylint: disable-msg=C6310 | 9 # pylint: disable-msg=C6310 |
10 | 10 |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 | 174 |
175 # Using the default rc_header format string. | 175 # Using the default rc_header format string. |
176 output = rc_header.FormatDefines(grd, grd.ShouldOutputAllResourceDefines(), | 176 output = rc_header.FormatDefines(grd, grd.ShouldOutputAllResourceDefines(), |
177 grd.GetRcHeaderFormat()) | 177 grd.GetRcHeaderFormat()) |
178 self.assertEqual(('#define IDR_LOGO 300\n' | 178 self.assertEqual(('#define IDR_LOGO 300\n' |
179 '#define IDS_GREETING 10000\n' | 179 '#define IDS_GREETING 10000\n' |
180 '#define IDS_BONGO 10001\n'), ''.join(output)) | 180 '#define IDS_BONGO 10001\n'), ''.join(output)) |
181 | 181 |
182 # Using a custom rc_header format string. | 182 # Using a custom rc_header format string. |
183 grd.AssignRcHeaderFormat( | 183 grd.AssignRcHeaderFormat( |
184 '#define {textual_id} _Pragma("{textual_id}") {numeric_id}\n') | 184 '#define {textual_id} _Pragma("{textual_id}") {numeric_id}') |
185 output = rc_header.FormatDefines(grd, grd.ShouldOutputAllResourceDefines(), | 185 output = rc_header.FormatDefines(grd, grd.ShouldOutputAllResourceDefines(), |
186 grd.GetRcHeaderFormat()) | 186 grd.GetRcHeaderFormat()) |
187 self.assertEqual(('#define IDR_LOGO _Pragma("IDR_LOGO") 300\n' | 187 self.assertEqual(('#define IDR_LOGO _Pragma("IDR_LOGO") 300\n' |
188 '#define IDS_GREETING _Pragma("IDS_GREETING") 10000\n' | 188 '#define IDS_GREETING _Pragma("IDS_GREETING") 10000\n' |
189 '#define IDS_BONGO _Pragma("IDS_BONGO") 10001\n'), | 189 '#define IDS_BONGO _Pragma("IDS_BONGO") 10001\n'), |
190 ''.join(output)) | 190 ''.join(output)) |
191 | 191 |
192 if __name__ == '__main__': | 192 if __name__ == '__main__': |
193 unittest.main() | 193 unittest.main() |
OLD | NEW |